#Docker Error

31 messages · Page 1 of 1 (latest)

terse violet
#

I have deployed successfully the db and the backend, but when I try to deploy the frontend I get this Docker Error (but I'm not using Docker at all!).

#

Project ID: 8add81a6-d2c1-455c-a490-af71cc8e3373

dark fox
#

what doe your build logs look like

#

nixpacks builds a docker image, so your using docker by extension

wraith flame
#

@terse violet

#

Please share all the logs

loud iron
wraith flame
wraith flame
#

that is completely different

loud iron
#

I deleted the composer.log but it still does not work.

rough kiln
#

@dark fox facing same issue guys

wraith flame
#

and share your logs

terse violet
#

I shared the ID above ☝️

undone plume
terse violet
#

==============
Using Nixpacks

╔═════════ Nixpacks v0.14.0 ════════╗
║ setup │ nodejs-16_x, npm-8_x ║
║───────────────────────────────────║
║ install │ npm ci ║
║───────────────────────────────────║
║ build │ npm run build ║
║───────────────────────────────────║
║ start │ npm start ║
╚═══════════════════════════════════╝

#1 [internal] load build definition from Dockerfile
#1 sha256:a51fef6f876b2ab4539f8983199540d65dfec561cd8771712809ca6cadcfe390
#1 transferring dockerfile: 2.39kB done
#1 DONE 0.1s

#2 [internal] load .dockerignore
#2 sha256:c764c4591946ce6ce44d69fbf40ebd0b823bb1dcee46961d6ef6faba41cdae35
#2 transferring context: 2B done

#2 DONE 0.2s

#3 [internal] load metadata for ghcr.io/railwayapp/nixpacks:debian-1667866002
#3 sha256:ff4546c29b1eb585dd7df95164933728a568cb8dc35398f9f51f11afd8b9a1cb

#3 DONE 0.3s

#4 [stage-0 1/10] FROM ghcr.io/railwayapp/nixpacks:debian-1667866002@sha256:96bc6d9c576900c9a99db8f7c8d6ef86c9e8dd9e54f46a119ff8499b9f5fe3b0

#4 sha256:a6aa9f4410ef5777e49afa17be8a1e260d09acb8a74de2dab233288bf3c56052
#4 DONE 0.0s

#5 [stage-0 2/10] WORKDIR /app/
#5 sha256:f1ff5906bd390875dc0cc6c2f06540658835071f9bb0611cd6ce76c903f39537
#5 CACHED

#6 [internal] load build context
#6 sha256:4b124e9cca8bb3fd99476d6511244ae15607e4d4e613537c1067c0d24b2c7b00
#6 transferring context: 9.60MB 0.1s done

#

#6 DONE 0.2s

#7 [stage-0 3/10] COPY .nixpacks/nixpkgs-a0b7e70db7a55088d3de0cc370a59f9fbcc906c3.nix .nixpacks/nixpkgs-a0b7e70db7a55088d3de0cc370a59f9fbcc906c3.nix
#7 sha256:5ae4eb667b622cdad0889888e4258714cf4ed47eb1a14251e70dd406c92c4158
#7 CACHED

#8 [stage-0 4/10] RUN nix-env -if .nixpacks/nixpkgs-a0b7e70db7a55088d3de0cc370a59f9fbcc906c3.nix && nix-collect-garbage -d
#8 sha256:4e09252039017e78dfa231d8a35ec7e934760e73e1210d9e52b72e8bd592b150
#8 CACHED

#9 [stage-0 5/10] RUN printf '\nPATH=/app/node_modules/.bin:$PATH' >> /root/.profile
#9 sha256:61f4f8590ed0b1644f89aae038274de50e0acd5ee4938dca52c9f6ba77da0b01

#9 DONE 0.5s

#10 [stage-0 6/10] COPY . /app/
#10 sha256:90291133881e4364ce462ef7d835b78f71b5e5c2cbe7c349b22784fd7144f9b1

#

#10 DONE 0.2s

#11 [stage-0 7/10] RUN --mount=type=cache,id=s/95735ee5-98bc-4da0-9da9-7ab9d5f69392-/root/npm,target=/root/.npm npm ci
#11 sha256:9b0d0c2f7df6ff15f1679707e8a1f1cd7e12a31980367530e0d89673e90a9f58

#11 0.988 npm
WARN config production Use --omit=dev instead.

#11 2.601 npm ERR! code EUSAGE

#11 2.605 npm ERR!
#11 2.605 npm ERR! npm ci can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with npm install before continuing.
#11 2.605 npm ERR!
#11 2.605 npm ERR! Invalid: lock file's [email protected] does not satisfy [email protected]
#11 2.605 npm ERR! Missing: [email protected] from lock file
#11 2.605 npm ERR!
#11 2.605 npm ERR! Clean install a project
#11 2.605 npm ERR!
#11 2.605 npm ERR! Usage:
#11 2.605 npm ERR! npm ci
#11 2.605 npm ERR!
#11 2.605 npm ERR! Options:
#11 2.606 npm ERR! [--no-audit] [--foreground-scripts] [--ignore-scripts]
#11 2.606 npm ERR! [--script-shell <script-shell>]
#11 2.606 npm ERR!
#11 2.606 npm ERR! aliases: clean-install, ic, install-clean, isntall-clean
#11 2.606 npm ERR!
#11 2.606 npm ERR! Run "npm help ci" for more info

#11 2.608
#11 2.608 npm ERR! A complete log of this run can be found in:
#11 2.608 npm ERR! /root/.npm/_logs/2022-11-15T14_22_18_902Z-debug-0.log
#11 ERROR: executor failed running [/bin/bash -ol pipefail -c npm ci]: exit code: 1

[stage-0 7/10] RUN --mount=type=cache,id=s/95735ee5-98bc-4da0-9da9-7ab9d5f69392-/root/npm,target=/root/.npm npm ci:


executor failed running [/bin/bash -ol pipefail -c npm ci]: exit code: 1

Error: Docker build failed

undone plume
#

execute this in your dev environment - rm package-lock.json && npm i

#

Your lockfile isn't in sync with your package.json.

terse violet
#

Same error 😔

terse violet
#

I did it!!

#

I was able to solve it finally!

undone plume
#

yay!

terse violet
#

I share the solution: 😉 👇

#

(This message in StackOverflow helped me)

I re-ran the "npm install" operation with "silly" loglevel and saw that multiple versions of type-fest were installed as dependencies:

6817 silly audit 'type-fest': [ '0.21.3', '0.8.1', '0.6.0', '0.3.1', '0.20.2' ],
However, version 0.13.1 was NOT installed. This version is listed as a peer dependency of the "React Refresh Webpack Plugin" (@pmmmwh/react-refresh-webpack-plugin). In my case, I solved this problem by explicitly adding

"type-fest": "^0.13.1"
as a dependency of my package. Maybe not the best way to solve it, but I've spent too much time trying to get this straightened out already.

#

After that I executed rm package-lock.json && npm i as said before... and voilá! The deploy worked successfully...

terse violet
#

Sorry for the messages, but I found a better and ideal solution! 😎 👇

#

(Also in StackOverflow)

None of the previous answers mention it, but adding a dependency of your dependency is NOT a correct way to solve those kinds of issues.

Update your local installation of NPM to a version greater than 8.6.0. Then run npm i and commit and push relevant package-lock.json.

There was a bug in npm's dependency resolvement algorithm which was not obvious at the time and because of it older versions of npm would not include type-fest^0.13.1 in package-lock.json.

In versions before 8.6.0 npm would blindly install whatever was mentioned in package-lock.json. Starting from 8.6.0 npm now checks the package-lock.json for all peer dependencies.

Because of this, many people using the latest npm version in their CI environments would get errors saying that package.json and package-lock.json are not in sync.