Recently my jenkins.log has started getting very large, very quickly, full of exceptions about DNS resolution. I attempted to use logrotate, but the log file grows too quick
Modify JAVA_ARGS in /etc/default/jenkins
(location for Debian / Ubuntu installations at least) to disable DNS multicast feature.
Change this: JAVA_ARGS="-Djava.awt.headless=true"
To this: JAVA_ARGS="-Djava.awt.headless=true -Dhudson.DNSMultiCast.disabled=true"
And restart the service service jenkins restart
For the ones using Centos/Redhat, the option to disable the DNS Multicast feature can found in /etc/sysconfig/jenkins
JENKINS_JAVA_OPTIONS="-Dhudson.DNSMultiCast.disabled=true -Dhudson.udp=-1 -Djava.awt.headless=true"
You can disable the logging of these DNS errors by adjusting the logging settings within Jenkins.
From the Jenkins web interface go to:
Manage Jenkins -> System Log -> Log Levels (on the left)
Add the following entry:
Name: javax.jmdns
Level: off
This way you can keep the Multicast DNS feature but without all the logging data.
You can plug in on Jenkins initialization with init.groovy file in Jenkins home folder and change the logging levels permanently with it. The changes will be kept even if Jenkins is restarted. There is a simple content of the file:
import java.util.logging.Level
import java.util.logging.Logger
Logger.getLogger("").setLevel(Level.SEVERE)
Logger.getLogger("org.apache.sshd").setLevel(Level.SEVERE)
Logger.getLogger("winstone").setLevel(Level.SEVERE)
You can change the name of the logger and the level so that it suits your needs. See my article on this topic for more details.
In my case I received the log entry whenever a Sign in attempt was rejected via the user interface.
User authentication is done via LDAP and the provided user/password tuple is correct. After a while the sign in attempt is working.
Is it possible that the user is rejected because of the enabled DNS Multi cast feature?
This seems to be due to DNS multicast as explained here: https://issues.jenkins-ci.org/browse/JENKINS-25369
Workaround: add -Dhudson.DNSMultiCast.disabled=true
to JAVA_ARGS
.
PS: I'm answering my own question here on Stack Overflow because I couldn't find the answer on Google easily, and it will be useful to other people running Jenkins.