#4834 Rework the vagrant box to be closer to a production environment
Merged by pingou. Opened by pingou.
rework_vagrant  into  master

Download 4834.patch

Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr

:thumbsup:

When running vagrant up or vagrant provision for the first time, clamd is unable to start, due to insufficient memory.

TASK [pagure-dev : Start ClamAV] ***********************************************
fatal: [pagure]: FAILED! => {"changed": false, "msg": "Unable to start service clamd@pagure: Job for clamd@pagure.service failed because the control process exited with error code.\nSee \"systemctl status clamd@pagure.service\" and \"journalctl -xe\" for details.\n"}

Increasing the allocated memory to 3072 MB solves that issue.

Once that's working, I tend to get a few dozen Ansible messages like these:

TASK [pagure-dev : Install the pagure configuration] ***************************
 [WARNING]: sftp transfer mechanism failed on [192.168.121.248]. Use
ANSIBLE_DEBUG=1 to see detailed information

If I run ANSIBLE_DEBUG=1 sudo vagrant provision, I get a stack trace:

==> pagure: Running provisioner: shell...
Traceback (most recent call last):
    81: from /usr/bin/vagrant:23:in `<main>'
    80: from /usr/bin/vagrant:23:in `load'
    79: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/bin/vagrant:177:in `<top (required)>'
    78: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/environment.rb:291:in `cli'
    77: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/cli.rb:58:in `execute'
    76: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/plugins/commands/provision/command.rb:29:in `execute'
    75: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/plugin/v2/command.rb:232:in `with_target_vms'
    74: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/plugin/v2/command.rb:232:in `each'
    73: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/plugin/v2/command.rb:238:in `block in with_target_vms'
    72: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/plugins/commands/provision/command.rb:30:in `block in execute'
    71: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/machine.rb:194:in `action'
    70: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/machine.rb:194:in `call'
    69: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/environment.rb:614:in `lock'
    68: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/machine.rb:208:in `block in action'
    67: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/machine.rb:239:in `action_raw'
    66: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `run'
    65: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/util/busy.rb:19:in `busy'
    64: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `block in run'
    63: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/builder.rb:116:in `call'
    62: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
    61: from /usr/share/rubygems-integration/all/gems/vagrant-sshfs-1.3.1/lib/vagrant-sshfs/action_hostpath_fixup.rb:102:in `call'
    60: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
    59: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    58: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
    57: from /usr/share/rubygems-integration/all/gems/vagrant-sshfs-1.3.1/lib/vagrant-sshfs/action_hostpath_fixup.rb:125:in `call'
    56: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
    55: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/builtin/call.rb:53:in `call'
    54: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `run'
    53: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/util/busy.rb:19:in `busy'
    52: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `block in run'
    51: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/builder.rb:116:in `call'
    50: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
    49: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    48: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
    47: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/builtin/call.rb:53:in `call'
    46: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `run'
    45: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/util/busy.rb:19:in `busy'
    44: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `block in run'
    43: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/builder.rb:116:in `call'
    42: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
    41: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    40: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
    39: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/builtin/provision.rb:103:in `call'
    38: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/builtin/provision.rb:103:in `each'
    37: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/builtin/provision.rb:126:in `block in call'
    36: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/builtin/provision.rb:126:in `call'
    35: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/environment.rb:526:in `hook'
    34: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `run'
    33: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/util/busy.rb:19:in `busy'
    32: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `block in run'
    31: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/builder.rb:116:in `call'
    30: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
    29: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    28: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:95:in `call'
    27: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/lib/vagrant/action/builtin/provision.rb:138:in `run_provisioner'
    26: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/plugins/provisioners/shell/provisioner.rb:31:in `provision'
    25: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/plugins/provisioners/shell/provisioner.rb:71:in `provision_ssh'
    24: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/plugins/provisioners/shell/provisioner.rb:297:in `with_script_file'
    23: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/plugins/provisioners/shell/provisioner.rb:73:in `block in provision_ssh'
    22: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/plugins/provisioners/shell/provisioner.rb:73:in `tap'
    21: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/plugins/provisioners/shell/provisioner.rb:85:in `block (2 levels) in provision_ssh'
    20: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/plugins/communicators/ssh/communicator.rb:293:in `upload'
    19: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/plugins/communicators/ssh/communicator.rb:707:in `scp_connect'
    18: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/plugins/communicators/ssh/communicator.rb:349:in `connect'
    17: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/plugins/communicators/ssh/communicator.rb:709:in `block in scp_connect'
    16: from /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/plugins/communicators/ssh/communicator.rb:299:in `block in upload'
    15: from /usr/lib/ruby/vendor_ruby/net/scp.rb:284:in `upload!'
    14: from /usr/lib/ruby/vendor_ruby/net/ssh/connection/channel.rb:272:in `wait'
    13: from /usr/lib/ruby/vendor_ruby/net/ssh/connection/session.rb:181:in `loop'
    12: from /usr/lib/ruby/vendor_ruby/net/ssh/connection/session.rb:181:in `loop'
    11: from /usr/lib/ruby/vendor_ruby/net/ssh/connection/session.rb:181:in `block in loop'
    10: from /usr/lib/ruby/vendor_ruby/net/ssh/connection/session.rb:228:in `process'
     9: from /usr/lib/ruby/vendor_ruby/net/ssh/connection/event_loop.rb:29:in `process'
     8: from /usr/lib/ruby/vendor_ruby/net/ssh/connection/event_loop.rb:101:in `ev_preprocess'
     7: from /usr/lib/ruby/vendor_ruby/net/ssh/connection/event_loop.rb:101:in `each'
     6: from /usr/lib/ruby/vendor_ruby/net/ssh/connection/session.rb:250:in `ev_preprocess'
     5: from /usr/lib/ruby/vendor_ruby/net/ssh/connection/session.rb:540:in `each_channel'
     4: from /usr/lib/ruby/vendor_ruby/net/ssh/connection/session.rb:540:in `each'
     3: from /usr/lib/ruby/vendor_ruby/net/ssh/connection/session.rb:250:in `block in ev_preprocess'
     2: from /usr/lib/ruby/vendor_ruby/net/ssh/connection/channel.rb:323:in `process'
     1: from /usr/lib/ruby/vendor_ruby/net/scp.rb:369:in `block (3 levels) in start_command'
/usr/lib/ruby/vendor_ruby/net/scp.rb:398:in `await_response_state': Reminder of the commands: (Net::SCP::Error)

My guess is that this is an issue with the version of Vagrant installed on my Debian 10 system.

Thanks! : )

I ran into the clamd issue but did not diagnosed it since it seemed a second run would fix it. I'll bump the memory to 3G, thanks!

(I also wonder why we install and enable this considering the configuration file has virus scanning disabled...)

1 new commit added

  • Bump the memory on the vagrant box to 3Gb so clamd can start fine

rebased onto a01843be6d9205ccd80d996c2a1f8771b1da7e8f

Oh, I just noticed this, you probably want to change SELINUX in /etc/selinux/config to permissive too, so that this setting survives reboots.

Ah, thanks, I meant to look how to do this (I never did this before :D)

rebased onto f3ba806a48fc245e9f3b51c64d3eb0c017e3d9f4

Oh, I just noticed this, you probably want to change SELINUX in /etc/selinux/config to permissive too, so that this setting survives reboots.

Done

:thumbsup:

:thumbsup:

There are a couple of tasks that could be native modules instead of command and regexp (useradd and selinux cfg ones at least), but this is an improvement on the right direction

Let's get this in and tweak later as we need :)

Pull-Request has been merged by pingou

Metadata