Getting 504 errors after restarting the instance

1 minute readKnowledge base

Issue

After restarting the instance, we are getting 504 Gateway timeout error when trying to access URLs such as the items view.

In our thread dumps, you can see some threads showing the stack trace below:

Handling GET /jenkins/XXX/ from XX.XX.XX.XX : Jetty (winstone)-14 View/index.jelly StatusColumn/column.jelly
Stack Trace is:
java.lang.Thread.State: RUNNABLE
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1674)
- locked <0x0000000XXXX> (a java.util.concurrent.ConcurrentHashMap$ReservationNode)
at com.cloudbees.jenkins.plugins.github_reporting.config.AppManifest$Factory.createFor(AppManifest.java:140)
at com.cloudbees.jenkins.plugins.github_reporting.config.AppManifest$Factory.createFor(AppManifest.java:83)
at hudson.model.Actionable.createFor(Actionable.java:114)
at hudson.model.Actionable.getAction(Actionable.java:334)
at jenkins.branch.MultiBranchProject.getDisplayName(MultiBranchProject.java:829)
at org.conjur.jenkins.credentials.ConjurCredentialProvider.getCredentialsFromSupplier(ConjurCredentialProvider.java:79)
at org.conjur.jenkins.credentials.ConjurCredentialProvider.getCredentials(ConjurCredentialProvider.java:71)
at org.conjur.jenkins.credentials.ConjurCredentialProvider.getCredentials(ConjurCredentialProvider.java:51)
at com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials(CredentialsProvider.java:428)
at com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials(CredentialsProvider.java:545)
at org.jenkinsci.plugins.github_branch_source.Connector.lookupScanCredentials(Connector.java:272)
at com.cloudbees.jenkins.plugins.github_reporting.config.AppManifest$Factory.lambda$createFor$9(AppManifest.java:141)
at com.cloudbees.jenkins.plugins.github_reporting.config.AppManifest$Factory$$Lambda$874/1937347902.apply(Unknown Source)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
- locked <0x0000000XXXX> (a java.util.concurrent.ConcurrentHashMap$ReservationNode)
at com.cloudbees.jenkins.plugins.github_reporting.config.AppManifest$Factory.createFor(AppManifest.java:140)

Explanation

The problem is coming from a change in the Conjur Credentials plugin, injected in version 1.0.6 where the plugin was trying to get the display name of the credential for debugging purposes. This causes a block that prevents the instance from responding and thus we get the error observed: 504 Gateway timeout error.

There is an open PR to solve this issue, but the maintainer has not merged it yet.

Workaround

There are two options to get rid of this behavior:

Tested product/plugin versions