Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-28544

Update Center and Jobs Permission Denied

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When attempting to install plugins using the Update Center, plugins can not be written to /var/lib/jenkins/plugins due to invalid permissions.

      hudson.util.IOException2: Failed to download from http://updates.jenkins-ci.org/download/plugins/ssh/2.4/ssh.hpi (redirected to: http://ftp-nyc.osuosl.org/pub/jenkins/plugins/ssh/2.4/ssh.hpi)
      at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:797)
      at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1148)
      at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1309)
      at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1126)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:110)
      at java.lang.Thread.run(Thread.java:744)
      Caused by: java.io.FileNotFoundException: /var/lib/jenkins/plugins/ssh.jpi.tmp (Permission denied)
      at java.io.FileOutputStream.open(Native Method)
      at java.io.FileOutputStream.<init>(FileOutputStream.java:206)
      at java.io.FileOutputStream.<init>(FileOutputStream.java:156)
      at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:763)
      ... 7 more

      **@** /var/lib/jenkins $ ls -al
      total 80
      drwxr-xr-x 11 jenkins jenkins 4096 May 21 19:27 .
      drwxr-xr-x 48 root root 4096 May 2 18:23 ..
      rw-rr- 1 systemd-timesync sambashare 0 Apr 10 19:04 atomic3320745316088279947.tmp
      rw-rr- 1 jenkins jenkins 1715 May 21 19:15 config.xml
      rw-rr- 1 jenkins jenkins 0 May 21 19:10 Download metadata.log
      rw-rr- 1 systemd-timesync sambashare 0 Apr 11 04:16 Fingerprint cleanup.log
      rw-rr- 1 jenkins jenkins 160 May 21 19:27 hudson.model.UpdateCenter.xml
      rw------ 1 systemd-timesync sambashare 1675 Apr 10 19:09 identity.key
      drwxr-xr-x 3 jenkins jenkins 4096 May 21 19:09 .java
      rw-rr- 1 jenkins jenkins 138 May 21 19:14 jenkins.model.DownloadSettings.xml
      rw-rr- 1 jenkins jenkins 169 May 21 19:14 jenkins.security.QueueItemAuthenticatorConfiguration.xml
      drwxr-xr-x 2 jenkins jenkins 4096 May 21 19:13 jenkins.security.RekeySecretAdminMonitor
      drwxr-xr-x 2 systemd-timesync sambashare 4096 Apr 10 18:56 jobs
      rw-rr- 1 jenkins jenkins 907 May 21 19:10 nodeMonitors.xml
      drwxr-xr-x 2 jenkins jenkins 4096 May 21 19:09 nodes
      rw-rr- 1 systemd-timesync sambashare 51 Apr 11 15:56 .owner
      drwxr-xr-x 2 systemd-timesync sambashare 4096 Apr 10 18:56 plugins
      rw-rr- 1 systemd-timesync sambashare 46 Apr 11 16:18 queue.xml.bak
      rw-rr- 1 systemd-timesync sambashare 64 Apr 10 18:56 secret.key
      drwxr-xr-x 4 jenkins jenkins 4096 May 21 19:15 secrets
      drwxr-xr-x 2 jenkins jenkins 4096 May 21 19:28 updates
      drwxr-xr-x 2 systemd-timesync sambashare 4096 Apr 10 19:09 userContent
      drwxr-xr-x 3 jenkins jenkins 4096 May 21 19:15 users

      Can be fixed by issuing:

      sudo chown jenkins plugins
      sudo chown jenkins userContent
      sudo chgrp jenkins userContent
      sudo chgrp jenkins plugins

        Attachments

          Activity

          Hide
          enzanki_ars Alex Shafer added a comment -

          Other directories also needed to be fixed to inorder for jobs to work correctly

          Show
          enzanki_ars Alex Shafer added a comment - Other directories also needed to be fixed to inorder for jobs to work correctly
          Hide
          ikedam ikedam added a comment -

          Not related to updatesites-manager plugin. I remeved it from component/s.

          Show
          ikedam ikedam added a comment - Not related to updatesites-manager plugin. I remeved it from component/s.
          Hide
          danielbeck Daniel Beck added a comment -

          The permissions issue appears to be caused by Jenkins being started as two different users at some point in time, hence the mixed ownership of files that should belong to a single account. This could have been a manual invocation as the wrong user, the reuse of an existing JENKINS_HOME but as a different user, or a change in the Jenkins service configuration by you without corresponding chown.

          There's nothing in Jenkins itself that would explain this particular pattern of file ownership other than something outside Jenkins like the above suggested explanations. Therefore resolving as Not a Defect.

          If you find some information that Jenkins itself broke this (e.g. that the Debian package does not support changing the user Jenkins runs as), please provide your findings, with references to the responsible Jenkins service config files, in a new issue filed against the packaging component.

          Show
          danielbeck Daniel Beck added a comment - The permissions issue appears to be caused by Jenkins being started as two different users at some point in time, hence the mixed ownership of files that should belong to a single account. This could have been a manual invocation as the wrong user, the reuse of an existing JENKINS_HOME but as a different user, or a change in the Jenkins service configuration by you without corresponding chown. There's nothing in Jenkins itself that would explain this particular pattern of file ownership other than something outside Jenkins like the above suggested explanations. Therefore resolving as Not a Defect. If you find some information that Jenkins itself broke this (e.g. that the Debian package does not support changing the user Jenkins runs as), please provide your findings, with references to the responsible Jenkins service config files, in a new issue filed against the packaging component.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            enzanki_ars Alex Shafer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: