"Could not secure .jazz-scm" when running lscm in parallel
Our team is running lscm annotate command within a Jenkins job and we are getting the error below when more than one job (using lscm) is running on the same Jenkins node:
Problem running 'annotate':
[ERROR] Could not secure .jazz-scm. Failed to set permissions on directory /home/jenkins/.jazz-scm
The jenkins job is using the SonarQube plug-in to call lscm. We have only one sandbox and there are hundreds of projects in this sandbox. The SonarQube plug-in runs once for each project, and we only hit the issue when two SonarQube instances run in parallel (and therefore two `lscm` commands are issued concurrently).
There was a suggestion that the lscm daemon might be getting created every time the command is being run. We have monitored the daemon and confirmed there was only one daemon running at a time. We have also set SCM_ALLOW_INSECURE to true on the Jenkins slave.
Problem running 'annotate':
[ERROR] Could not secure .jazz-scm. Failed to set permissions on directory /home/jenkins/.jazz-scm
The jenkins job is using the SonarQube plug-in to call lscm. We have only one sandbox and there are hundreds of projects in this sandbox. The SonarQube plug-in runs once for each project, and we only hit the issue when two SonarQube instances run in parallel (and therefore two `lscm` commands are issued concurrently).
There was a suggestion that the lscm daemon might be getting created every time the command is being run. We have monitored the daemon and confirmed there was only one daemon running at a time. We have also set SCM_ALLOW_INSECURE to true on the Jenkins slave.
One answer
As lscm is a daemon, it is running all the time once started, until you ask it to quit explicitly. To avoid conflicts and corruptions, lscm/scm needs to lock a sandbox when running. In other words, one sandbox, one lscm/scm. That's the reason you got the error when trying to run two lscm instances against a single sandbox.
If you need to run two SonarQube instance, try to use scm instead of lscm, or configure SonarQube to use any existing lscm. These are just my thoughts though, as I have no specific knowledge about SonarQube.
If you need to run two SonarQube instance, try to use scm instead of lscm, or configure SonarQube to use any existing lscm. These are just my thoughts though, as I have no specific knowledge about SonarQube.