Page MenuHomePhabricator

Varnish failed to provision
Closed, ResolvedPublic

Description

==> default: Error: Could not set home on user[varnish]: Execution of '/usr/sbin/usermod -d /var/run/varnish varnish' returned 8: usermod: user varnish is currently used by process 1602
==> default: Running provisioner: lsb_check...
==> default: Running provisioner: puppet...
==> default: Running Puppet with site.pp...
==> default: Info: Loading facts in /vagrant/puppet/modules/stdlib/lib/facter/puppet_vardir.rb
==> default: Info: Loading facts in /vagrant/puppet/modules/stdlib/lib/facter/root_home.rb
==> default: Info: Loading facts in /vagrant/puppet/modules/stdlib/lib/facter/facter_dot_d.rb
==> default: Info: Loading facts in /vagrant/puppet/modules/stdlib/lib/facter/pe_version.rb
==> default: Notice: Compiled catalog for mediawiki-vagrant.dev in environment production in 99.06 seconds
==> default: Info: Loading facts in /vagrant/puppet/modules/stdlib/lib/facter/puppet_vardir.rb
==> default: Info: Loading facts in /vagrant/puppet/modules/stdlib/lib/facter/root_home.rb
==> default: Info: Loading facts in /vagrant/puppet/modules/stdlib/lib/facter/facter_dot_d.rb
==> default: Info: Loading facts in /vagrant/puppet/modules/stdlib/lib/facter/pe_version.rb
==> default: Info: Applying configuration version '1453755477.aed7f9a'
==> default: Error: Could not set home on user[varnish]: Execution of '/usr/sbin/usermod -d /var/run/varnish varnish' returned 8: usermod: user varnish is currently used by process 1602
==> default: 
==> default: Error: /Stage[main]/Varnish/User[varnish]/home: change from /home/varnish to /var/run/varnish failed: Could not set home on user[varnish]: Execution of '/usr/sbin/usermod -d /var/run/varnish varnish' returned 8: usermod: user varnish is currently used by process 1602
==> default: 
==> default: Notice: /Stage[main]/Varnish/File[/tmp/build-xkey.sh]/ensure: defined content as '{md5}6780ef59fb1d8770be32f31cd9013673'
==> default: Notice: /Stage[main]/Varnish/File[/tmp/build-varnish.sh]/ensure: defined content as '{md5}2665789ffb0dcd5619cff7f3869d453d'
==> default: Notice: /Stage[main]/Varnish/File[/var/run/varnish]: Dependency User[varnish] has failures: true
==> default: Warning: /Stage[main]/Varnish/File[/var/run/varnish]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Varnish/File[/etc/varnish/secret]/content: content changed '{md5}9a6204408c1fa4cd5e84836d2d775284' to '{md5}de98d400f70b9cc9671f192cd88f21f4'
==> default: Notice: /Stage[main]/Varnish/File[/etc/varnish/secret]/mode: mode changed '0600' to '0755'
==> default: Notice: /Stage[main]/Varnish/File[/etc/init/varnish.conf]/ensure: created
==> default: Notice: /Stage[main]/Apt/Exec[apt-get update]/returns: executed successfully
==> default: Notice: /Stage[main]/Varnish/File[/usr/local/var]: Dependency User[varnish] has failures: true
==> default: Warning: /Stage[main]/Varnish/File[/usr/local/var]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Varnish/File[/usr/local/var/varnish]: Dependency User[varnish] has failures: true
==> default: Warning: /Stage[main]/Varnish/File[/usr/local/var/varnish]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Varnish/File[/tmp/build-tbf.sh]/ensure: defined content as '{md5}c1d59d8a0b29b1aba14cf6985773a7ac'
==> default: Notice: /Stage[main]/Varnish/File[/usr/local/var/varnish/mediawiki-vagrant]: Dependency User[varnish] has failures: true
==> default: Warning: /Stage[main]/Varnish/File[/usr/local/var/varnish/mediawiki-vagrant]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Hhvm/File[/var/run/hhvm/hhvm.hhbc]/ensure: created
==> default: Notice: /Stage[main]/Varnish/Package[libdb-dev]/ensure: ensure changed 'purged' to 'present'
==> default: Notice: /Stage[main]/Varnish/Git::Clone[libvmod-xkey]/File[/tmp/libvmod-xkey]/ensure: created
==> default: Notice: /Stage[main]/Varnish/Git::Clone[libvmod-xkey]/Exec[git_clone_libvmod-xkey]/returns: executed successfully
==> default: Notice: /Stage[main]/Varnish/Git::Clone[libvmod-tbf]/File[/tmp/libvmod-tbf]/ensure: created
==> default: Notice: /Stage[main]/Varnish/Git::Clone[libvmod-tbf]/Exec[git_clone_libvmod-tbf]/returns: executed successfully
==> default: Notice: /Stage[main]/Varnish/Git::Clone[Varnish-Cache]/File[/tmp/Varnish-Cache]/ensure: created
==> default: Notice: /Stage[main]/Varnish/Git::Clone[Varnish-Cache]/Exec[git_clone_Varnish-Cache]/returns: executed successfully
==> default: Notice: /Stage[main]/Varnish/Exec[build_varnish]/returns: executed successfully
==> default: Notice: /Stage[main]/Varnish/Exec[build_xkey]/returns: executed successfully
==> default: Notice: /Stage[main]/Varnish/Exec[build_tbf]/returns: executed successfully
==> default: Notice: /Stage[main]/Varnish/Service[varnish]: Dependency User[varnish] has failures: true
==> default: Warning: /Stage[main]/Varnish/Service[varnish]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki/File[/vagrant/settings.d/puppet-managed/10-GuidedTour.php]/ensure: removed
==> default: Notice: /Stage[main]/Mediawiki/File[/vagrant/settings.d/puppet-managed/10-GettingStarted.php]/ensure: removed
==> default: Notice: Finished catalog run in 346.68 seconds
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

Event Timeline

Mattflaschen-WMF raised the priority of this task from to Needs Triage.
Mattflaschen-WMF updated the task description. (Show Details)

Questions I asked on IRC:

[01/25/16 21:38] <matt_flaschen> gilles, in https://gerrit.wikimedia.org/r/#/c/265370/ is there a reason the varnish user's home directory has to be /var/run/varnish ?
[01/25/16 21:39] <matt_flaschen> gilles, changing it to that causes a problem if the Varnish process is running, which it pretty much always is.
[01/25/16 21:40] <matt_flaschen> I can work around it (maybe hackily), but I'm wondering if we can define it as /home/varnish (the current value) (I guess the current user was created by a previous install process).
[01/25/16 21:40] <matt_flaschen> ^ bd808
[01/25/16 21:44] <matt_flaschen> gilles, bd808, I guess it completely changed the way it was installed (apt to build), so if /home/varnish would be a hassle we could just let it go and ask people to kill it one-time.

I'm not sure if this only affects upgrades, or also fresh installs. I think only upgrades, though (I guess the varnish user was created by the apt package that is no longer used).

I'm going to hack around it by killing varnish then doing the user change. If it does affect fresh installs we'll hear about it and can fix it then.

For now at least. See above.

I'm not even sure that it needs a home directory at all, I was just following a pattern of user creation in Vagrant I had seen elsewhere.

I'm not even sure that it needs a home directory at all, I was just following a pattern of user creation in Vagrant I had seen elsewhere.

Oh, okay, then I'll see if /home/varnish works (to avoid a change for upgrades) (that's a much easier fix then allowing the directory change without in-use conflicts).

Change 266618 had a related patch set uploaded (by Mattflaschen):
Change Varnish home directory to /home/varnish

https://gerrit.wikimedia.org/r/266618

Change 266618 merged by jenkins-bot:
Change Varnish home directory to /home/varnish

https://gerrit.wikimedia.org/r/266618