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

"no implicit conversion of Integer into String" error when configuring a proxy site type #910

Closed
stevegriffiths opened this issue Jul 24, 2018 · 5 comments · Fixed by #984

Comments

@stevegriffiths
Copy link

stevegriffiths commented Jul 24, 2018

Versions

  • Vagrant: 2.1.1
  • Provider: Virtualbox 5.2.16
  • Homestead: 7.8.0

Host operating system

Windows 10

Homestead.yaml


ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: C:\Users\xx\Documents\Websites
      to: /home/vagrant/code

sites:
    - map: homestead.phpmyadmin
      to: /home/vagrant/code/phpmyadmin
    - map: homestead.app1
      to: /home/vagrant/code/app1/public
    - map: homestead.nodejs1
      to: 8080
      type: proxy

databases:
    - homestead

# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

#ports:
#    - send: 8081
#      to: 8080
#      protocol: udp

Vagrant destroy & up output

Provide a link to a GitHub Gist containing the complete output of vagrant destroy && vagrant up.
Do NOT paste the debug output in the issue, just paste the link to the Gist.

Expected behavior

Expect vagrant up to run without error, and for one of the sites in the resulting VM to act as a proxy to port 8080 (running a Node.js app) within the machine.

Actual behavior

Vagrant up fails with the following error:

homestead.rb:233:in '+': no implicit conversion of Integer into String (TypeError).

I have narrowed this error down to being the result of this line in the Homestead.yaml file, despite various sources suggesting that this is the correct format for defining a proxy type site in homestead:

to: 8080

Steps to reproduce

  1. Create Homestead.yaml file as displayed above.
  2. Run vagrant up
@svpernova09
Copy link
Collaborator

svpernova09 commented Jul 24, 2018 via email

@stevegriffiths
Copy link
Author

stevegriffiths commented Jul 24, 2018

Hi,

I am not using the ports section - I had experimented with it previously but really need to get the application working as a proxy - it's the config in the sites section I am focused on, specifically the block:
- map: homestead.nodejs1 to: 8080 type: proxy

I did try with quotation marks around the 8080, this started directing traffic into the folder where the node.js app is located but did not actually forward requests to the running node.js process.

@svpernova09
Copy link
Collaborator

I did try with quotation marks around the 8080, this started directing traffic into the folder where the node.js app is located but did not actually forward requests to the running node.js process.

Sounds like the proxy site is working. Do you have an index.js or similar set up to handle the incoming traffic in the node app? That's about as much help as I'm going to be with regards to node.

@stevegriffiths
Copy link
Author

This was a node.js configuration issue it seems, as having reset everything (for the 100th time!) it's now all working and serving as it should be.

Thanks for your help!

@hagabaka
Copy link

I'm still having this problem with the Homestead repo at master. It looks like the problem is scripts/homestead.rb:269

          if site['zray'] == 'true'
            ...
          else
            config.vm.provision 'shell' do |s|
              s.inline = 'rm -rf ' + site['to'] + '/ZendServer'
            end
          end
        end

Since "to" is only a port number for proxy sites, that doesn't really make sense.

hagabaka pushed a commit to hagabaka/homestead that referenced this issue Nov 16, 2018
hagabaka pushed a commit to hagabaka/homestead that referenced this issue Nov 16, 2018
svpernova09 pushed a commit that referenced this issue Nov 19, 2018
Fixes #910 by casting the port to a string and therefore allowing string
concatenation in [z-ray
cleanup](https://github.com/laravel/homestead/blob/master/scripts/homestead.rb#L269)

It's probable that this will occur in other places, i will look around,
but in the meantime, this fixes the most common scenario that is a fresh
installation with its defaults.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants