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

Vagrant Share stuck #10799

Open
paul-gene opened this issue Apr 17, 2019 · 15 comments

Comments

@paul-gene
Copy link

commented Apr 17, 2019

Vagrant version

2.2.4

Host operating system

Mac OS 10.13.6

Guest operating system

Debian Jessie

Vagrantfile

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    config.vm.define "demo" do |web|
        web.vm.box = "debian/contrib-jessie64"
        web.vm.network :private_network, ip: "192.168.100.100"
        web.vm.synced_folder ".", "/var/www", type: "nfs", mount_options: ['rw', 'vers=3', 'tcp'], linux__nfs_options: ['rw','no_subtree_check','all_squash','async']
        web.vm.provision :shell, :path => "install.sh"
        web.vm.provider "virtualbox" do |v|
            v.memory = 4096
            v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
            v.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
        end
    end
end

Expected behavior

I should have been able to access the Vagrant VM via Ngrok

Actual behavior

The Share Session was not started fully

Steps to reproduce

  1. Run vagrant up
  2. Run vagrant share --http 80
  3. Notice that the command gets stuck with the following output
Vagrant Share now defaults to using the `ngrok` driver.
The `classic` driver has been deprecated.

For more information about the `ngrok` driver, please
refer to the documentation:

  https://www.vagrantup.com/docs/share/

==> demo: Detecting network information for machine...
    demo: Local machine address: 127.0.0.1
    demo:
    demo: Note: With the local address (127.0.0.1), Vagrant Share can only
    demo: share any ports you have forwarded. Assign an IP or address to your
    demo: machine to expose all TCP ports. Consult the documentation
    demo: for your provider ('virtualbox') for more information.
    demo:
    demo: Local HTTP port: 80
    demo: Local HTTPS port: disabled
    demo: Port: 2222
==> demo: Creating Vagrant Share session...
@briancain

This comment has been minimized.

Copy link
Member

commented Apr 17, 2019

Hi there,

Thank you for opening an issue. However, there is not enough information here to reproduce or provide a recommendation. When you first open an issue, a template is pre-filled in the box. That template provides instructions for getting your host and guest information, the version of Vagrant, and the debug output. Without that information, it is very challenging for us to assist you.

Please supply that information either by updating this ticket or by closing this ticket and opening a new one. Thank you!

@paul-gene

This comment has been minimized.

Copy link
Author

commented Apr 18, 2019

Issue updated.

@briancain

This comment has been minimized.

Copy link
Member

commented Apr 18, 2019

@paul-gene - Do you have the full debug log of running vagrant share --http 80?

@vitorrd

This comment has been minimized.

Copy link

commented Apr 22, 2019

I have the very same problem, but I have an extra question. When there's a local port exposed by Vagrant (through :forwarded_port), why doesn't Vagrant use it? It seems it always defaults to 80, even if a port was specifically forwarded through Vagrantfile.

