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

how to fix error "default: stdin: is not a tty" when using vagrant up #517

Closed
ricker07 opened this Issue Dec 11, 2014 · 26 comments

Comments

Projects
None yet
@ricker07

ricker07 commented Dec 11, 2014

This is what i get when i run "vagrant up". i already do everything, line "sudo service mysql restart || true", vagrant hault, vagrant provision, sudo apt-get update, etc. but it doesn't work. please help me, i just want to update my mysql from 5.5 to 5.6 because i'm using laravel framework and the system i'm working on today is required to use mysql version 5.6.

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: A newer version of the box 'laravel/homestead' is available! You currently
==> default: have version '0.2.0'. The latest is version '0.2.1'. Run
==> default: vagrant box update to update.
==> default: Setting the name of the VM: Homestead_default_1418261939885_87172
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 80 => 8000 (adapter 1)
default: 3306 => 33060 (adapter 1)
default: 5432 => 54320 (adapter 1)
default: 22 => 2222 (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: Warning: Connection timeout. Retrying...
default: Warning: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => /home/sedp/Homestead
default: /home/vagrant/Projects => /home/sedp/Projects
==> default: Running provisioner: shell...
default: Running: inline script
==> default: stdin: is not a tty
==> default: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCiivZdJRmsEDj0PtfecSxl3g/HOAsmQXh7K4x0LQB5NKONbpO0leFRFJ2lV+iGMasqA45tfF9jGSIxmGsMfmg6VOVkUZ2EWk6tURFfM5FW3DgeL9CLcG4OhTHLyA9AcTHH0BvVml2OWYeXyfM5J8rURbaURZF1qKtjuR2r/JfF1HK0fhgjgnPMfBgkEt77XXMYSfDYxOSY9IhXEr8uNzXRjBWVmB1PNERoOCmodfANjClL8ptbguT+jYgUIFxDbpvm87plT4LzCCo+otoLSgCF+k51mwf0/Y3/IvhuskKdfSEYomRdBVCy19sY5c75oh5f471OFMfAehtFoOYdiRw7 bantonricker07@gmail.com
==> default: Running provisioner: shell...
default: Running: inline script
==> default: Running provisioner: shell...
default: Running: inline script
==> default: stdin: is not a tty
==> default: Running provisioner: shell...
default: Running: inline script
==> default: stdin: is not a tty
==> default: * Restarting nginx nginx
==> default: ...done.
==> default: php5-fpm stop/waiting
==> default: php5-fpm start/running, process 1966
==> default: Running provisioner: shell...
default: Running: inline script
==> default: stdin: is not a tty
==> default: * Restarting nginx nginx
==> default: ...done.
==> default: php5-fpm stop/waiting
==> default: php5-fpm start/running, process 2021
==> default: Running provisioner: shell...
default: Running: inline script
==> default: stdin: is not a tty
==> default: * Restarting nginx nginx
==> default: ...done.
==> default: php5-fpm stop/waiting
==> default: php5-fpm start/running, process 2076
==> default: Running provisioner: shell...
default: Running: inline script
==> default: stdin: is not a tty
==> default: php5-fpm stop/waiting
==> default: php5-fpm start/running, process 2109

@jeremyfelt jeremyfelt added the question label Dec 11, 2014

@jeremyfelt

This comment has been minimized.

Show comment
Hide comment
@jeremyfelt

jeremyfelt Dec 11, 2014

Member

Hi @ricker07 - I'd try a vagrant up without the provisioning just to ensure the box loads properly. Not much of this looks familiar from the VVV provisioning, and if laravel/homestead isn't an Ubuntu box, I could see some conflicts.

Member

jeremyfelt commented Dec 11, 2014

Hi @ricker07 - I'd try a vagrant up without the provisioning just to ensure the box loads properly. Not much of this looks familiar from the VVV provisioning, and if laravel/homestead isn't an Ubuntu box, I could see some conflicts.

@ericandrewlewis

This comment has been minimized.

Show comment
Hide comment
@ericandrewlewis

ericandrewlewis Dec 13, 2014

Contributor

Pretty sure this is symptomatic of mitchellh/vagrant#1673, which unfortunately is unresolved.

Contributor

ericandrewlewis commented Dec 13, 2014

Pretty sure this is symptomatic of mitchellh/vagrant#1673, which unfortunately is unresolved.

@jeremyfelt jeremyfelt closed this Jan 8, 2015

@ricker07

This comment has been minimized.

Show comment
Hide comment
@ricker07

ricker07 Jan 12, 2015

thank you guys for your help. sorry for late reply. i'm just beginner in
laravel with vagrant. :)

On 8 January 2015 at 12:51, Jeremy Felt notifications@github.com wrote:

Closed #517 #517.


Reply to this email directly or view it on GitHub
#517 (comment)
.

ricker07 commented Jan 12, 2015

thank you guys for your help. sorry for late reply. i'm just beginner in
laravel with vagrant. :)

On 8 January 2015 at 12:51, Jeremy Felt notifications@github.com wrote:

Closed #517 #517.


Reply to this email directly or view it on GitHub
#517 (comment)
.

@twisty7867

This comment has been minimized.

Show comment
Hide comment
@twisty7867

twisty7867 Apr 27, 2015

There is a simple fix for the issue (assuming you don't really need a TTY); essentially you need to remove the mesg n command from /root/.proflle. You can copy and paste exactly what you need from an explanation I published on my site.

twisty7867 commented Apr 27, 2015

There is a simple fix for the issue (assuming you don't really need a TTY); essentially you need to remove the mesg n command from /root/.proflle. You can copy and paste exactly what you need from an explanation I published on my site.

@ricker07

This comment has been minimized.

Show comment
Hide comment
@ricker07

ricker07 Apr 28, 2015

thanks sir @twisty7867 for the help. :)

On 28 April 2015 at 04:48, twisty7867 notifications@github.com wrote:

There is a simple fix for the issue (assuming you don't really need a
TTY); essentially you need to remove the mesg n command from
/root/.proflle. You can copy and paste exactly what you need from an
explanation I published on my site
http://foo-o-rama.com/vagrant--stdin-is-not-a-tty--fix.html.


Reply to this email directly or view it on GitHub
#517 (comment)
.

ricker07 commented Apr 28, 2015

thanks sir @twisty7867 for the help. :)

On 28 April 2015 at 04:48, twisty7867 notifications@github.com wrote:

There is a simple fix for the issue (assuming you don't really need a
TTY); essentially you need to remove the mesg n command from
/root/.proflle. You can copy and paste exactly what you need from an
explanation I published on my site
http://foo-o-rama.com/vagrant--stdin-is-not-a-tty--fix.html.


Reply to this email directly or view it on GitHub
#517 (comment)
.

@cfoellmann cfoellmann referenced this issue Apr 28, 2015

Merged

fix-no-tty #633

@jeremyfelt jeremyfelt added the bug label May 17, 2015

@jeremyfelt jeremyfelt added this to the 1.3.0 (Next Release) milestone May 17, 2015

@jeremyfelt

This comment has been minimized.

Show comment
Hide comment
@jeremyfelt

jeremyfelt May 17, 2015

Member

This will be fixed/merged in #633 pending license approval. Thanks all!

Member

jeremyfelt commented May 17, 2015

This will be fixed/merged in #633 pending license approval. Thanks all!

erhudy added a commit to bloomberg/chef-bcpc that referenced this issue May 18, 2015

couple of fixes for local mirror on bootstrap node and proxy servers
- preconfigures apt to bypass any configured proxy server
- runs apt-get update to ensure that the package install triggered by
  bootstrap_chef.sh comes from the local mirror
