When Jenkins job in running IP gets frozen and inaccessible - jenkins

I have set up some python script in Jenkins with AWS/Ubuntu server.
However, when I run a job, my ip address get inaccessible http://3.82.243.44:8080/, just spinning, and I can't do anything within Jenkins app
My AWS instance is showing as Running so I don't its an issue there.
This is what I latest installed on it
sudo apt-get install python3-pip
And this is what I'm trying to build (customer python build) in Jenkins
pip3 install -r requirements.txt
sbase install chromedriver latest
pytest --headless
If anyone has experience and what I may be doing wrong, please let me know.

It's happening the same to me. The only solution I have found for the moment is to stop de instance from the AWS console and start it again. I'm sill looking for a good solution for this problem, but i'm new in this "world".

Related

Did I overwrite my old version of Jenkins?

My Jenkins is running on CentOS 7 and I was looking to upgrade my Jenkins version 2.277.4 to 2.375.1. I tried using sudo yum update jenkins to update jenkins. I received this message: “Public key for jenkins-2.375.1-1.1.noarch.rpm is not installed”. I read an article telling me to pull the key from online, so I performed these commands:
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo --no-check-certificate
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
sudo yum update jenkins
Afterwards, I haven’t been able to correctly start Jenkins. Obviously, I should have just uploaded the new war file instead of using yum update.
Any time I try Sudo systemctl start jenkins I get this warning.
Warning: jenkins.service changed on disk. Run ‘systemctl daemon-reload’ to reload units.
Any suggestions on fixing this issue? Any way to revert back to the old version?
Thank you ahead of time!
**Edit: I tried reloading the daemon and restarting the service. However, my Jenkins start/restart is timing out even though I’ve set the timer to 10 mins.
Additionally, I installed java-11-openjdk during the upgrade, would that cause issues?

Ubuntu, shopsys install via composer, docker, still crashing

I wanna install shopsys via composer and docker, as is recommended.
https://github.com/shopsys/shopsys/blob/master/docs/installation/installation-using-docker-linux.md
I installed git, php-fpm (configured), postgres (configured), composer, docker, docker-compose.
sudo apt install git
sudo apt install php7.2-fpm
sudo apt install postgresql
sudo apt install composer
sudo apt install docker-ce
sudo apt install docker-compose
Everything ok.
I added my user to docker group.
sudo usermod -a -G docker $(whoami)
Ok.
Next I made folder /var/www/html/shopsys, created project shopsys via composer.
composer create-project shopsys/project-base --no-install --keep-vcs
cd project-base/
Then I run this in /var/www/html/shopsys/project-base.
./scripts/install.sh
Everything seems to be ok, until this.
[RuntimeException]
/var/www/html/vendor does not exist and could not be created.
I set rights to 777 for folder /var/www/html, and run it again, but same problem.
The I run this.
sudo composer install
It shows me this error.
....Exception\InvalidConfigurationException]
Invalid configuration for path "monolog.handlers.main": You can only use ex
cluded_http_codes/excluded_404s with a FingersCrossedHandler definition
In ScriptHandler.php line 294:
An error occurred when executing the "'shopsys:domains-urls:configure'" command:
In BaseNode.php line 319:
...\Exception\InvalidConfigurationException]
Invalid configuration for path "monolog.handlers.main": You can only use ex
cluded_http_codes/excluded_404s with a FingersCrossedHandler definition
...
etc., error is quite ugly.
Last error when i run script install.sh.
file_put_contents(/var/www/html/vendor/composer/installed.json): failed to open stream: Permission denied
But this folder does not exist.
ls: cannot access '/var/www/html/vendor/': No such file or directory
Just question, where could be the problem?
Is possible to download sources from some link, extract it, configure and display in web browser with easy way, for example as wordpress?
Thanks.
To solve problem with vendor:
It seems that your UID and GID is different than default 1000, that is set in docker-compose.yml for Linux by default.
To solve your issue you can continue by step 3 in https://github.com/shopsys/shopsys/blob/master/docs/installation/installation-using-docker-linux.md#3-set-the-uid-and-gid-to-allow-file-access-in-mounted-volumes
You found issue with installation script, I have created issue on GitHub.
To solve problem with Invalid configuration for path "monolog.handlers.main":
Currently there is problem with new minor version (3.4.0) of symfony/monolog-bundle that created BC break. There is already created issue about this problem and there is already merged fix in Shopsys master.
To solve problem in your project you have to add
"symfony/monolog-bundle": ">=3.4.0", in conflict section in your composer.json file and then run composer install again.
We are trying to answer questions on stackoverflow as soon as possible, but we also have Slack where is many users and you might get your question answered much faster.

Setup Docker Jenkins with default plugins

I want to create a Jenkins based image to have some plugins installed as well as npm. To do so I have the following Dockerfile:
FROM jenkins:2.60.3
RUN install-plugins.sh bitbucket
USER root
RUN apt-get update
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get install -y nodejs
RUN npm --version
USER jenkins
That works fine however when I run the image I have two problems:
It seems that the plugins I tried to install manually didn't get persisted for some reason.
I get prompted the list of plugins I want to install but I don't want to install anything else.
Am I missing anything configuring the Dockerfile or is it that what I want to achieve is simply not possible?
Without seeing the contents of install-plugins.sh, I can't comment as to why the plugins aren't persisting. It is most likely caused by an incorrect installation destination; persistence shouldn't be an issue at this stage, since the plugin installation is built into the image itself.
As for the latter issue, you should be able to skip the installation wizard altogether by adding the line ENV JAVA_OPTS=-Djenkins.install.runSetupWizard=false
to your Dockerfile. Please note that this can be a security risk, if the Jenkins image is exposed to the world at large, since this option disables the need for authentication
EDIT: The default plugin directory for the Docker image is /var/jenkins_home/plugins
EDIT 2: According to the README on the Jenkins Docker repo, adding the line RUN echo 2.0 > /usr/share/jenkins/ref/jenkins.install.UpgradeWizard.stateshould accomplish the same thing
Things have changed since 2017, when the last answer was posted, and it no longer works. The current way is in following Dockerfile snippet:
# Prevent setup wizard from running.
# WARNING: Jenkins will start with security disabled, without any password.
ENV JENKINS_OPTS="-Djenkins.install.runSetupWizard=false"
# plugins.txt must contain the list of plugins to be installed
# (One plugin per line, e.g. sidebar-link:1.11.0)
COPY plugins.txt /tmp/plugins.txt
RUN /usr/local/bin/install-plugins.sh < /tmp/plugins.txt

Installing Apache Airflow on Amazon Lightsail Instance

So i figured out the basics of Apache Airflow and I can run dags/tasks on my computer (so sleek!). However, I want to be able to have these run when my computer's off - so I bought a $5/month Lightsail instance and tried to install Airflow on there pip install airflow.
I keep getting the attached output. It seems as though there isn't enough memory on the instance to finish the command or something but I feel like if that were true, it would output an error message...
Thoughts?
I've found an answer to my own question. I tried out the solution provided for this question, and it worked:
First - I created a virtual environment and entered it by typing these commands into the command line:
virtualenv my-env,
source my-venv/bin/activate
Second - Once in the virtual environment, instead of inputing pip install airflow, I input pip --no-cache-dir install airflow. This worked to avoid the memory error!

jenkins fails to install with no error on debian 7

i'm trying to get jenkins running on debian 7 but i keep getting this error while apt-get install jenkins is running.
Setting up dbus (1.6.8-1) ...
Failed to open connection to "system" message bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[ ok ] Starting system message bus: dbus.
Also i get the message that jenkins is started at the end and no error message:
[ ok ] Starting Jenkins Continuous Integration Server: jenkins.
but /etc/init.d/jenkins status gives me the output that jenkins is not running. also ls -alh /var/lib/jenkins gives me an empty folder.
So the install fails with no error.
This is the way i'm running the install:
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | apt-key add -
sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
apt-get update
apt-get install jenkins
Has anyone of you tried installing jenkins on a fresh debian 7?
looking forward for helping answers.
kind regards and thanks in advance
So i solved the problem finally.
I expected the Java SDK to have the right JRE in it, so i downloaded it from the Oracle website: jdk1.7.0_21-x64-linux.tar.gz after installing and registering this to my machine it worked java -version and javac -version.
Problem was the version of this JRE did not work with Jenkins so thanks to #wako, i installed openjdk-7-jre and i have now two jre's running on my machine but jenkins started finally. need to figure out if openjdk-7-jre suits my plans or if i need to fall back to Debian 6.
This is an issue with apt-get and not with Jenkins -
please make sure you run it as root.
Can try to install (or upgrade) another package, to confirm.
I had the same problem on the debian 7 freshly installed, via the light version of debian 7 with the ssh server only installed.
First I add the repository as you specified it, try to install jenkins but some dependencies were broken (daemon-psmisc-java2-runtime).
To solve the problem I did an:
apt-get -f upgrade
And it was OK
To complete the installation of jenkins you will need apache2 and java-jre
apt-get install apache2 openjdk-7-jre

Resources