Vagrant fails mounting Discourse - stdin: is not a tty


(D Iff) #1

When I run vagrant up, it’s ok before this line:

Preparing to edit /etc/exports. Administrator privileges will be required...

After above prompt, it asks for password, and here is the error that occurs:

[sudo] password for diff: 
nfsd running
sudo: /usr/bin/exportfs: command not found
==> default: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mount -o 'vers=3,udp' 192.168.10.1:'/home/diff/discourse' /vagrant
Stdout from the command:
Stderr from the command:
stdin: is not a tty
mount.nfs: access denied by server while mounting 192.168.10.1:/home/diff/discourse

Can Discourse Be Installed on a Local Host (I don't possess any domain at this time)
Vagrant failed, sudo: /etc/init.d/nfs-kernel-server: command not found
(zimbatm) #2

The /usr/bin/exportfs command doesn’t seem to exist on your system. It’s probably coming with a nfs package of some sort. On ubuntu it’s “nfs-kernel-server”.


(D Iff) #3

It’s installed: nfs-kernel-server is already the newest version.

# ls /usr/bin/exportfs

ls: cannot access /usr/bin/exportfs: No such file or directory

(zimbatm) #4

Are you using Ubuntu or another flavour of Linux ? Also which version ?
Package content can change between versions.


(D Iff) #5

[quote=“zimbatm, post:4, topic:14047, full:true”]
Are you using Ubuntu or another flavour of Linux ? Also which version ?
Package content can change between versions.
[/quote]Ubuntu 13.10
uname -a

Linux 3.11.0-18-generic #32-Ubuntu SMP Tue Feb 18 21:11:14 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

(D Iff) #6

No clue?
The problem is still against me :frowning:


(zimbatm) #7

Keep digging.

dpkg -L nfs-kernel-server | grep /usr/bin/exportfs should tell you if the
file is supposed to exist in the package.

If it does, check if it exists on the file sytem: ls -la /usr/bin/exportfs. This should tell you not only if the file exists but
also it’s kind and permissions. You can also use file to get an idea if
it’s a binary or a script.

If the file is not executable, use chmod +x /usr/bin/exportfs to change
the permissions.

If the file doesn’t exist there might be a corruption on the system. You
can fix that by re-installing the package: apt-get --reinstall install nfs-kernel-server.

Other possibilities exist but it depends on these outcomes.


(Johnalexhebert) #8

I am seeing the same issue consistently when I do ‘vagrant up’. The bin ‘exportfs’ is in /usr/sbin/exportfs’.

john@john-desktop:~$ uname -a
Linux john-desktop 3.5.0-48-generic #72~precise1-Ubuntu SMP Tue Mar 11 20:09:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
john@john-desktop:~$ sudo dpkg-query -l nfs-kernel-server
...
ii  nfs-kernel-server               1:1.2.5-3ubuntu3.1              support for NFS kernel server
john@john-desktop:~$ dpkg -L nfs-kernel-server | grep /usr/bin/exportfs
john@john-desktop:~$ dpkg -L nfs-kernel-server | grep /usr/sbin/exportfs
/usr/sbin/exportfs
john@john-desktop:~$ 

I made it work with ‘ln -s /usr/sbin/exportfs /usr/bin/exportfs’.

Which version of nfs-kernel-server do you have? Do you have a symlink setup to /usr/sbin/exportfs?


(D Iff) #9

[quote=“zimbatm, post:7, topic:14047, full:true”]
dpkg -L nfs-kernel-server | grep /usr/bin/exportfs[/quote]
no output!

If it does, check if it exists on the file sytem: ls -la /usr/bin/exportfs.

ls: cannot access /usr/bin/exportfs: No such file or directory

re-installing the package: apt-get --reinstall install nfs-kernel-server.

Done: Same result!


(zimbatm) #10

Vagrant makes the assumption that exportfs is located under /usr/bin but actually it’s under /usr/sbin in Ubuntu like @johnalexhebert explained.

By looking at the vagrant changelog it seems like it’s fixed in v1.5.2.

EDIT: You still have to make sure that /usr/sbin is present when you type: echo $PATH


(D Iff) #11

I update it to v1.5.2. here is new error:

vagrant up

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'discourse-0.9.7'...
Progress: 40%
There was an error while executing `VBoxManage`, a CLI used by Vagrant forcontrolling VirtualBox. The command and stderr is shown below.
Command: ["import", "/home/diff/.vagrant.d/boxes/discourse-0.9.7/0/virtualbox/box.ovf", "--vsys", "0", "--vmname", "discourse_1381849701_1397371424024_93148", "--vsys", "0", "--unit", "10", "--disk", "/home/diff/.VirtualBox_VMs/discourse_1381849701_1397371424024_93148/box-disk1.vmdk"]
Stderr: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interpreting /home/diff/.vagrant.d/boxes/discourse-0.9.7/0/virtualbox/box.ovf...
OK.
0%...10%...20%...30%...40%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage: error: Appliance import failed
VBoxManage: error: Could not create the clone medium '/home/diff/.VirtualBox_VMs/discourse_1381849701_1397371424024_93148/box-disk1.vmdk'.
VBoxManage: error: VMDK: cannot write allocated data block in '/home/diff/.VirtualBox_VMs/discourse_1381849701_1397371424024_93148/box-disk1.vmdk' (VERR_DISK_FULL)
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Appliance, interface IAppliance
VBoxManage: error: Context: "int handleImportAppliance(HandlerArg*)" at line 779 of file VBoxManageAppliance.cpp

dpkg -L nfs-kernel-server | grep /usr/bin/exportfs

Still no aoutput!


echo $PATH

/home/diff/.rvm/gems/ruby-2.1.1/bin:/home/diff/.rvm/gems/ruby-2.1.1@global/bin:/home/diff/.rvm/rubies/ruby-2.1.1/bin:/home/diff/bin:/usr/local/heroku/bin:/home/diff/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/diff/.rvm/bin

(zimbatm) #12

If you read the error log carefully, I think that VERR_DISK_FULL gives you a hint. Try checking if you have enough free space available on your machine.


(D Iff) #13

yes, thanks.
I read it. but it’s not obviouse! --> VERR_DISK_FULL => How should I understand this term means “not enough free space”?!

However, I still get the error mentioned in the 1st post while I’m using Vagrant v1.5.2!

Finally I run this command: sudo ln -s /usr/sbin/exportfs /usr/bin/exportfs=> It was not usefull:

    default: your host and reload your VM.
    default: 
    default: Guest Additions Version: 4.2.0
    default: VirtualBox Version: 4.3
==> default: Configuring and enabling network interfaces...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
nfsd running
==> default: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mount -o 'vers=3,udp' 192.168.10.1:'/home/diff/discourse' /vagrant
Stdout from the command:
Stderr from the command:
stdin: is not a tty
mount.nfs: mount to NFS server '192.168.10.1:/home/diff/discourse' failed: timed out, giving up


(zimbatm) #14

You’re getting closer. Try running the mount command that shows up in the
previous log, it should give you a more helpful message. Probably an issue
with the NFS server.


(D Iff) #15

After VAGRANTing, here is mount output
$ sudo mount -o 'vers=3,udp' 192.168.10.1:'/home/diff/discourse' /vagrant

[sudo] password for diff: 
mount.nfs: mount point /vagrant does not exist

(zimbatm) #16

You would have to create “/vagrant” on your host first or change the destination of the mount to an existing folder.


(D Iff) #17

sudo makdir /vagrant? What’s the right permissions for the folder?
I’m confused why it’s not created by the software automatically?

For mounting, should I first run vagrant ssh?


or change the destination of the mount to an existing folder.

How to check for existing folder?!


(Mogetutu) #18

Check your firewall settings if you are on OS X, uncheck blocking all incoming connections.

Then run through vagrant reload


#19

Getting the stdin: is not a tty error here too.

$ which exportfs
/usr/bin/exportfs
$ uname -a
Linux arch-moter8-vm 3.19.3-1-ARCH #1 SMP PREEMPT Thu Mar 26 14:56:16 CET 2015 x86_64 GNU/Linux

$ pacman -Qi nfs-utils
Name           : nfs-utils
Version        : 1.3.2-6

$ pacman -Qi vagrant
Name           : vagrant
Version        : 1.7.2-2

$ echo $PATH
/home/shell/.rvm/gems/ruby-.2.1/bin:/home/shell/.rvm/gems/ruby-.2.1@global/bin:/home/shell/.rvm/rubies/ruby-.2.1/bin:/home/shell/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

Not sure what else I can do.


Edit: This is an Vagrant upstream issue.
ubuntu - dpkg-reconfigure: unable to re-open stdin: No file or directory - Server Fault mentions that the following commands fixes this, I will try to modify the Vagrantfile and see how it goes.

export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales

Tried to modify the Vagrantfile to execute these commands but it still fails. I executed vagrant destroy && vagrant up.


#20

Maybe this issue is not actually blocking/making the script fail.

I just found an entry on the NFS/Troubleshooting page on Arch Linux’s wiki.

Now I just have to find where this gets executed at…

Edit: Then again, it says mount -o 'vers=3,udp' [...], sigh, so this is not the issue either.


https://github.com/protobox/protobox/issues/161
https://github.com/mitchellh/vagrant/issues/5424