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

/dev/fd errors on freebsd #124

Closed
wlcx opened this issue Nov 10, 2014 · 11 comments
Closed

/dev/fd errors on freebsd #124

wlcx opened this issue Nov 10, 2014 · 11 comments

Comments

@wlcx
Copy link

wlcx commented Nov 10, 2014

Fresh install of latest homeshick, on freebsd 10

$ ~/.homesick/repos/homeshick/bin/homeshick refresh
/home/samw/.homesick/repos/homeshick/bin/homeshick: line 111: /dev/fd/62: No such file or directory
/home/samw/.homesick/repos/homeshick/lib/fs.sh: line 21: /dev/fd/62: No such file or directory
/home/samw/.homesick/repos/homeshick/lib/fs.sh: line 21: /dev/fd/61: No such file or directory
@andsens
Copy link
Owner

andsens commented Nov 10, 2014

what the f...? I've never seen an error like that before. Is it something you can reproduce reliably? Try using the interactive testing tool as described in the guidelines.

My best guess with the limited info here is that you've run out of file descriptors, since it's a fresh install however, there shouldn't be anything that could hog that many FDs (except if you have a backup tool installed that monitors file changes).

@wlcx
Copy link
Author

wlcx commented Nov 11, 2014

Right, so having made shebang modifications (https://github.com/wlcx/homeshick/tree/development, not sure if you want me to PRQ that) I have tried test/interactive, and the same issue is present.

$ homeshick clone wlcx/dotfiles
        clone https://github.com/wlcx/dotfiles.git
      updates The castle dotfiles has new files.
     symlink? [yN] y
/tmp/tmp.N5QPEvme/home/.homesick/repos/homeshick/lib/commands/link.sh: line 3: /dev/fd/62: No such file or directory
$ /tmp/tmp.N5QPEvme/home/.homesick/repos/homeshick/lib/commands/link.sh: line 78: /dev/fd/62: No such file or directory
/tmp/tmp.N5QPEvme/home/.homesick/repos/homeshick/lib/commands/link.sh: line 78: /dev/fd/61: No such file or directory

Clone runs fine, link/refresh/list etc all cause an FD error. Also, I noticed that the command exits (as evidenced by the $) before the latter two errors. Wierd. I have tried on two separate freebsd systems, incidentally.

@andsens
Copy link
Owner

andsens commented Nov 11, 2014

Right, so having made shebang modifications

The shebangs are really just there for syntax highlighting purposes, only bin/homeshick needs the proper /usr/bin/env bash.... and lib/submodule_files.sh, which it doesn't - that could definitely cause problems, I'll fix that.

@wlcx
Copy link
Author

wlcx commented Nov 11, 2014

On current development HEAD, I get:
$ $HOME/.homesick/repos/homeshick/test/interactive /home/samw/.homesick/repos/homeshick/test/interactive: /home/samw/.homesick/repos/homeshick/test/setup-default.sh: /bin/bash: bad interpreter: No such file or directory
Which is why I changed all of them :p something of a blunt approach I realise.

andsens added a commit that referenced this issue Nov 11, 2014
Files that are executable now all have the /usr/bin/env type shebang,
while all files that should only be source from other files have the /bin/bash shebang
@andsens
Copy link
Owner

andsens commented Nov 12, 2014

I have pushed a possible fix to the development branch. Could you check it out and see if it works?

p.s.: If you could post a short script that reproduces the error in interactive mode, I will make a regression test for it so it doesn't happen again.

@andsens
Copy link
Owner

andsens commented Nov 12, 2014

OK, so the line numbers all closely correspond to pieces of code that use process substitution (which actually makes sense).

Could you try executing find -L "$repos" -mindepth 2 -maxdepth 2 -name .git -type d -print0 | sort -z ($repos being $HOME/.homesick/repos) and post the output?

@wlcx
Copy link
Author

wlcx commented Nov 12, 2014

Current development still errors:

$ homeshick link dotfiles
/home/samw/.homesick/repos/homeshick/lib/commands/link.sh: line 3: /dev/fd/62: No such file or directory
/home/samw/.homesick/repos/homeshick/lib/commands/link.sh: line 78: /dev/fd/62: No such file or directory
/home/samw/.homesick/repos/homeshick/lib/commands/link.sh: line 78: /dev/fd/61: No such file or directory

Find output:

$ find -L "$repos" -mindepth 2 -maxdepth 2 -name .git -type d -print0 | sort -z
/home/samw/.homesick/repos/dotfiles/.git/home/samw/.homesick/repos/homeshick/.git

@dougborg
Copy link
Contributor

This is most likely a bug in FreeBSD or a configuration issue on those environments (bash version, udev, etc.). I do not have much experience with FreeBSD, but it looks like people run into this issue on other projects:

https://github.com/sstephenson/rbenv/wiki
rbenv/rbenv#401
http://www.ducea.com/2009/02/18/linux-tips-bash-completion-devfd62-no-such-file-or-directory/

It could also have to do with how homeshick is being invoked:
http://unix.stackexchange.com/questions/124838/process-substitution-from-curl-to-bash-as-root

@dougborg
Copy link
Contributor

This might be a good fix candidate to try out: rbenv/rbenv#401 (comment)

@wlcx
Copy link
Author

wlcx commented Nov 21, 2014

Oho. sudo mount -t fdescfs fdesc /dev/fd and now things are fixed.
@gavinatkinson, who knows more than I ever will, pointed out that bash now requires fdescfs(5) mounted on /dev/fd which FreeBSD does not yet do as default.

@andsens
Copy link
Owner

andsens commented Nov 21, 2014

Yay! Thank you for reporting back the fix! Could you add the fix to the FAQ? I created it just now for that purpose and I think other people could really use the pointer when running FreeBSD.

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

No branches or pull requests

3 participants