9 months ago
Hello,
I’m encountering an issue while trying to rebuild my project in Railway. About three months ago, I uploaded the project without any problems. Recently, I only added a single line of code, but when I tried to upload it again, I got the following error:
5 DONE 0.3s
6 [stage-0 2/8] WORKDIR /app/
6 CACHED
7 [stage-0 3/8] COPY .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix
7 DONE 0.0s
8 [stage-0 4/8] RUN nix-env -if .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix && nix-collect-garbage -d
8 0.182 unpacking 'https://github.com/NixOS/nixpkgs/archive/5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.tar.gz'; into the Git cache…
8 23.29 installing '5148520bfab61f99fd25fb9ff7bfbb50dad3c9db-env'
8 23.47 error:
8 23.47 … while calling the 'derivationStrict' builtin
8 23.47 at :34:12:
8 23.47 33|
8 23.47 34| strict = derivationStrict drvAttrs;
8 23.47 | ^
8 23.47 35|
8 23.47
8 23.47 … while evaluating derivation '5148520bfab61f99fd25fb9ff7bfbb50dad3c9db-env'
8 23.47 whose name attribute is located at /nix/store/lgcjj6s23v2203zyihsd0j26wh1saj0c-source/pkgs/stdenv/generic/make-derivation.nix:300:7
8 23.47
8 23.47 … while evaluating attribute 'passAsFile' of derivation '5148520bfab61f99fd25fb9ff7bfbb50dad3c9db-env'
8 23.47 at /nix/store/lgcjj6s23v2203zyihsd0j26wh1saj0c-source/pkgs/build-support/trivial-builders/default.nix:88:7:
8 23.47 87| inherit buildCommand name;
8 23.47 88| passAsFile = [ "buildCommand" ]
8 23.47 | ^
8 23.47 89| ++ (derivationArgs.passAsFile or []);
8 23.47
8 23.47 (stack trace truncated; use '--show-trace' to show the full, detailed trace)
8 23.47
8 23.47 error: attribute 'dev' missing
8 23.47 at /app/.nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix:19:13:
8 23.47 18| '')
8 23.47 19| gcc postgresql_16.dev python38
8 23.47 | ^
8 23.47 20| ];
8 23.47 Did you mean doc?
8 ERROR: process "/bin/bash -ol pipefail -c nix-env -if .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix && nix-collect-garbage -d" did not complete successfully: exit code: 1
I haven’t made any significant changes, other than this one line. I’ve tried searching for solutions but haven’t found anything that fixes the issue. Can anyone advise on what steps I need to take to resolve this error?
Thank you for your help!
> ⓘ Deployment information is only viewable by project members and Railway employees.
4 Replies
9 months ago
Try this steps. Its helps me to slve my problem. I think, configuration changed. I also haven’t done deployments for about a month.
In the root directory of your project, create a file named
nixpacks.toml
. This file allows you to specify custom dependencies for Nixpacks.Add the Correct Dependencies
Add the following configuration to yournixpacks.toml
file:[phases.setup] nixPkgs = ["gcc", "postgresql_16", "python39"]
Note! - These parameters apply to my project. You may have others
gcc
: Ensures the availability of a C compiler for building dependencies.postgresql_16
: Installs the correct version of PostgreSQL. (My version is 16, so the result ispostgresql_16
)python39
: Installs Python <version> for your project. (My version is 3.9, so the result ispython39
)
arthur488
Try this steps. Its helps me to slve my problem. I think, configuration changed. I also haven’t done deployments for about a month.In the root directory of your project, create a file named nixpacks.toml. This file allows you to specify custom dependencies for Nixpacks.Add the Correct DependenciesAdd the following configuration to your nixpacks.toml file:[phases.setup] nixPkgs = ["gcc", "postgresql_16", "python39"]Note! - These parameters apply to my project. You may have othersgcc: Ensures the availability of a C compiler for building dependencies.postgresql_16: Installs the correct version of PostgreSQL. (My version is 16, so the result is postgresql_16)python39: Installs Python <version> for your project. (My version is 3.9, so the result is python39)
9 months ago
it works bro thank you
arthur488
Try this steps. Its helps me to slve my problem. I think, configuration changed. I also haven’t done deployments for about a month.In the root directory of your project, create a file named nixpacks.toml. This file allows you to specify custom dependencies for Nixpacks.Add the Correct DependenciesAdd the following configuration to your nixpacks.toml file:[phases.setup] nixPkgs = ["gcc", "postgresql_16", "python39"]Note! - These parameters apply to my project. You may have othersgcc: Ensures the availability of a C compiler for building dependencies.postgresql_16: Installs the correct version of PostgreSQL. (My version is 16, so the result is postgresql_16)python39: Installs Python <version> for your project. (My version is 3.9, so the result is python39)
9 months ago
The Error I Got
Nixpacks build failed
Jan 21 02:26:49
Jan 21 02:26:49
Error: Failed to parse Nixpacks config file nixpacks.toml
Jan 21 02:26:49
Jan 21 02:26:49
Caused by:
Jan 21 02:26:49
expected newline, found an identifier at line 1 column 16
Jan 21 02:26:49