Replit.nix Error discovered after secrets were lost

Question: Nix is completely broken on my repl. This happened the same time I realized secrets had gotten lost all over replit.

Repl link/Link to where the bug appears:
https://replit.com/@AkshatPrakash1/Discord-Bot-V2
The replit.nix file is the issue.
Screenshots, links, or other helpful context:

/home/runner/Discord-Bot-V2/venv/bin/python3: line 3: exec: : not found
Detected change in environment, reloading shell...
nix error: building nix env: exit status 1
Output has been trimmed to the last 20 lines
         whose name attribute is located at /nix/store/x8dbrija74rnw16hrbw5r5apx9k81giz-nixpkgs-21.11-src/pkgs/stdenv/generic/make-derivation.nix:205:7

       … while evaluating attribute 'PYTHON_LD_LIBRARY_PATH' of derivation 'nix-shell'

         at /home/runner/Discord-Bot-V2/replit.nix:25:5:

           24|   env = {
           25|     PYTHON_LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
             |     ^
           26|       pkgs.rapidfuzz-cpp

       error: attribute 'rapidfuzz-cpp' missing

       at /home/runner/Discord-Bot-V2/replit.nix:26:7:

           25|     PYTHON_LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
           26|       pkgs.rapidfuzz-cpp
             |       ^
           27|      # pkgs.rapidfuzz-cpp

I have the same error, which was posted here. Unlike in the other forum I did not change any extensions it was working fine 2 days ago.
Link: Broken Repl After Uninstalling Some Extensions

However the solution provided, which changed the channel did not work and I am getting the same error. If anyone could help me it would be greatly appreciated.

Screenshot 2023-12-13 at 7.44.18 PM

This error was reported at All Secrets missing?, try reporting this issue below that post

While my secrets are also missing I think only my replit has this nix issue from it. Even if I readd the secrets to my repl, the error persists because my issue is with my nix file.

This is most likely unrelated to secrets.

Show hidden files and open the .replit file. Find the variable channel under [nix] section.
The value of the variable should be "stable-23_05" or a higher one such as 23.11 or unstable.

For older nix channels (like 22.11), some packages are not present so there is an error.

2 Likes

Thank you for the response. I have changed that but now I get this error in the shell.

nix error: building nix env: exit status 1
Output has been trimmed to the last 20 lines
         whose name attribute is located at /nix/store/x8dbrija74rnw16hrbw5r5apx9k81giz-nixpkgs-21.11-src/pkgs/stdenv/generic/make-derivation.nix:205:7

       … while evaluating attribute 'PYTHON_LD_LIBRARY_PATH' of derivation 'nix-shell'

         at /home/runner/Discord-Bot-V2/replit.nix:25:5:

           24|   env = {
           25|     PYTHON_LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
             |     ^
           26|       pkgs.rapidfuzz-cpp

       error: attribute 'rapidfuzz-cpp' missing

       at /home/runner/Discord-Bot-V2/replit.nix:26:7:

           25|     PYTHON_LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
           26|       pkgs.rapidfuzz-cpp
             |       ^
           27|       pkgs.tk

and this error in the console

/nix/store/hpbvrlwd5viqmvcaisb3x0118i913a9n-stderred-0.1.0/bin/stderred: /nix/store/s9qbqh7gzacs7h68b2jfmn9l6q4jwfjz-glibc-2.33-59/lib/libc.so.6: version `GLIBC_2.35' not found (required by /nix/store/sm14bmd3l61p5m0q7wa5g7rz2bl6azqf-gcc-12.2.0-lib/lib/libgcc_s.so.1)
/nix/store/hpbvrlwd5viqmvcaisb3x0118i913a9n-stderred-0.1.0/bin/stderred: /nix/store/s9qbqh7gzacs7h68b2jfmn9l6q4jwfjz-glibc-2.33-59/lib/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/sm14bmd3l61p5m0q7wa5g7rz2bl6azqf-gcc-12.2.0-lib/lib/libgcc_s.so.1)

Hello, I see that your repl runs on an older “template”, so it has older configuration (which is more prone to errors). (I’m not sure of the specific cause of the problem.)

Therefore, updating the configuration should fix the problem. As a side effect, your repl will use python 3.10 instead of 3.8.

Two ways (both should do the same thing, but one is inplace, other is new repl):


Move everything to a new repl.
Download your repl as zip. Then, upload your code to the new repl, including your pyproject.toml. Type poetry install in the shell to install all the packages. If you get some sort of lib error, then create a replit.nix file and copy it in from your original repl, but delete pkgs.python38Full, PYTHONBIN, and LANG.


Inplace:
Create a new python repl so that you can grab its configuration.
Then, copy in its .replit file into your repl. This should probably fix the shell error.
In your repl, in replit.nix, delete pkgs.python38Full, PYTHONBIN, and LANG.
Delete the venv folder, and type poetry install in the shell.

2 Likes

Could you explain how I would update the configuration of my existing repl inplace so I do not need to make a new one? How would I update python since my shell keeps giving errors?

Do this. Copy the .replit file into your .replit fille.

1 Like


I have changed the replit.nix and copied the contents of a new .replit file.
However I get this error when trying to install poetry.

Ok so apparently that was just a 1 time error.
When I reran it all my packages were gone so I just reinstalled everything with pip in the shell. It works fine now (aside from the missing keys).

Thank you guys so much for the help I really do appreciate it.

1 Like

It was a one time error because, if you notice, it says Detected change in environment, reloading shell... after the error.
You must reload the shell for changes to be applied.
Wait a few seconds after changes, then update/reload by typing in the shell.
Or, just refresh.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.