On topic, by looking at the debug logs, I can see ngrok outputting an URL which does work, but Vagrant never outputs it as it seems some errors follow, but are not detrimental to the share working at all. Here are my logs on this, if it helps (I'm forcing the correct port as per the above paragraph): https://pastebin.com/raw/FwNmizju

I emphasize the ngrok URL does work, it's just never output by vagrant share.

Thanks and apologies for hijacking the issue.

@paul-gene

This comment has been minimized.

Copy link
Author

commented Apr 26, 2019

@briancain how can I get a debug log when I run the command? https://pastebin.com/RBFbyg2C here you go

@paul-gene

This comment has been minimized.

Copy link
Author

commented Apr 26, 2019

I can see the Ngrok URL in the debug too, but when I visit it, I get the message:

Failed to complete tunnel connection
The connection to http://08f789a1.ngrok.io was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address localhost:80.

Make sure that a web service is running on localhost:80 and that it is a valid address.

The error encountered was: dial tcp [::1]:80: connect: connection refused

How do I run vagrant share pointing towards my vhost I have setup for the Vagrant Box?

@briancain

This comment has been minimized.

Copy link
Member

commented Apr 26, 2019

@paul-gene - hmmm...is this config file empty at all? Or does it exist?

/Users/paulcanning/.ngrok2/ngrok.yml

from...

DEBUG subprocess: stdout: {"err":"\u003cnil\u003e","lvl":"info","msg":"open config file","path":"/Users/paulcanning/.ngrok2/ngrok.yml","t":"2019-04-26T10:48:07.115148+01:00"}

@briancain briancain added share and removed waiting-reply labels Apr 26, 2019

@paul-gene

This comment has been minimized.

Copy link
Author

commented Apr 26, 2019

@briancain it exists, but simply has an auth token in it

@paul-gene

This comment has been minimized.

Copy link
Author

commented May 1, 2019

To add; when debugging, the ngrok URL is visible in the output. If I enter the URL in my phone, it manages to "load" the URL, but ends up redirecting to the vhost domain

eg

VHost = mydomain.test
Ngrok = 123456.ngrok.io

Enter 123456.ngrok.io into phone browser, blank page loads slowly then ends up on mydomain.test

@briancain

This comment has been minimized.

Copy link
Member

commented May 2, 2019

Thanks for the additional information! I'll put it in our next milestone to be worked on for the next release. ❤️

@briancain briancain added this to the 2.2.5 milestone May 2, 2019

@briancain briancain added the bug label May 2, 2019

@briancain briancain modified the milestones: 2.2.5, 2.2.6 Jul 10, 2019

@oeramirez

This comment has been minimized.

Copy link

commented Jul 13, 2019

Hi. I confirm this bug.

Vagrant version: Vagrant 2.2.5
ngrok version 2.3.30

I was following the Vagrant Getting Started tutorial and it took me a while to find the ngrok URL buried in the debug log:

{"addr":"http://localhost:4567","lvl":"info","msg":"started tunnel","name":"http","obj":"tunnels","t":"2019-07-13T16:00:20.9730045+02:00","url":"http://44852af9.ngrok.io"}

It is not shown however in the normal output, leading to believe that the share is not working:

vagrant share
Vagrant Share now defaults to using the ngrok driver.
The classic driver has been deprecated.

For more information about the ngrok driver, please
refer to the documentation:

https://www.vagrantup.com/docs/share/
==> default: Detecting network information for machine...
default: Local machine address: 127.0.0.1
default:
default: Note: With the local address (127.0.0.1), Vagrant Share can only
default: share any ports you have forwarded. Assign an IP or address to your
default: machine to expose all TCP ports. Consult the documentation
default: for your provider ('virtualbox') for more information.
default:
default: Local HTTP port: 4567
default: Local HTTPS port: disabled
default: Port: 2222
default: Port: 4567
==> default: Creating Vagrant Share session...

@briancain briancain self-assigned this Jul 15, 2019

@yangshuairocks

This comment has been minimized.

Copy link

commented Jul 26, 2019

I have the same issue just as @oeramirez described. I'm on Windows 10 with vagrant 2.2.5.

@jtinsky

This comment has been minimized.

Copy link

commented Aug 4, 2019

+1 on this bug with Vagrant version 2.2.4 and ngrok version 2.3.34 on MacOS 10.14.6

@fqr297

This comment has been minimized.

Copy link

commented Aug 11, 2019

+1 on this bug with Vagrant version 2.2.5 and ngrok version 2.3.34 on MacOS 10.14.6
However you can get ngrok URL by running vagrant share --debug and searching for it in recent lines of output.

@jacklenox

This comment has been minimized.

Copy link

commented Aug 31, 2019

Another +1 on this bug with Vagrant version 2.2.5, and ngrok version 2.3.34 on Ubuntu 18.04. As per @fqr297's suggestion, I was able to find the ngrok URL in debug mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.