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

Permission error for textgen yaml preset in nix store #93

Closed
Vasissualiyp opened this issue Apr 18, 2024 · 1 comment
Closed

Permission error for textgen yaml preset in nix store #93

Vasissualiyp opened this issue Apr 18, 2024 · 1 comment

Comments

@Vasissualiyp
Copy link

Vasissualiyp commented Apr 18, 2024

Hi,
Trying to run nix run .#textgen-nvidia, but little success for now. I was able to install it as a root without issues, but I would prefer to run it as a user.
Here are my issues on non-root setup (I wiped the root installation and did nix-collect-garbage before reinstalling normally). Currently, it looks like it builds fine, but there is an issue when a python script asks to access a yaml file from nix store, for which it has no permissions:

[user]$ nix run github:nixified-ai/flake#textgen-nvidia
rm: cannot remove '/tmp/nix-textgen/presets': Permission denied
rm: cannot remove '/tmp/nix-textgen/cache': Permission denied
rm: cannot remove '/tmp/nix-textgen/characters': Permission denied
rm: cannot remove '/tmp/nix-textgen/prompts': Permission denied
rm: cannot remove '/tmp/nix-textgen/models': Permission denied
rm: cannot remove '/tmp/nix-textgen/loras': Permission denied
ln: failed to create symbolic link '/tmp/nix-textgen/models': File exists
ln: failed to create symbolic link '/tmp/nix-textgen/loras': File exists
ln: failed to create symbolic link '/tmp/nix-textgen/cache': File exists
ln: failed to create symbolic link '/tmp/nix-textgen/prompts': File exists
ln: failed to create symbolic link '/tmp/nix-textgen/characters': File exists
ln: failed to create symbolic link '/tmp/nix-textgen/presets': File exists
Traceback (most recent call last):
  File "/nix/store/1zzqmn5cl5c8dcbv37xp8xvvii892015-textgen-patchedSrc/server.py", line 229, in <module>
    create_interface()
  File "/nix/store/1zzqmn5cl5c8dcbv37xp8xvvii892015-textgen-patchedSrc/server.py", line 115, in create_interface
    ui_parameters.create_ui(shared.settings['preset'])  # Parameters tab
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/1zzqmn5cl5c8dcbv37xp8xvvii892015-textgen-patchedSrc/modules/ui_parameters.py", line 11, in create_ui
    generate_params = presets.load_preset(default_preset)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/1zzqmn5cl5c8dcbv37xp8xvvii892015-textgen-patchedSrc/modules/presets.py", line 42, in load_preset
    with open(Path(f'/nix/store/1zzqmn5cl5c8dcbv37xp8xvvii892015-textgen-patchedSrc/presets/{name}.yaml'), 'r') as infile:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/nix/store/1zzqmn5cl5c8dcbv37xp8xvvii892015-textgen-patchedSrc/presets/simple-1.yaml'

It seems that the symlink is going to /tmp/nix-textgen/presets, out of which there is another symlink which goes to /root/.textgen/state/presets. I ran garbage collection with and without sudo, and it still references the directory in my root, and not user directory (where it, weirdly, gets created at /home/user/.textgen/

Thanks!

@Vasissualiyp
Copy link
Author

Was able to fix it by manually rebinding adjusting the paths of all the links in /tmp/ directory. Leaving the issue here for discoverability.

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

1 participant