Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Cannot change hostname on Debian host #481

Closed
kiemlicz opened this issue Apr 12, 2019 · 2 comments
Closed

Cannot change hostname on Debian host #481

kiemlicz opened this issue Apr 12, 2019 · 2 comments
Labels

Comments

@kiemlicz
Copy link

kiemlicz commented Apr 12, 2019

Given following Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "debian/stretch64"
  config.vm.hostname = "kitchen"

  config.vm.define "kitchen" do |node|
    node.vm.provider :lxc do |lxc|
      lxc.container_name = :machine
      lxc.backingstore = 'best'
      lxc.fetch_ip_tries = 100
    end
  end
end

I'm unable to vagrant up

The result:

Bringing machine 'kitchen' up with 'lxc' provider...
==> kitchen: Importing base box 'debian/stretch64'...
==> kitchen: Checking if box 'debian/stretch64' version '9.1.0' is up to date...
==> kitchen: Setting up mount entries for shared folders...
    kitchen: /vagrant => /home/stanislaw/projects/scout/kitchen
==> kitchen: Starting container...
==> kitchen: Waiting for machine to boot. This may take a few minutes...
    kitchen: SSH address: 192.168.8.42:22
    kitchen: SSH username: vagrant
    kitchen: SSH auth method: private key
    kitchen: 
    kitchen: Vagrant insecure key detected. Vagrant will automatically replace
    kitchen: this with a newly generated keypair for better security.
    kitchen: 
    kitchen: Inserting generated public key within guest...
    kitchen: Removing insecure key from the guest if it's present...
    kitchen: Key inserted! Disconnecting and reconnecting using new SSH key...
==> kitchen: Machine booted and ready!
==> kitchen: Setting hostname...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

systemctl stop [email protected];systemctl start [email protected]

Stdout from the command:



Stderr from the command:

A dependency job for [email protected] failed. See 'journalctl -xe' for details.

Going into the container I can find some relevant information in journal:

Apr 12 22:32:52 stretch dbus[60]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Apr 12 22:32:52 stretch systemd[1]: systemd-udevd.service: Cannot add dependency job, ignoring: Unit systemd-udevd.service is masked.
Apr 12 22:32:52 stretch systemd[1]: systemd-udevd.service: Cannot add dependency job, ignoring: Unit systemd-udevd.service is masked.
Apr 12 22:32:52 stretch systemd[1]: Failed to set devices.allow on /system.slice/systemd-hostnamed.service: Operation not permitted
Apr 12 22:32:52 stretch systemd[1]: Failed to set devices.allow on /system.slice/systemd-hostnamed.service: Operation not permitted
Apr 12 22:32:52 stretch systemd[1]: Starting Hostname Service...
-- Subject: Unit systemd-hostnamed.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit systemd-hostnamed.service has begun starting up.
Apr 12 22:32:52 stretch systemd[1]: run-user-1000.mount: Failed to reset devices.list: Operation not permitted
Apr 12 22:32:53 stretch dbus[60]: [system] Successfully activated service 'org.freedesktop.hostname1'
Apr 12 22:32:53 stretch systemd[1]: Started Hostname Service.
-- Subject: Unit systemd-hostnamed.service has finished start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit systemd-hostnamed.service has finished starting up.
-- 
-- The start-up result is done.

...
Apr 12 22:32:54 kitchen systemd[1]: Starting of sys-subsystem-net-devices-eth0.device not supported.
-- Subject: Unit sys-subsystem-net-devices-eth0.device has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit sys-subsystem-net-devices-eth0.device has failed.
-- 
-- The result is unsupported.
Apr 12 22:32:54 kitchen systemd[1]: Dependency failed for ifup for eth0.
-- Subject: Unit [email protected] has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit [email protected] has failed.
-- 
-- The result is dependency.
Apr 12 22:32:54 kitchen systemd[1]: [email protected]: Job [email protected]/start failed with result 'dependency'.
Apr 12 22:32:54 kitchen sudo[754]: pam_unix(sudo:session): session closed for user root
Apr 12 22:32:54 kitchen sshd[636]: pam_unix(sshd:session): session closed for user vagrant
Apr 12 22:32:54 kitchen systemd-logind[58]: Removed session 3.
-- Subject: Session 3 has been terminated
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat
-- 

I think the: Apr 12 22:32:54 kitchen systemd[1]: Starting of sys-subsystem-net-devices-eth0.device not supported. is the root cause.
I remember vagrant-lxc working ok on Debian 9.8

