Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bash: line 4: 2412 Killed dnf -y install docker #11277

Closed
lmilbaum opened this issue Dec 21, 2019 · 6 comments
Closed

bash: line 4: 2412 Killed dnf -y install docker #11277

lmilbaum opened this issue Dec 21, 2019 · 6 comments

Comments

@lmilbaum
Copy link

Vagrant version

2.2.6

Host operating system

os-x

Guest operating system

fedora 31

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "fedora/31-cloud-base"
  config.vm.provision "docker"
end

Debug output

https://gist.github.com/lioramilbaum/27ce50de02aa856f33e0ce1fee68719f

@jbonhag
Copy link
Contributor

jbonhag commented Jan 6, 2020

Hi there,

Thanks for reporting this issue! I also noticed this in the debug logs:

 INFO ssh: Execute: /usr/bin/which -s dnf (sudo=false)
DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: stderr: /usr/bin/which: invalid option -- 's'

This is from the step where Vagrant is trying to determine whether dnf is installed on the guest machine.

In any event, I was able to reproduce the issue, so we will continue to investigate the root cause.

Cheers!

@alexander-gertovsky
Copy link

I had a same mistake. In my case the system do not have enough memory to execute dnf.

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "fedora/31-cloud-base"
  config.vm.box_version = "31.20191023.0"

  config.vm.provider :libvirt do |v|
    #v.memory = 1024
  end

  config.vm.provision "shell", inline: <<-SHELL
    set -e
    dnf install -y vim || (
      echo result: $? at $(date) >&2
      dmesg | tail -n 7 >&2
    )
  SHELL
end

Output of vagrant up

Bringing machine 'default' up with 'libvirt' provider...
==> default: Checking if box 'fedora/31-cloud-base' version '31.20191023.0' is up to date...
==> default: Creating image (snapshot of base box volume).
==> default: Creating domain with the following settings...
==> default:  -- Name:              fedora31-vagrant-cloud-workspace_default
==> default:  -- Domain type:       kvm
==> default:  -- Cpus:              1
==> default:  -- Feature:           acpi
==> default:  -- Feature:           apic
==> default:  -- Feature:           pae
==> default:  -- Memory:            512M
==> default:  -- Management MAC:    
==> default:  -- Loader:            
==> default:  -- Nvram:             
==> default:  -- Base box:          fedora/31-cloud-base
==> default:  -- Storage pool:      default
==> default:  -- Image:             /home/alex/.local/share/libvirt/images/fedora31-vagrant-cloud-workspace_default.img (41G)
==> default:  -- Volume Cache:      default
==> default:  -- Kernel:            
==> default:  -- Initrd:            
==> default:  -- Graphics Type:     vnc
==> default:  -- Graphics Port:     -1
==> default:  -- Graphics IP:       127.0.0.1
==> default:  -- Graphics Password: Not defined
==> default:  -- Video Type:        cirrus
==> default:  -- Video VRAM:        9216
==> default:  -- Sound Type:	
==> default:  -- Keymap:            en-us
==> default:  -- TPM Path:          
==> default:  -- INPUT:             type=mouse, bus=ps2
==> default: Creating shared folders metadata...
==> default: Starting domain.
==> default: Waiting for domain to get an IP address...
==> default: Waiting for SSH to become available...
    default: 
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: 
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Configuring and enabling network interfaces...
    default: SSH address: 192.168.122.106:22
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Rsyncing folder: /home/alex/Workspace/fedora31-vagrant-cloud-workspace/ => /vagrant
==> default: Running provisioner: shell...
    default: Running: inline script
    default: Fedora Modular 31 - x86_64                      738 kB/s | 5.2 MB     00:07    
    default: Fedora Modular 31 - x86_64 - Updates             52 kB/s | 3.8 MB     01:15    
    default: Fedora 31 - x86_64 - Updates                    387 kB/s |  17 MB     00:43    
    default: Fedora 31 - x86_64                              648 kB/s |  71 MB     01:52    
    default: /tmp/vagrant-shell: line 5:  2494 Killed                  dnf install -y vim
    default: result: 137 at Sat 11 Jan 2020 09:52:26 PM UTC
    default: [  270.801886] [   2465]     0  2465     8349      239    77824        0             0 sudo
    default: [  270.802942] [   2478]     0  2478     1663       77    49152        0             0 bash
    default: [  270.804009] [   2493]     0  2493     1663       77    45056        0             0 bash
    default: [  270.805088] [   2494]     0  2494   168328    95358   942080        0             0 dnf
    default: [  270.806171] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1000.slice/session-3.scope,task=dnf,pid=2494,uid=0
    default: [  270.808485] Out of memory: Killed process 2494 (dnf) total-vm:673312kB, anon-rss:381348kB, file-rss:84kB, shmem-rss:0kB
    default: [  270.830538] oom_reaper: reaped process 2494 (dnf), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB

@jbonhag
Copy link
Contributor

jbonhag commented Jan 13, 2020

@alexander-gertovsky: Thanks for figuring that out! I took another look at the original setup above and I confirmed that indeed the OOM-killer was kicking in.

@lioramilbaum: Could you please try adding more memory to your virtual machine, for example:

  config.vm.provider :virtualbox do |v|
    v.memory = 1024
  end

Adding more memory to the VM got me through the installation process, but unfortunately after that I ran into docker/cli#2104, so we will discuss if & how we can address that.

Cheers!

@lmilbaum
Copy link
Author

@jbonhag tried what you have advised and it worked

@jbonhag
Copy link
Contributor

jbonhag commented Jan 14, 2020

Hi @lioramilbaum, that's great to hear! I'm going to go ahead and close this issue.

Cheers!

@jbonhag jbonhag closed this as completed Jan 14, 2020
@jbonhag jbonhag removed the bug label Jan 14, 2020
@ghost
Copy link

ghost commented Mar 31, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants