coollabsio / coolify

An open-source & self-hostable Heroku / Netlify / Vercel alternative.
https://coolify.io
Apache License 2.0
34.65k stars 1.89k forks source link

[Bug]: can't deploy nixpack #3981

Open luckydonald opened 1 month ago

luckydonald commented 1 month ago

Error Message and Logs

Building docker image started.
To check the current progress, click on Show Debug Logs.
Oops something is not okay, are you okay? 😢
#0 building with "default" instance using docker driver
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 1.18kB 0.0s done
#1 DONE 0.0s
#2 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1725321821
#2 DONE 0.5s
#3 [internal] load .dockerignore
#3 transferring context: 302B done
#3 DONE 0.0s
#4 [internal] load build context
#4 transferring context: 2.85kB done
#4 DONE 0.0s
#5 [stage-0  2/11] WORKDIR /app/
#5 CACHED
#6 [stage-0  3/11] COPY .nixpacks/nixpkgs-e05605ec414618eab4a7a6aea8b38f6fbbcc8f08.nix .nixpacks/nixpkgs-e05605ec414618eab4a7a6aea8b38f6fbbcc8f08.nix
#6 ERROR: failed to calculate checksum of ref 400f7f63-7e9a-4baa-96e4-37415a6329aa::vr448e72djkm4407e1bwmh2pm: "/.nixpacks/nixpkgs-e05605ec414618eab4a7a6aea8b38f6fbbcc8f08.nix": not found
#7 [stage-0  1/11] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1725321821@sha256:0cec4cb236c32e6bc58b896fff852f629a7abad4e4f059840d96f0869b4be2fd
#7 resolve ghcr.io/railwayapp/nixpacks:ubuntu-1725321821@sha256:0cec4cb236c32e6bc58b896fff852f629a7abad4e4f059840d96f0869b4be2fd 0.0s done
#7 sha256:0cec4cb236c32e6bc58b896fff852f629a7abad4e4f059840d96f0869b4be2fd 1.61kB / 1.61kB done
#7 CANCELED
------
 > [stage-0  3/11] COPY .nixpacks/nixpkgs-e05605ec414618eab4a7a6aea8b38f6fbbcc8f08.nix .nixpacks/nixpkgs-e05605ec414618eab4a7a6aea8b38f6fbbcc8f08.nix:
------
 2 warnings found (use --debug to expand):
 - UndefinedVar: Usage of undefined variable '$NIXPACKS_PATH' (line 18)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 18)
Dockerfile:7
--------------------
   5 |     
   6 |     
   7 | >>> COPY .nixpacks/nixpkgs-e05605ec414618eab4a7a6aea8b38f6fbbcc8f08.nix .nixpacks/nixpkgs-e05605ec414618eab4a7a6aea8b38f6fbbcc8f08.nix
   8 |     RUN nix-env -if .nixpacks/nixpkgs-e05605ec414618eab4a7a6aea8b38f6fbbcc8f08.nix && nix-collect-garbage -d
   9 |     RUN sudo apt-get update && sudo apt-get install -y --no-install-recommends curl wget
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 400f7f63-7e9a-4baa-96e4-37415a6329aa::vr448e72djkm4407e1bwmh2pm: "/.nixpacks/nixpkgs-e05605ec414618eab4a7a6aea8b38f6fbbcc8f08.nix": not found
Deployment failed. Removing the new version of your application.

Steps to Reproduce

  1. use an vue project (in a private repo)
  2. use nix pack
  3. doesn't matter if set to static build
  4. hit deploy

Example Repository URL

No response

Coolify Version

https://github.com/coollabsio/coolify/releases/tag/v4.0.0-beta.360

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

Same as #3915

Additional Information

No response

neat-monte commented 3 weeks ago

I have exactly the same issue when deploying on production environment that is on a separate server. It deploys without any issue on the coolify localhost for my development environment. I tried adding the explicit package manager version to package.json like it said here, but it unfortunately did not work.

dludemann commented 3 weeks ago

Same thing happens to me with nextjs build in coolify cloud..

devtimberg commented 3 weeks ago

On my remote server, the first build goes through successfully, but the second build gives an error:

“next": “15.0.2”

#8 CACHED
#9 [stage-0  5/11] RUN sudo apt-get update && sudo apt-get install -y --no-install-recommends curl wget
#9 CACHED
#10 [stage-0  6/11] COPY . /app/.
#10 DONE 0.0s
#11 [stage-0  7/11] RUN --mount=type=cache,id=uwokcgkw8k0k4o80gk8w8wsk-/root/npm,target=/root/.npm npm ci
#11 ERROR: process "/bin/bash -ol pipefail -c npm ci" did not complete successfully: exit code: 137
------
 > [stage-0  7/11] RUN --mount=type=cache,id=uwokcgkw8k0k4o80gk8w8wsk-/root/npm,target=/root/.npm npm ci:
------
 2 warnings found (use --debug to expand):
 - UndefinedVar: Usage of undefined variable '$NIXPACKS_PATH' (line 18)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 18)
Dockerfile:20
--------------------
  18 |     ENV NIXPACKS_PATH /app/node_modules/.bin:$NIXPACKS_PATH
  19 |     COPY . /app/.
  20 | >>> RUN --mount=type=cache,id=uwokcgkw8k0k4o80gk8w8wsk-/root/npm,target=/root/.npm npm ci
  21 |     
  22 |     # build phase
--------------------
ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm ci" did not complete successfully: exit code: 137
Deployment failed. Removing the new version of your application.
cyjme commented 2 weeks ago

Check your packageManager in package.json, In my case, I have to change it from 8.x.xto 9.x.x "packageManager": "pnpm@version"

sijad commented 5 days ago

same issue on a brand new server with coolify

peaklabs-dev commented 1 day ago

Can anyone who can reproduce this problem please provide me with a sample repository so I can investigate this further.