The vagrant up --debug log (cut to the 'setting hostname' part):

==> kitchen: Setting hostname...
DEBUG ssh: Checking whether SSH is ready...
DEBUG ssh: Re-using SSH connection.
 INFO ssh: SSH is ready!
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute:  (sudo=false)
DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: Exit status: 0
DEBUG guest: Searching for cap: change_host_name
DEBUG guest: Checking in: debian
DEBUG guest: Found cap: change_host_name in debian
 INFO guest: Execute capability: change_host_name [#<Vagrant::Machine: kitchen (Vagrant::LXC::Provider)>, "kitchen"] (debian)
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: hostname -f | grep '^kitchen$' (sudo=false)
DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: Exit status: 1
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: # Set the hostname
echo 'kitchen' > /etc/hostname

# Prepend ourselves to /etc/hosts
grep -w 'kitchen' /etc/hosts || {
  if grep -w '^127\.0\.1\.1' /etc/hosts ; then
    sed -i'' 's/^127\.0\.1\.1\s.*$/127.0.1.1\tkitchen\tkitchen/' /etc/hosts
  else
    sed -i'' '1i 127.0.1.1\tkitchen\tkitchen' /etc/hosts
  fi
}

# Update mailname
echo 'kitchen' > /etc/mailname

 (sudo=true)
DEBUG ssh: stderr: mesg: ttyname failed: Inappropriate ioctl for device

DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: command -v hostnamectl && hostnamectl (sudo=false)
DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: hostnamectl set-hostname 'kitchen' (sudo=true)
DEBUG ssh: stderr: mesg: ttyname failed: Inappropriate ioctl for device

DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: ps -o comm= 1 | grep systemd (sudo=false)
DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: systemctl -q is-active systemd-networkd.service (sudo=true)
DEBUG ssh: stderr: mesg: ttyname failed: Inappropriate ioctl for device

DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: Exit status: 3
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: systemctl -q is-active NetworkManager.service (sudo=true)
DEBUG ssh: stderr: mesg: ttyname failed: Inappropriate ioctl for device

DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: Exit status: 3
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ip -o -0 addr | grep -v LOOPBACK | awk '{print $2}' | sed 's/://' (sudo=true)
DEBUG ssh: stderr: mesg: ttyname failed: Inappropriate ioctl for device

DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /proc/net/dev | grep -E '^[a-z0-9 ]+:' | awk '{print $1}' | sed 's/://' (sudo=true)
DEBUG ssh: stderr: mesg: ttyname failed: Inappropriate ioctl for device

DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ip -o -0 addr | grep LOOPBACK | awk '{print $2}' | sed 's/://' (sudo=true)
DEBUG ssh: stderr: mesg: ttyname failed: Inappropriate ioctl for device

DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: Exit status: 0
DEBUG network_interfaces: loopback interfaces: ["lo"]
DEBUG network_interfaces: Unsorted list: ["eth0@if12", "eth0"]
DEBUG network_interfaces: Sorted list: ["eth0@if12", "eth0"]
DEBUG network_interfaces: Ethernet preferred sorted list: ["eth0", "eth0@if12"]
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: ps -o comm= 1 | grep systemd (sudo=false)
DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: Exit status: 0
DEBUG changehostname: Attempting to restart networking with systemctl
DEBUG changehostname: Restarting interface eth0 on guest kitchen
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: systemctl stop [email protected];systemctl start [email protected] (sudo=true)
DEBUG ssh: stderr: mesg: ttyname failed: Inappropriate ioctl for device

DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: stderr: A dependency job for [email protected] failed. See 'journalctl -xe' for details.

DEBUG ssh: Exit status: 1
ERROR warden: Error occurred: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

systemctl stop [email protected];systemctl start [email protected]

Stdout from the command:



Stderr from the command:

A dependency job for [email protected] failed. See 'journalctl -xe' for details.

 INFO warden: Beginning recovery process...
 INFO warden: Calling recover: #<Vagrant::Action::Builtin::HandleForwardedPortCollisions:0x0000000002856130>
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
ERROR warden: Error occurred: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

systemctl stop [email protected];systemctl start [email protected]

Stdout from the command:



Stderr from the command:

A dependency job for [email protected] failed. See 'journalctl -xe' for details.

 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
ERROR warden: Error occurred: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

systemctl stop [email protected];systemctl start [email protected]

Stdout from the command:



Stderr from the command:

A dependency job for [email protected] failed. See 'journalctl -xe' for details.

 INFO warden: Beginning recovery process...
 INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x00000000029383a0>
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x0000000002a15ef8>
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
ERROR warden: Error occurred: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

systemctl stop [email protected];systemctl start [email protected]

Stdout from the command:



Stderr from the command:

A dependency job for [email protected] failed. See 'journalctl -xe' for details.

 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
ERROR warden: Error occurred: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

systemctl stop [email protected];systemctl start [email protected]

Stdout from the command:



Stderr from the command:

A dependency job for [email protected] failed. See 'journalctl -xe' for details.

 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO environment: Released process lock: machine-action-88329c3515316201c8ca7fd9c2a595f8
 INFO environment: Running hook: environment_unload
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 2 hooks defined.
 INFO runner: Running action: environment_unload #<Vagrant::Action::Builder:0x00007f6cfc3f3318>
ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: #<Vagrant::Errors::VagrantError: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

systemctl stop [email protected];systemctl start [email protected]

Stdout from the command:



Stderr from the command:

A dependency job for [email protected] failed. See 'journalctl -xe' for details.
>
ERROR vagrant: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

systemctl stop [email protected];systemctl start [email protected]

Stdout from the command:



Stderr from the command:

A dependency job for [email protected] failed. See 'journalctl -xe' for details.

ERROR vagrant: /opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/plugins/communicators/ssh/communicator.rb:265:in `execute'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/plugins/communicators/ssh/communicator.rb:275:in `sudo'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/plugins/guests/debian/cap/change_host_name.rb:99:in `block in restart_each_interface'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/plugins/guests/debian/cap/change_host_name.rb:92:in `each'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/plugins/guests/debian/cap/change_host_name.rb:92:in `restart_each_interface'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/plugins/guests/debian/cap/change_host_name.rb:65:in `change_host_name'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/capability_host.rb:111:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/capability_host.rb:111:in `capability'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/guest.rb:43:in `capability'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/set_hostname.rb:21:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/before_trigger.rb:23:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/after_trigger.rb:26:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/home/stanislaw/.vagrant.d/gems/2.4.4/gems/vagrant-lxc-1.4.3/lib/vagrant-lxc/action/prepare_nfs_settings.rb:15:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/before_trigger.rb:23:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/after_trigger.rb:26:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/synced_folders.rb:87:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/before_trigger.rb:23:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/after_trigger.rb:26:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/synced_folder_cleanup.rb:28:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/before_trigger.rb:23:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/after_trigger.rb:26:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/plugins/synced_folders/nfs/action_cleanup.rb:25:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/before_trigger.rb:23:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/after_trigger.rb:26:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/home/stanislaw/.vagrant.d/gems/2.4.4/gems/vagrant-lxc-1.4.3/lib/vagrant-lxc/action/prepare_nfs_valid_ids.rb:14:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/before_trigger.rb:23:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/after_trigger.rb:26:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb:49:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/before_trigger.rb:23:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/after_trigger.rb:26:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/env_set.rb:19:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/before_trigger.rb:23:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/after_trigger.rb:26:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/provision.rb:80:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/before_trigger.rb:23:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:121:in `block in finalize_action'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builder.rb:116:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/runner.rb:102:in `block in run'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/util/busy.rb:19:in `busy'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/runner.rb:102:in `run'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/call.rb:53:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/before_trigger.rb:23:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/after_trigger.rb:26:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/box_check_outdated.rb:84:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/before_trigger.rb:23:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/after_trigger.rb:26:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/before_trigger.rb:23:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/after_trigger.rb:26:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:121:in `block in finalize_action'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/after_trigger.rb:26:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/home/stanislaw/.vagrant.d/gems/2.4.4/gems/vagrant-lxc-1.4.3/lib/vagrant-lxc/action/create.rb:47:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/before_trigger.rb:23:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/after_trigger.rb:26:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/home/stanislaw/.vagrant.d/gems/2.4.4/gems/vagrant-lxc-1.4.3/lib/vagrant-lxc/action/handle_box_metadata.rb:43:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/before_trigger.rb:23:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/after_trigger.rb:26:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/handle_box.rb:56:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/before_trigger.rb:23:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:121:in `block in finalize_action'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builder.rb:116:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/runner.rb:102:in `block in run'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/util/busy.rb:19:in `busy'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/runner.rb:102:in `run'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/call.rb:53:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/before_trigger.rb:23:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/after_trigger.rb:26:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builtin/before_trigger.rb:23:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/warden.rb:50:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/builder.rb:116:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/runner.rb:102:in `block in run'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/util/busy.rb:19:in `busy'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/action/runner.rb:102:in `run'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/machine.rb:238:in `action_raw'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/machine.rb:209:in `block in action'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/environment.rb:615:in `lock'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/machine.rb:195:in `call'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/machine.rb:195:in `action'
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'
 INFO interface: error: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

systemctl stop [email protected];systemctl start [email protected]

Stdout from the command:



Stderr from the command:

A dependency job for [email protected] failed. See 'journalctl -xe' for details.

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

systemctl stop [email protected];systemctl start [email protected]

Stdout from the command:



Stderr from the command:

A dependency job for [email protected] failed. See 'journalctl -xe' for details.

 INFO interface: Machine: error-exit ["Vagrant::Errors::VagrantError", "The following SSH command responded with a non-zero exit status.\nVagrant assumes that this means the command failed!\n\nsystemctl stop [email protected];systemctl start [email protected]\n\nStdout from the command:\n\n\n\nStderr from the command:\n\nA dependency job for [email protected] failed. See 'journalctl -xe' for details.\n"]

How do I get this working?

EDIT: After some investigation I found that in the Vagrant itself, the hostname change (change_host_name.rb) logic has changed to something that apparently doesn't work under LXC

EDIT2: vagrant 2.1.5 works, vagrant 2.2.4 does not.

wmfgerrit pushed a commit to wikimedia/mediawiki-vagrant that referenced this issue Oct 27, 2019
Vagrant >=2.2.4 errors out while trying to set the hostname of an LXC
container (<fgrehm/vagrant-lxc#481>). This
combination will soon be common in Cloud VPS instances running Debian
Buster, so work around the bug by pushing hostname setting into our
Puppet code and avoid the Vagrant built-in management for it.

Bug: T236455
Change-Id: Ib1a8fe41a8c858a8a12ecf939fb6c7e55f07704d
@tjaacks
Copy link

tjaacks commented Mar 23, 2021

@kiemlicz Thanks for investigating and documenting this error here. As a workaround we can use the shell privisioner for setting the hostname:

config.vm.provision "shell", inline: "hostname kitchen"

crasu pushed a commit to crasu/magma that referenced this issue Aug 16, 2022
The reason the reload failing is that some magma network devices do not
fully come up (e.g. do not get an ip even if set to auto).

This triggers this systemd/vagrant issue:
systemd/systemd#4733
fgrehm/vagrant-lxc#481

Signed-off-by: Christian Krämer <[email protected]>
crasu pushed a commit to crasu/magma that referenced this issue Aug 16, 2022
… would fail.

The reason the reload failing is that some magma network devices do not fully come up
(e.g. do not get an ip even if set to auto).  This triggers this systemd/vagrant issue:
systemd/systemd#4733
fgrehm/vagrant-lxc#481

Signed-off-by: Christian Krämer <[email protected]>
crasu pushed a commit to magma/magma that referenced this issue Aug 17, 2022
… would fail. (#13622)

The reason the reload failing is that some magma network devices do not fully come up
(e.g. do not get an ip even if set to auto).  This triggers this systemd/vagrant issue:
systemd/systemd#4733
fgrehm/vagrant-lxc#481

Signed-off-by: Christian Krämer <[email protected]>
voisey pushed a commit to voisey/magma that referenced this issue Aug 18, 2022
… would fail.

The reason the reload failing is that some magma network devices do not fully come up
(e.g. do not get an ip even if set to auto).  This triggers this systemd/vagrant issue:
systemd/systemd#4733
fgrehm/vagrant-lxc#481

Signed-off-by: Christian Krämer <[email protected]>
@fgrehm fgrehm added the ignored label Nov 17, 2022
@fgrehm
Copy link
Owner

fgrehm commented Nov 17, 2022

Hey, sorry for the silence here but this project is looking for maintainers 😅

As per #499, I've added the ignored label and will close this issue. Thanks for the interest in the project and LMK if you want to step up and take ownership of this project on that other issue 👋

@fgrehm fgrehm closed this as completed Nov 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants