Closed proteansec closed 5 years ago
This looks like a duplicate of issue #259. It is fixed on master and was caused by action hooks being executed in the wrong order.
If you can/like you could build a version of master and verify that the issue is indeed resolved. In case you don't want to build the gem yourself, you can try this gem which I've built of current master.
Hi, this is not resolved. I've build the new plugin manually by using rake build:
vagrant plugin list
landrush (1.2.0.dev)
- Version Constraint: 1.2.0.dev
However, when doing vagrant reload, the following is displayed in the stdout - notice the highlighted line, which says whether the landrush server has crashed (actually it hasn't even started).
==> vagrant-win8x86-enterprise: Attempting graceful shutdown of VM... ==> vagrant-win8x86-enterprise: Clearing any previously set forwarded ports... ==> vagrant-win8x86-enterprise: Clearing any previously set network interfaces... ==> vagrant-win8x86-enterprise: Preparing network interfaces based on configuration... vagrant-win8x86-enterprise: Adapter 1: nat vagrant-win8x86-enterprise: Adapter 2: hostonly ==> vagrant-win8x86-enterprise: Forwarding ports... vagrant-win8x86-enterprise: 3389 (guest) => 3389 (host) (adapter 1) vagrant-win8x86-enterprise: 5985 (guest) => 5985 (host) (adapter 1) vagrant-win8x86-enterprise: 5986 (guest) => 55986 (host) (adapter 1) vagrant-win8x86-enterprise: 22 (guest) => 2222 (host) (adapter 1) ==> vagrant-win8x86-enterprise: Running 'pre-boot' VM customizations... ==> vagrant-win8x86-enterprise: Booting VM... ==> vagrant-win8x86-enterprise: Waiting for machine to boot. This may take a few minutes... vagrant-win8x86-enterprise: WinRM address: 127.0.0.1:5985 vagrant-win8x86-enterprise: WinRM username: vagrant vagrant-win8x86-enterprise: WinRM execution_time_limit: PT2H vagrant-win8x86-enterprise: WinRM transport: negotiate ==> vagrant-win8x86-enterprise: Machine booted and ready! ==> vagrant-win8x86-enterprise: Checking for guest additions in VM... vagrant-win8x86-enterprise: No guest additions were detected on the base box for this VM! Guest vagrant-win8x86-enterprise: additions are required for forwarded ports, shared folders, host only vagrant-win8x86-enterprise: networking, and more. If SSH fails on this machine, please install vagrant-win8x86-enterprise: the guest additions and repackage the box to continue. vagrant-win8x86-enterprise: vagrant-win8x86-enterprise: This is not an error message; everything may continue to work properly, vagrant-win8x86-enterprise: in which case you may ignore this message. Stopping daemon... Pid 9879 is not running. Has daemon crashed? ==> vagrant-win8x86-enterprise: Setting hostname... ==> vagrant-win8x86-enterprise: Configuring and enabling network interfaces... ==> vagrant-win8x86-enterprise: Automatic installation for Landrush IP not enabled Vagrant attempted to execute the capability 'read_host_visible_ip_address' on the detect guest OS 'windows', but the guest doesn't support that capability. This capability is required for your configuration of Vagrant. Please either reconfigure Vagrant to avoid this capability or fix the issue by creating the capability.
If I try to start it manually, the following happens:
vagrant landrush start
vagrant landrush status
Daemon status: unknown /home/user/.vagrant.d/data/landrush/run/landrush.pid exists, but process is not running Check log file: /home/user/.vagrant.d/data/landrush/log/landrush.log
The log file is not there:
find /home/user/.vagrant.d/data/landrush/
/home/user/.vagrant.d/data/landrush/ /home/user/.vagrant.d/data/landrush/run /home/user/.vagrant.d/data/landrush/run/landrush.pid /home/user/.vagrant.d/data/landrush/dependent_vms /home/user/.vagrant.d/data/landrush/dependent_vms/win8x86-enterprise /home/user/.vagrant.d/data/landrush/config.json
I should stop the daemon and remove the pid file:
vagrant landrush stop
rm /home/user/.vagrant.d/data/landrush/run/landrush.pid
Then start the daemon and check the landrush status:
vagrant landrush start
vagrant landrush status
Daemon status: unknown /home/user/.vagrant.d/data/landrush/run/landrush.pid exists, but process is not running Check log file: /home/user/.vagrant.d/data/landrush/log/landrush.log
The log file is not present. Let me use the --debug switch to start landrush:
INFO global: Loading plugins! INFO manager: Registered plugin: vagrant-share INFO manager: Registered plugin: winrm INFO manager: Registered plugin: hosts INFO manager: Registered plugin: HostManager INFO manager: Registered plugin: landrush INFO manager: Registered plugin: LandrushIp INFO vagrant:
vagrant
invoked: ["landrush", "start", "--debug"] DEBUG vagrant: Creating Vagrant environment INFO environment: Environment initialized (#Vagrant::Environment:0x00000002d293b0) INFO environment: - cwd: /home/user/win8x86-enterprise INFO environment: Home path: /home/user/.vagrant.d INFO environment: Local data path: /home/user/win8x86-enterprise/.vagrant DEBUG environment: Creating: /home/user/win8x86-enterprise/.vagrant INFO environment: Running hook: environment_plugins_loaded INFO runner: Preparing hooks for middleware sequence... INFO runner: 1 hooks defined. INFO runner: Running action: environment_plugins_loaded #Vagrant::Action::Builder:0x000000025c6d48 INFO environment: Running hook: environment_load INFO runner: Preparing hooks for middleware sequence... INFO runner: 1 hooks defined. INFO runner: Running action: environment_load #Vagrant::Action::Builder:0x00000002226260 INFO cli: CLI: [] "landrush" ["start"] DEBUG cli: Invoking command class: Landrush::Command ["start"] INFO environment: Running hook: environment_unload INFO loader: Set :root = ["#Pathname:/home/user/win8x86-enterprise/Vagrantfile"] DEBUG loader: Populating proc cache for #Pathname:/home/user/win8x86-enterprise/Vagrantfile DEBUG loader: Load procs for pathname: /home/user/win8x86-enterprise/Vagrantfile INFO loader: Loading configuration in order: [:home, :root] DEBUG loader: Loading from: root (evaluating) DEBUG loader: Configuration loaded successfully, finalizing and returning DEBUG push: finalizing INFO host: Autodetecting host type for [#<Vagrant::Environment: /home/user/win8x86-enterprise>] DEBUG host: Trying: ubuntu DEBUG host: Trying: arch DEBUG host: Trying: darwin DEBUG host: Trying: freebsd DEBUG host: Trying: gentoo DEBUG host: Trying: redhat DEBUG host: Trying: slackware DEBUG host: Trying: suse DEBUG host: Trying: debian DEBUG host: Trying: bsd DEBUG host: Trying: linux INFO host: Detected: linux! INFO runner: Preparing hooks for middleware sequence... INFO runner: 1 hooks defined. INFO runner: Running action: environment_unload #Vagrant::Action::Builder:0x00000002dda8e0
The landrush is unable to start, even if I try manually starting it.
Which version of Vagrant are you using?
In your source code checkout can you run:
$ bundle exec rake features FEATURE=features/vagrant_reload.feature
This should be running a cucumber test to test the reload behavior. I would be interested in what it reports.
Using Vagrant 1.8.5.
I haven't actually executed the command you provided, since it's quite difficult to run bundle+vagrant on my system; I'm building the gem in docker, then importing it on my own system. In any case, I've taken a look at the cucumber rule and crated the following Vagrantfile:
Vagrant.configure("2") do |config| config.vm.box = 'debian/jessie64' config.vm.synced_folder '.', '/vagrant', disabled: true config.landrush.enabled = true end
Then I'm putting the machine up, which works without any issues.
vagrant up --provider virtualbox
Bringing machine 'default' up with 'virtualbox' provider... ==> default: Box 'debian/jessie64' could not be found. Attempting to find and install... default: Box Provider: virtualbox default: Box Version: >= 0 ==> default: Loading metadata for box 'debian/jessie64' default: URL: https://atlas.hashicorp.com/debian/jessie64 ==> default: Adding box 'debian/jessie64' (v8.6.1) for provider: virtualbox default: Downloading: https://atlas.hashicorp.com/debian/boxes/jessie64/versions/8.6.1/providers/virtualbox.box ==> default: Successfully added box 'debian/jessie64' (v8.6.1) for 'virtualbox'! ==> default: Importing base box 'debian/jessie64'... ==> default: Matching MAC address for NAT networking... ==> default: Checking if box 'debian/jessie64' is up to date... ==> default: Setting the name of the VM: cucumber_default_1476128988188_73850 ==> default: Clearing any previously set network interfaces... ==> default: [landrush] virtualbox requires an additional private network; adding it ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat default: Adapter 2: hostonly ==> default: Forwarding ports... default: 22 (guest) => 2222 (host) (adapter 1) ==> default: Running 'pre-boot' VM customizations... ==> default: Booting VM... ==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2222 default: SSH username: vagrant default: SSH auth method: private key 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: Machine booted and ready! ==> default: Checking for guest additions in VM... default: No guest additions were detected on the base box for this VM! Guest default: additions are required for forwarded ports, shared folders, host only default: networking, and more. If SSH fails on this machine, please install default: the guest additions and repackage the box to continue. default: default: This is not an error message; everything may continue to work properly, default: in which case you may ignore this message. ==> default: Configuring and enabling network interfaces... ==> default: Automatic installation for Landrush IP not enabled ==> default: [landrush] setting up machine's DNS to point to our server ==> default: [landrush] network: :forwarded_port, {:guest=>22, :host=>2222, :host_ip=>"127.0.0.1", :id=>"ssh", :auto_correct=>true, :protocol=>"tcp"} ==> default: [landrush] network: :private_network, {:type=>:dhcp, :protocol=>"tcp", :id=>"b535f69c-c4b0-42f1-99bb-bccf84c4a185"} [landrush] Using eth1 (172.28.128.10) ==> default: [landrush] adding machine entry: cucumber.vagrant.test => 172.28.128.10 ==> default: [landrush] starting dns server [landrush] Using eth1 (172.28.128.10) Your host was detected as 'dnsmasq_installed' for which the host capability 'dnsmasq_installed' is not available. Check the documentation for the manual instructions to configure the visibility on the host.
==> default: Machine 'default' has a post
vagrant up
message. This is a message ==> default: from the creator of the Vagrantfile, and not from Vagrant itself: ==> default: ==> default: Vanilla Debian box. See https://atlas.hashicorp.com/debian/ for help and bug reports
Let's check if the landrush server is running:
vagrant landrush status
Daemon status: running pid=1104
Let's stop the daemon, which works:
vagrant landrush stop
Stopping daemon... Sending KILL to process 1104...
vagrant landrush status
Daemon status: stopped
Let's then try to start it again, which reports problems:
vagrant landrush start
vagrant landrush status
Daemon status: unknown /home/user/.vagrant.d/data/landrush/run/landrush.pid exists, but process is not running Check log file: /home/user/.vagrant.d/data/landrush/log/landrush.log
However if I issue a reload on the VM, the following happens:
vagrant reload
==> default: Attempting graceful shutdown of VM... ==> default: Checking if box 'debian/jessie64' is up to date... ==> default: Clearing any previously set forwarded ports... ==> default: Clearing any previously set network interfaces... ==> default: [landrush] virtualbox requires an additional private network; adding it ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat default: Adapter 2: hostonly ==> default: Forwarding ports... default: 22 (guest) => 2222 (host) (adapter 1) ==> default: Running 'pre-boot' VM customizations... ==> default: Booting VM... ==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2222 default: SSH username: vagrant default: SSH auth method: private key ==> default: Machine booted and ready! ==> default: Checking for guest additions in VM... default: No guest additions were detected on the base box for this VM! Guest default: additions are required for forwarded ports, shared folders, host only default: networking, and more. If SSH fails on this machine, please install default: the guest additions and repackage the box to continue. default: default: This is not an error message; everything may continue to work properly, default: in which case you may ignore this message. ==> default: [landrush] removing machine entry: cucumber.vagrant.test ==> default: Configuring and enabling network interfaces... ==> default: Automatic installation for Landrush IP not enabled ==> default: [landrush] setting up machine's DNS to point to our server ==> default: [landrush] network: :forwarded_port, {:guest=>22, :host=>2222, :host_ip=>"127.0.0.1", :id=>"ssh", :auto_correct=>true, :protocol=>"tcp"} ==> default: [landrush] network: :private_network, {:type=>:dhcp, :protocol=>"tcp", :id=>"3d2848e8-114d-4fc7-8928-18dbc70cd7b6"} [landrush] Using eth1 (172.28.128.10) ==> default: [landrush] adding machine entry: cucumber.vagrant.test => 172.28.128.10 ==> default: [landrush] starting dns server [landrush] Using eth1 (172.28.128.10) Your host was detected as 'dnsmasq_installed' for which the host capability 'dnsmasq_installed' is not available. Check the documentation for the manual instructions to configure the visibility on the host. ==> default: Machine already provisioned. Run
vagrant provision
or use the--provision
==> default: flag to force provisioning. Provisioners marked to run always will still run.==> default: Machine 'default' has a post
vagrant up
message. This is a message ==> default: from the creator of the Vagrantfile, and not from Vagrant itself: ==> default: ==> default: Vanilla Debian box. See https://atlas.hashicorp.com/debian/ for help and bug reports
When checking the status of the daemon, it works again:
vagrant landrush status
Daemon status: running pid=26331
Therefore, there's something wrong with the stopping/starting the landrush daemon - this is regarding jessie VM. However, when booting the Windows image, the reload command doesn't bring the landrush daemon back up if it has been stopped/crashed - the jessie image does. But let's take this one step at a time.
Closing the issue since I am unable to re-produce it.
I'm on Linux host trying to use landrush with Windows guests. My relevant part of the Vagrantfile:
First I do vagrant up, which imports the VM box when everything is working fine - after the following is done, the landrush will be running fine, dnsmasq will be listening on the 10053 port and able to resolve DNS names.
The problems started occurring once I did vagrant reload, where the landrush start at the beginning of the command but fails afterwards. If we execute vagrant landrush status before the VM is waiting for the WinRM (highlighted line below), the command works and reports the landrush is running.
We can also verify that the landrush is indeed running as can be seen below:
After the highlighted line above, the following happens, where we can clearly see the highlighted lines where the daemon is stopped/killed.
Here is also the vagrant reload --debug: