Closed ryan-beisner closed 5 years ago
@tkuhlman would you mind giving a look at this PR? As far as I understand it's a regression from the introduction of storage support. @ryan-beisner do you confirm that?
To clarify a bit /srv/mnt/jenkins is the directory where the storage is mounted by Juju and then /var/lib/jenkins is linked to this so anything writing to /var/lib/jenkins should be fine. Likely that is not the real cause of the problem here. If you have a running instance it should be easy enough to verify the link.
I tried to deploy cs:xenial/jenkins-4 both with and without adding "--storage jenkins=10G" both worked fine for me.
The error above is an error logging into the new Jenkins installation. The charm does set the initial password and possibly something went wrong there. I noticed in your logs above you are running Jenkins version 2.7.4 where when I didn't specify I would get version 2.46.1. I tried again with a simple config specifying that the release be http://pkg.jenkins-ci.org/debian/binary/jenkins_2.7_all.deb and it still worked fine.
Clearly I am missing some details in trying to replicate this. What config options are you using? Also what version of Juju are you running?
I'm seeing the same problem using jenkins 2.150.1.
I think it's unrelated to storage, and is actually about api authentication. My instance at the time has:
$ ls -lh /var/lib/jenkins
lrwxrwxrwx 1 root root 16 Feb 6 15:52 /var/lib/jenkins -> /srv/mnt/jenkins
The call that's failing is _make_client from lib/charms/layer/jenkins/api.py and if I add some manual logging into the charm, I can see that value of "token" is "This user currently does not have a legacy token".
Need to do some more digging to figure out why this user does not have a legacy token, how we can authenticate to the API without one, and then can apply a fix from there.
Ah, which is https://github.com/jenkinsci/jenkins-charm/issues/47
Closing this out as #47 is now resolved.
/srv/mnt directory is hard-coded, deviates from the default /var/lib/jenkins, is not configurable, and appears to be broken in implementation.
See commits related to: https://github.com/jenkinsci/jenkins-charm/pull/18
I've deployed with "--storage jenkins=10G" as indicated by README, yet, the charm tries to create files in /var/lib/jenkins.
I'm finding usage roadblocks with and without storage defined, on the current revision of the Jenkins charm (cs:xenial/jenkins-4).
Attached full unit log. But here are some interesting snippets show the /srv/mnt/jenkins vs /var/lib/jenkins issues: