Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Problem spinning up Graphite using Synthesize and Vagrant on Windows 8 #21

Closed
helsing opened this issue Nov 13, 2014 · 9 comments
Closed

Comments

@helsing
Copy link

helsing commented Nov 13, 2014

I am trying to spin up Graphite using Synthesize and Vagrant on my Windows 8 machine. The provisioning step fails with an ": invalid option" error. Any suggestions?

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'synthesize'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: synthesize_default_1415917860626
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 443 => 8443 (adapter 1)
default: 8125 => 8125 (adapter 1)
default: 2003 => 22003 (adapter 1)
default: 2004 => 22004 (adapter 1)
default: 22 => 2222 (adapter 1)
==> 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: Warning: Connection timeout. Retrying...
default: Warning: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
GuestAdditions 4.3.10 running --- OK.
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
default: /vagrant => C:/Users/Workspace/synthesize
==> default: Running provisioner: shell...
default: Running: inline script
stdin: is not a tty
: invalid option
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

chmod +x /tmp/vagrant-shell && /tmp/vagrant-shell

Stdout from the command:

Stderr from the command:

stdin: is not a tty
: invalid option
$

@obfuscurity
Copy link
Owner

I don't have access to a Windows 8 system myself, but could you try either of the following "fixes" in your Vagrantfile and let me know which works for you? I found these over in hashicorp/vagrant#1673 for Vagrant.

@helsing
Copy link
Author

helsing commented Nov 14, 2014

(I am not that worried about the "stdin: is not a tty" problem at the moment, it doesn't solve the "invalid option" issue, but thanks anyway :-)

It seems to be the bash options that is the problem, i.e. the first line of the install file "#!/bin/bash -ex"
But if I remove the options entirely, I get stuck with the error message "sudo: unable to execute ./install: No such file or directory" instead. If I connect to the VM ('vagrant ssh') I do find the file /vagrant/install, but trying to run that file directly and manually in the VM renders the exact same result "sudo: unable to execute ./install".

Will try this:
http://unix.stackexchange.com/questions/144718/sudo-unable-to-execute-script-sh-no-such-file-or-directory

Yes, that did the trick. All files from the repo need to keep their Unix line-feeds (since they are referenced from within the VM during provisioning. I installed 'dos2Unix' on my VM instance and ran it on all files in the /vagrant/ directory.

@obfuscurity
Copy link
Owner

Sorry, I'm not sure I fully grok your workaround/fix. Can you elaborate or submit a PR? I'd love to ensure that this works for everyone using Vagrant.

@fj40bryan
Copy link

I hit this issue too and came to the same conclusion. I had to run dos2unix on the /vagrant/install file. Im not exactly sure what was wrong with the file, but I just guessed that it was a line ending issue, because when I ran it inside the vagrant vm, it complained about the last line of the file.

@iamamuc
Copy link

iamamuc commented Mar 19, 2015

I ran into this issue as well. dos2unix does fix this if you have already deployed and want to manually install.

Setting the Git value for core.autocrlf to "input" made sure the unix style line feeds were kept and I was able to deploy without having to run dos2unix and manually install.

@obfuscurity
Copy link
Owner

There is no obvious change to the affected file after running dos2unix on it, so there's nothing I can fix natively. Added a warning to the README, hopefully this helps future users. Closing this out.

@cgatian
Copy link

cgatian commented Jul 1, 2015

My quick fix was to open the file using Notepad++ and switching from DOS/Windows to UNIX by double clicking the text in the status bar.

You need to do this for both of the following files:
\install
\templates\init.d\carbon-cache

image

@Ajedi32
Copy link

Ajedi32 commented Oct 11, 2016

@obfuscurity You might want to try adding something like this to the repository's .gitattributes file:

* text=auto eol=lf

That will ensure that git doesn't change the files in Windows checkouts to use Windows-style line endings (which is what I'm assuming the problem is here).

See https://help.github.com/articles/dealing-with-line-endings/

obfuscurity added a commit that referenced this issue Dec 2, 2016
obfuscurity added a commit that referenced this issue Dec 2, 2016
@obfuscurity
Copy link
Owner

Thanks for the suggestion @Ajedi32, added.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants