ros-infrastructure / buildfarm_deployment

Apache License 2.0
30 stars 39 forks source link

master deployment: "E: Version '2.60.3' for 'jenkins' was not found" #171

Closed gavanderhoorn closed 6 years ago

gavanderhoorn commented 6 years ago

This is somewhat of a duplicate of #70, but seeing as that was reported against the Trusty version of the buildfarm, I figured I post a new issue to not potentially conflate things.


I seem to be running into the problem reported by the OP in #70 (and myself in https://github.com/ros-infrastructure/buildfarm_deployment/issues/70#issuecomment-301836295) again.

Using buildfarm_deployment at 3da95258c079452de52083cc071167ec90bdb15f on a fresh Ubuntu Server 16.04 amd64 VM.

After invoking reconfigure.bash master the puppet run fails eventually with this in the log:

2018-01-07 12:26:19 +0100 /Stage[main]/Jenkins::Repo::Debian/Apt::Source[jenkins]/Apt::Key[Add key: 150FDE3F7787E7D11EF4E12A9B7D32F2D50582E6 from Apt::Source jenkins]/Apt_key[Add key: 150FDE3F7787E7D11EF4E12A9B7D32F2D50582E6 from Apt::Source jenkins]/ensure (notice): created
2018-01-07 12:26:19 +0100 /Stage[main]/Jenkins::Repo::Debian/Apt::Source[jenkins]/Apt::Setting[list-jenkins]/File[/etc/apt/sources.list.d/jenkins.list]/ensure (notice): created
2018-01-07 12:26:19 +0100 /Stage[main]/Jenkins::Repo::Debian/Apt::Source[jenkins]/Apt::Setting[list-jenkins]/File[/etc/apt/sources.list.d/jenkins.list] (info): Scheduling refresh of Class[Apt::Update]
2018-01-07 12:26:24 +0100 Puppet (err): Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install jenkins=2.60.3' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Version '2.60.3' for 'jenkins' was not found
2018-01-07 12:26:24 +0100 /Stage[main]/Jenkins::Package/Package[jenkins]/ensure (err): change from purged to 2.60.3 failed: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install jenkins=2.60.3' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Version '2.60.3' for 'jenkins' was not found
2018-01-07 12:26:24 +0100 /Group[jenkins] (notice): Dependency Package[jenkins] has failures: true
2018-01-07 12:26:24 +0100 /Group[jenkins] (warning): Skipping because of failed dependencies

after this, just about everything is skipped (as expected) as installation of jenkins failed.

At this point, manually running apt-get install jenkins=2.60.3 does install it. Running reconfigure.bash master a second time also seems to work (again: as I expect: the repository and key have at that point been imported in the previous run, so it should now not be a problem anymore). But because of #160 I'm not sure that is a viable work-around (although it only mentions the "jenkins configuration", which at this point probably doesn't exist yet).

/etc/apt/sources.list.d/jenkins.list contains deb http://pkg.jenkins-ci.org/debian-stable binary/, which is correct as far as I can tell.

I also notice a Scheduling refresh of Class[Apt::Update] in the log output, but could it be that it hasn't been run yet before the installation of jenkins is attempted? In that case, this would be https://github.com/jenkinsci/puppet-jenkins/issues/453 again (wrong order in schedule).

gavanderhoorn commented 6 years ago

Docker repo appears to be added in a similar fashion, but there the Exec[apt_update] does appear to get executed before it tries to install docker.

inigomartinez commented 6 years ago

I had a similar problem, which took me some time to figure out what was going on, because I didn't know the puppet. log file existed.

I supposed it might be failing because it wasn't the latest version in the repository, so my workaround went through checking the existing jenkins versions with apt-cache policy jenkins, and setting the new version in the buildfarm deployment configuration file.

I wonder if removing the jenkins version on the config file and just installing the last available version would be a proper fix for this. I guess this could work, at least as long as jenkins is backwards compatible.

gavanderhoorn commented 6 years ago

Thanks for the comment @inigomartinez.

Did you re-run reconfigure.bash on the same host after you made the change? Because if you did, I'm wondering if it was the version-spec that you changed that got it to work, or the fact that the re-run of puppet succeeded as the deb repository was now available.

2.60.3 should be available from the deb repository that the Jenkins class installs, so I'm rather confused.

inigomartinez commented 6 years ago

Yes, I ran again the reconfigure.bash script and it finally installed jenkins0. The last version at the time was 2.73.3.

I've also been wondering why 2.60.3 wasn't installed, given the fact that is present (along many other versions) in the repository.

[0]: I wasn't aware of #160, so I'll recheck our instance to avoid any problem it might cause.

tfoote commented 6 years ago

Also potentially related is #70

gavanderhoorn commented 6 years ago

@tfoote: yes :) that's why I wrote that this somewhat of a duplicate of #70.

tfoote commented 6 years ago

Sorry @gavanderhoorn I didn't scroll back far enough to see you'd already pointed to it. I was responding to @inigomartinez that the package is in the repo, but apt hasn't updated which is likely why it's didn't install the first time.