Deployment failure due to python version

smooth-devHOBBY

a year ago

Hello ,
Am using the platform to deploy a react/node app, the deployments worked fine , until today i get error from nix apparently its a dependency version incompatibility.

When i filter logs i get this in regards to the python version:

[Begin logs]
copying path '/nix/store/ffll6glz3gwx342z0ch8wx30p5cnqz1z-python3-3.11.5' from 'https://cache.nixos.org';…

8 33.26 Node.js configure: Found Python 3.11.5…

8 33.26 Please use python3.10 or python3.9 or python3.8 or python3.7 or python3.6 or python3.5 or python2.7.

[End logs]

I don't know how to fix this do i have to add some arguments to the "railway.json" config file ?

Any suggestion would be appreciated.

Solved

9 Replies

a year ago

What does the top of the build logs look like?


smooth-devHOBBY

a year ago

Its look likes its installing nix packages and librairies and then the error appears at the end :
in previous deployments it used to install python 3.10

Logs:
33.26 Node.js configure: Found Python 3.11.5…

33.26 Please use python3.10 or python3.9 or python3.8 or python3.7 or python3.6 or python3.5 or python2.7.

33.94 error: builder for '/nix/store/hh8n2lf9hxvjrp2rgp6542acrcyg153i-nodejs-14.21.3.drv' failed with exit code 1

33.97 error: 1 dependencies of derivation '/nix/store/vnwd0sjcl38vbnm0kbw73p85hhb4pz85-bf744fe90419885eefced41b3e5ae442d732712d-env.drv' failed to build
6 |

7 | COPY .nixpacks/nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix .nixpacks/nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix

8 | >>> RUN nix-env -if .nixpacks/nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix && nix-collect-garbage -d

9 |

10 |

ERROR: failed to solve: process "/bin/bash -ol pipefail -c nix-env -if .nixpacks/nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix && nix-collect-garbage -d" did not complete successfully: exit code: 100

Error: Docker build failed


a year ago

What does the top of the logs look like? Where it shows the Nixpacks and NodeJS versions


a year ago

Ah I see, the error is when trying to compile NodeJS 14. It is highly recommended to upgrade NodeJS versions as v14 has been end of life for a few months.

Alternatively, you can explicitly specify Python 3.10 with a nixpacks.toml file

[phases.setup]
pkgs = ["...", "python310"]

Status changed to Solved railway[bot] over 1 year ago


smooth-devHOBBY

a year ago

I think am still missing something i should adjust the railway.toml file right ? I tried but i guess my syntax is wrong :

TOML

[build]
builder = "NIXPACKS"
buildCommand = "npm install && npm run heroku-postbuild"
nixpacksPlan = {"providers":["node"]}

[deploy]
numReplicas = 1
startCommand = "npm run dev"
sleepApplication = false
restartPolicyType = "ON_FAILURE"
restartPolicyMaxRetries = 10

[build]
builder = "NIXPACKS"
buildCommand = "npm install && npm run heroku-postbuild"
nixpacksPlan = { providers = ["node"]}

[deploy]
numReplicas = 1
startCommand = "npm run dev"
sleepApplication = false
restartPolicyType = "ON_FAILURE"
restartPolicyMaxRetries = 10

[setup]
pkgs = ["…", "python310"]


a year ago

You do not need to update the railway.toml file at all. We are releasing a fix to Nixpacks that will enable you to use Node 14 without any modification. https://github.com/railwayapp/nixpacks/pull/1012


a year ago

Actually @Yaz, can you try downgrading the version of Nixpacks that you build with. This should go in railway.toml

# railway.toml
nixpacksVersion = "1.17.0"

smooth-devHOBBY

a year ago

Hello, the problem is fixed either by downgrading Nixpacks version like you indicated or upgrading Node version,
Thank you for your help .


vitorregisrrHOBBY

a year ago

Actually @Yaz, can you try downgrading the version of Nixpacks that you build with. This should go in railway.toml

# railway.toml
nixpacksVersion = "1.17.0"

Hello guys.

Today, i tried to use this code and it didn't work.

So, searching in the docs i found that the right way to set nixpacksVersion is inside the category [setup].

You can see it in https://docs.railway.app/reference/config-as-code#configurable-settings.

The right way to set nixpacksVersion is:

As .toml file:

[build]
nixpacksVersion = "1.13.0"

Or as .json file:

{
  "build": {
    "nixpacksVersion": "1.17.0"
  }
}

You need to put nixpacksVersions inside "build" object.

Doing that, it should work.

Thank you ;)


Deployment failure due to python version - Railway Help Station