Skip to content

Techeons

Imagine | Explore | Innovate

Menu
  • Home
Menu

Debugging Guide: Jenkins

Posted on March 18, 2025

Jenkins is an open-source automation server that enables developers to build, test, and deploy software applications more efficiently. It is a self-contained, Java-based program that can be deployed on-premises or in the cloud.

Common Use Cases:

  • Automating build and deployment processes for web applications
  • Integrating with version control systems like Git and SVN
  • Implementing continuous testing and feedback loops

Jenkins Logs via Jenkins Web Interface

Logs are available at this URL:

http://<your-jenkins-url:8080>/log

Jenkins Log Files

Linux (rpm and deb)

By default logs can be viewed by running:

journalctl -u jenkins.service

To customize the log location, run:

systemctl edit jenkins

and add the following:

[Service]
Environment="JENKINS_LOG=%L/jenkins/jenkins.log"

Windows (msi)

By default, logs should be at %JENKINS_HOME%/jenkins.out and %JENKINS_HOME%/jenkins.err, unless customized in %JENKINS_HOME%/jenkins.xml.

macOS

Log files should be at /var/log/jenkins/jenkins.log, unless customized in org.jenkins-ci.plist.

War file

When Jenkins is started from a command line with java -jar jenkins.war, the log file will be written to the JENKINS_HOME directory. If no value is assigned to the JENKINS_HOME environment variable, the log file will be written to the .jenkins/log directory.

Docker

If you run Jenkins inside Docker as a detached container, you can use the following command to view the Jenkins logs:

docker logs <containerId>

Some useful commands:

1) Check status of the service:

service jenkins status

OR

systemctl status jenkins

2) Restart the service:

service jenkins restart

OR

systemctl restart jenkins

3) Various ways to check journal entries

Show all journal entries:

journalctl -u jenkins --all

Show the last 100 lines:

journalctl -u jenkins -n 100

Show journal entries since last boot:

journalctl -u jenkins -b

Show journal entries for a specific time period:

journalctl -u jenkins --since=yesterday
journalctl -u jenkins --since=1hour ago

Check File System Permissions

Verify that the Jenkins user has the necessary permissions to read and write files in the Jenkins home directory.

On Linux:

sudo chown -R jenkins:jenkins /var/lib/jenkins

How to solve the error:
“Jenkins.service: start operation timed out. Terminating”

Try increasing the systemd timeout to give Jenkins more time to start:

sudo systemctl edit jenkins.service

Add the following lines:

[Service]
TimeoutStartSec=300

How to retrieve deleted Jenkins job

You should have this plugin installed beforehand: JobConfigHistory Plugin

Then go to this URL to reactivate your deleted Jenkins job:

http://<your_jenkins_url>/jobConfigHistory/?filter=deleted

Useful links:

  • https://jenkins.io/doc/book/system-administration/viewing-logs/
Share on Social Media
x facebook pinterest linkedin tumblr reddit emailwhatsapptelegrammastodon

Leave a Reply Cancel reply

You must be logged in to post a comment.

Recent Posts

  • Nginx: How to increase timeout for Nginx
  • Cheat Sheet: Essential Git Commands
  • Setting a default shell in Linux
  • Setting up Composer on Linux
  • Switch easily between Python versions on a Mac using pyenv

Tags

ai alerting aws b2 backblaze certificate cheatsheet cloud commands data-science datalake devops dns docker dremio git gitlab infra jenkins kubernetes linux metabase minikube minio monitoring mount mysql nginx nodejs notebooks openssh php python scala secrets spark ssh ssl ubuntu ufw usb web dev tools windows xampp zeppelin

©2026 Techeons | Design: Newspaperly WordPress Theme