- an attempt to fix the Vagrant error 'stdin: is not a tty' (see
  Varying-Vagrant-Vagrants/VVV#517)
- fix for a grep pattern so that the proxy server is still inserted into
  apt's configuration even with the DIRECT pattern for a local mirror
@siddhanthm

This comment has been minimized.

Show comment
Hide comment
@siddhanthm

siddhanthm Jun 17, 2015

I still have the same error. I am using Mac OS though

siddhanthm commented Jun 17, 2015

I still have the same error. I am using Mac OS though

@Blueblau

This comment has been minimized.

Show comment
Hide comment
@Blueblau

Blueblau commented Jul 12, 2015

+1 on OSX

@mateuslopesbh

This comment has been minimized.

Show comment
Hide comment
@mateuslopesbh

mateuslopesbh commented Jul 16, 2015

+2 on OSX

@iondulgheru

This comment has been minimized.

Show comment
Hide comment
@iondulgheru

iondulgheru commented Jul 17, 2015

+1 in OSX

@mateuslopesbh

This comment has been minimized.

Show comment
Hide comment
@mateuslopesbh

mateuslopesbh Jul 18, 2015

Insert this line in Vagrantfile, was resolved for me.

config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"

mateuslopesbh commented Jul 18, 2015

Insert this line in Vagrantfile, was resolved for me.

config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"

@twisty7867

This comment has been minimized.

Show comment
Hide comment
@twisty7867

twisty7867 Jul 18, 2015

@mateuslopesbh that can have some other deleterious effects, according to hashicorp/vagrant#1673 (not necessarily in a VVV context). The code I proposed absolutely fixes this issue, regardless of host OS, for a standard Ubuntu 14.04 install. If anyone continuing to experience this issue could share with me their Vagrantfile and a screen grab of the output during vagrant up, I'll be happy to help troubleshoot.

twisty7867 commented Jul 18, 2015

@mateuslopesbh that can have some other deleterious effects, according to hashicorp/vagrant#1673 (not necessarily in a VVV context). The code I proposed absolutely fixes this issue, regardless of host OS, for a standard Ubuntu 14.04 install. If anyone continuing to experience this issue could share with me their Vagrantfile and a screen grab of the output during vagrant up, I'll be happy to help troubleshoot.

@ViktorHaag

This comment has been minimized.

Show comment
Hide comment
@ViktorHaag

ViktorHaag Sep 14, 2015

Hey @twisty7867, I already have this in my Vagrantfile, and it seems I'm unable to put in your fix in combination with this existing declaration:

config.vm.provision :shell do |shell|
   shell.path = 'setup.sh'
end

I don't know much at all about vagrant or Ruby, and am unsure how to include both your fix and my existing stuff here (which was put there by someone else no longer around)? I tried two blocks (put yours first), and then I get an error that says "fix-no-tty provisioner could not be found"... I tried putting your stuff into this same block, and I get "only of path and inline may be set"... Can you assist?

ViktorHaag commented Sep 14, 2015

Hey @twisty7867, I already have this in my Vagrantfile, and it seems I'm unable to put in your fix in combination with this existing declaration:

config.vm.provision :shell do |shell|
   shell.path = 'setup.sh'
end

I don't know much at all about vagrant or Ruby, and am unsure how to include both your fix and my existing stuff here (which was put there by someone else no longer around)? I tried two blocks (put yours first), and then I get an error that says "fix-no-tty provisioner could not be found"... I tried putting your stuff into this same block, and I get "only of path and inline may be set"... Can you assist?

@twisty7867

This comment has been minimized.

Show comment
Hide comment
@twisty7867

twisty7867 Sep 14, 2015

The "could not be found" error is because your version of Vagrant is too old. You need at least 1.7 to support a named provisioner. You could edit the first line of my code to look more like the one you pasted, e.g. just copy and past the first line of above and replace the first line of mine with it, changing |shell| to |s|.

twisty7867 commented Sep 14, 2015

The "could not be found" error is because your version of Vagrant is too old. You need at least 1.7 to support a named provisioner. You could edit the first line of my code to look more like the one you pasted, e.g. just copy and past the first line of above and replace the first line of mine with it, changing |shell| to |s|.

@ViktorHaag

This comment has been minimized.

Show comment
Hide comment
@ViktorHaag

ViktorHaag Sep 14, 2015

On OSX, and when I vagrant --version, I get Vagrant 1.7.4 ... this seems to be the latest build available for OSX.

ViktorHaag commented Sep 14, 2015

On OSX, and when I vagrant --version, I get Vagrant 1.7.4 ... this seems to be the latest build available for OSX.

@nkasvosve

This comment has been minimized.

Show comment
Hide comment
@nkasvosve

nkasvosve Sep 27, 2015

config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"

did it. Thanks

nkasvosve commented Sep 27, 2015

config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"

did it. Thanks

@stenio123

This comment has been minimized.

Show comment
Hide comment
@stenio123

stenio123 Oct 9, 2015

@nkasvosve 's solution worked for me, just added that line in the Vagrantfile, inside the loop "Vagrant.configure(2) do |config|. Thank you!

stenio123 commented Oct 9, 2015

@nkasvosve 's solution worked for me, just added that line in the Vagrantfile, inside the loop "Vagrant.configure(2) do |config|. Thank you!

@mewben

This comment has been minimized.

Show comment
Hide comment
@mewben

mewben Nov 5, 2015

@nkasvosve Thanks.. worked for me...

mewben commented Nov 5, 2015

@nkasvosve Thanks.. worked for me...

@walkr

This comment has been minimized.

Show comment
Hide comment
@walkr

walkr Nov 7, 2015

@twisty7867 Thank you! It worked for me too.

walkr commented Nov 7, 2015

@twisty7867 Thank you! It worked for me too.

@thierrymarianne

This comment has been minimized.

Show comment
Hide comment
@thierrymarianne

thierrymarianne Nov 29, 2015

In a nutshell, inserting the following line into a Vagrantfile breaks the vagrant ssh command (when used in combination with --command option for instance, which I've experienced personally)

config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"

See hashicorp/vagrant#1673 (comment)

There is also the possibility to set config.ssh.pty to true in the Vagrantfile but there seems to be other side-effects:

config.ssh.pty = true

See hashicorp/vagrant#1673 (comment) and http://docs.vagrantup.com/v2/vagrantfile/ssh_settings.html

On the contrary, the next provisioning script provided by @twisty7867 seems to fix the issue without visible regression as far as I can tell from a very restricted usage.

config.vm.provision "fix-no-tty", type: "shell" do |s|
    s.privileged = false
    s.inline = "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile"
end

See http://foo-o-rama.com/vagrant--stdin-is-not-a-tty--fix.html

thierrymarianne commented Nov 29, 2015

In a nutshell, inserting the following line into a Vagrantfile breaks the vagrant ssh command (when used in combination with --command option for instance, which I've experienced personally)

config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"

See hashicorp/vagrant#1673 (comment)

There is also the possibility to set config.ssh.pty to true in the Vagrantfile but there seems to be other side-effects:

config.ssh.pty = true

See hashicorp/vagrant#1673 (comment) and http://docs.vagrantup.com/v2/vagrantfile/ssh_settings.html

On the contrary, the next provisioning script provided by @twisty7867 seems to fix the issue without visible regression as far as I can tell from a very restricted usage.

config.vm.provision "fix-no-tty", type: "shell" do |s|
    s.privileged = false
    s.inline = "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile"
end

See http://foo-o-rama.com/vagrant--stdin-is-not-a-tty--fix.html

@imuller

This comment has been minimized.

Show comment
Hide comment
@imuller

imuller Jan 4, 2016

@nkasvosve, worked for me. Thanks!

imuller commented Jan 4, 2016

@nkasvosve, worked for me. Thanks!

@leetschau

This comment has been minimized.

Show comment
Hide comment
@leetschau

leetschau Jan 7, 2016

@thierrymarianne "fix-no-tty" worked for me. Thanks!

leetschau commented Jan 7, 2016

@thierrymarianne "fix-no-tty" worked for me. Thanks!

@gidantribal

This comment has been minimized.

Show comment
Hide comment
@gidantribal

gidantribal Apr 20, 2016

Still the same problem for me too, this fixes the issue:

    config.vm.provision "fix-no-tty", type: "shell" do |s|
      s.privileged = false
      s.inline = "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile"
    end

gidantribal commented Apr 20, 2016

Still the same problem for me too, this fixes the issue:

    config.vm.provision "fix-no-tty", type: "shell" do |s|
      s.privileged = false
      s.inline = "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile"
    end
@rahulswimmer

This comment has been minimized.

Show comment
Hide comment
@rahulswimmer

rahulswimmer Jan 4, 2017

I ve started exploring Hyperledger and i have encountered a problem while installing vagrant. Following is the error i encountered after i used the command - 'vagrant up':

==> default: Running provisioner: shell...
default: Running: inline script
==> default: stdin: is not a tty
==> default: ++ export DOCKER_STORAGE_BACKEND=
==> default: ++ DOCKER_STORAGE_BACKEND=
==> default: ++ cd /hyperledger/devenv
==> default: ++ ./setup.sh
==> default: fatal: Not a git repository (or any parent up to mount point /hyper
ledger)
==> default: Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM no
t set).
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

What should i do?

rahulswimmer commented Jan 4, 2017

I ve started exploring Hyperledger and i have encountered a problem while installing vagrant. Following is the error i encountered after i used the command - 'vagrant up':

==> default: Running provisioner: shell...
default: Running: inline script
==> default: stdin: is not a tty
==> default: ++ export DOCKER_STORAGE_BACKEND=
==> default: ++ DOCKER_STORAGE_BACKEND=
==> default: ++ cd /hyperledger/devenv
==> default: ++ ./setup.sh
==> default: fatal: Not a git repository (or any parent up to mount point /hyper
ledger)
==> default: Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM no
t set).
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

What should i do?

@christian-weiss

This comment has been minimized.

Show comment
Hide comment
@christian-weiss

christian-weiss Feb 10, 2017

@thierrymarianne thanks for your "fix-no-tty"-snipped. Works very well. Even on OSX.

christian-weiss commented Feb 10, 2017

@thierrymarianne thanks for your "fix-no-tty"-snipped. Works very well. Even on OSX.

@alexcasella

This comment has been minimized.

Show comment
Hide comment
@alexcasella

alexcasella Jun 12, 2017

@rahulswimmer did you ever find a solution to that problem? I am having the same issue

alexcasella commented Jun 12, 2017

@rahulswimmer did you ever find a solution to that problem? I am having the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment