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

direnv hangs forever, randomly, at PATH_add #1248

Open
jmm opened this issue Mar 6, 2024 · 3 comments
Open

direnv hangs forever, randomly, at PATH_add #1248

jmm opened this issue Mar 6, 2024 · 3 comments
Labels

Comments

@jmm
Copy link

jmm commented Mar 6, 2024

Hello,

Describe the bug

I'm working within a project where direnv will randomly start hanging (forever) with:

direnv: ([/opt/homebrew/bin/direnv export zsh]) is taking a while to execute. Use CTRL-C to give up.

Upon CTRL+C I get:

environment:582: cannot create temp file for here-document: No space left on device

To Reproduce

Unknown, it happens randomly and then continues sporadically.

Expected behavior

direnv processes .envrc, updates the environment, and returns me to the prompt.

Environment

  • OS: MacOS 13.4
  • Shell: zsh
  • Direnv version v2.34.0

Additional context

These are the commands leading up to it hanging:

direnv: loading /whatever/.envrc
++ PATH_add ./node_modules/.bin
++ path_add PATH ./node_modules/.bin
++ local path i var_name=PATH
++ declare -a path_array
++ IFS=:
++ read -ra path_array

So it seems this is the issue:

https://github.com/direnv/direnv/blob/v2.34.0/stdlib.sh#L608

That's presumably the here-document the error refers to. I have no idea what it means by:

No space left on device

I'm currently having to attempt to resolve it by eliminating PATH_add from the project and using regular concatenation / interpolation to generate PATH.

@jmm jmm added the Bug label Mar 6, 2024
@zimbatm
Copy link
Member

zimbatm commented Mar 8, 2024

Hi, this is an issue with your system. Either the temp folder is full or running out of inodes. See https://unix.stackexchange.com/questions/277387/tab-completion-errors-bash-cannot-create-temp-file-for-here-document-no-space

@jmm
Copy link
Author

jmm commented Mar 8, 2024

Hi, thanks for your reply, but there is no sign that either storage or inodes are anywhere near being exhausted.

And other people using the project have also experienced it hanging.

% df -hi      
Filesystem        Size    Used   Avail Capacity iused ifree %iused  Mounted on
/dev/disk3s1s1   460Gi   9.4Gi   230Gi     4%    394k  2.4G    0%   /
devfs            234Ki   234Ki     0Bi   100%     810     0  100%   /dev
/dev/disk3s6     460Gi    11Gi   230Gi     5%      11  2.4G    0%   /System/Volumes/VM
/dev/disk3s2     460Gi   5.6Gi   230Gi     3%    1.1k  2.4G    0%   /System/Volumes/Preboot
/dev/disk3s4     460Gi   6.9Mi   230Gi     1%      45  2.4G    0%   /System/Volumes/Update
/dev/disk1s2     500Mi   6.0Mi   481Mi     2%       1  4.9M    0%   /System/Volumes/xarts
/dev/disk1s1     500Mi   6.1Mi   481Mi     2%      30  4.9M    0%   /System/Volumes/iSCPreboot
/dev/disk1s3     500Mi   2.2Mi   481Mi     1%      65  4.9M    0%   /System/Volumes/Hardware
/dev/disk3s5     460Gi   203Gi   230Gi    47%    4.0M  2.4G    0%   /System/Volumes/Data
map auto_home      0Bi     0Bi     0Bi   100%       0     0     -   /System/Volumes/Data/home
OrbStack:/       3.9Gi   4.0Ki   3.9Gi     1%     100  1.0M    0%   /Users/whatever/OrbStack

@zimbatm
Copy link
Member

zimbatm commented Mar 13, 2024

Maybe the $TMPDIR is set by the .envrc. If you use use_nix, for example, that can happen.

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

No branches or pull requests

2 participants