Dokploy / dokploy

Open Source Alternative to Vercel, Netlify and Heroku.
https://dokploy.com/
Other
9.32k stars 459 forks source link

On redeployment of the project the build fails saying `Error: Docker build failed Error response from daemon: No such container: json-viz-b266dd-4PZEnhCi0y` #634

Closed thatbeautifuldream closed 3 weeks ago

thatbeautifuldream commented 3 weeks ago

To Reproduce

  1. Deploy json-viz (nextjs) app
  2. Redeploy after cetrain commits and merges

Current vs. Expected behavior

Current behaviour is unexpected the docker container name somehow mismatches and errors out and evetually fails the build

Expected behaviour should be a pass and successfull deployment

Initializing deployment
Clonning Repo github.com/thatbeautifuldream/json-visualizer.git to /etc/dokploy/applications/json-viz-b266dd/code: ✅
Cloning into '/etc/dokploy/applications/json-viz-b266dd/code'...
remote: Enumerating objects: 69, done.        
remote: Counting objects:   1% (1/69)        
remote: Counting objects:   2% (2/69)        
remote: Counting objects:   4% (3/69)        
remote: Counting objects:   5% (4/69)        
remote: Counting objects:   7% (5/69)        
remote: Counting objects:   8% (6/69)        
remote: Counting objects:  10% (7/69)        
remote: Counting objects:  11% (8/69)        
remote: Counting objects:  13% (9/69)        
remote: Counting objects:  14% (10/69)        
remote: Counting objects:  15% (11/69)        
remote: Counting objects:  17% (12/69)        
remote: Counting objects:  18% (13/69)        
remote: Counting objects:  20% (14/69)        
remote: Counting objects:  21% (15/69)        
remote: Counting objects:  23% (16/69)        
remote: Counting objects:  24% (17/69)        
remote: Counting objects:  26% (18/69)        
remote: Counting objects:  27% (19/69)        
remote: Counting objects:  28% (20/69)        
remote: Counting objects:  30% (21/69)        
remote: Counting objects:  31% (22/69)        
remote: Counting objects:  33% (23/69)        
remote: Counting objects:  34% (24/69)        
remote: Counting objects:  36% (25/69)        
remote: Counting objects:  37% (26/69)        
remote: Counting objects:  39% (27/69)        
remote: Counting objects:  40% (28/69)        
remote: Counting objects:  42% (29/69)        
remote: Counting objects:  43% (30/69)        
remote: Counting objects:  44% (31/69)        
remote: Counting objects:  46% (32/69)        
remote: Counting objects:  47% (33/69)        
remote: Counting objects:  49% (34/69)        
remote: Counting objects:  50% (35/69)        
remote: Counting objects:  52% (36/69)        
remote: Counting objects:  53% (37/69)        
remote: Counting objects:  55% (38/69)        
remote: Counting objects:  56% (39/69)        
remote: Counting objects:  57% (40/69)        
remote: Counting objects:  59% (41/69)        
remote: Counting objects:  60% (42/69)        
remote: Counting objects:  62% (43/69)        
remote: Counting objects:  63% (44/69)        
remote: Counting objects:  65% (45/69)        
remote: Counting objects:  66% (46/69)        
remote: Counting objects:  68% (47/69)        
remote: Counting objects:  69% (48/69)        
remote: Counting objects:  71% (49/69)        
remote: Counting objects:  72% (50/69)        
remote: Counting objects:  73% (51/69)        
remote: Counting objects:  75% (52/69)        
remote: Counting objects:  76% (53/69)        
remote: Counting objects:  78% (54/69)        
remote: Counting objects:  79% (55/69)        
remote: Counting objects:  81% (56/69)        
remote: Counting objects:  82% (57/69)        
remote: Counting objects:  84% (58/69)        
remote: Counting objects:  85% (59/69)        
remote: Counting objects:  86% (60/69)        
remote: Counting objects:  88% (61/69)        
remote: Counting objects:  89% (62/69)        
remote: Counting objects:  91% (63/69)        
remote: Counting objects:  92% (64/69)        
remote: Counting objects:  94% (65/69)        
remote: Counting objects:  95% (66/69)        
remote: Counting objects:  97% (67/69)        
remote: Counting objects:  98% (68/69)        
remote: Counting objects: 100% (69/69)        
remote: Counting objects: 100% (69/69), done.        
remote: Compressing objects:   1% (1/57)        
remote: Compressing objects:   3% (2/57)        
remote: Compressing objects:   5% (3/57)        
remote: Compressing objects:   7% (4/57)        
remote: Compressing objects:   8% (5/57)        
remote: Compressing objects:  10% (6/57)        
remote: Compressing objects:  12% (7/57)        
remote: Compressing objects:  14% (8/57)        
remote: Compressing objects:  15% (9/57)        
remote: Compressing objects:  17% (10/57)        
remote: Compressing objects:  19% (11/57)        
remote: Compressing objects:  21% (12/57)        
remote: Compressing objects:  22% (13/57)        
remote: Compressing objects:  24% (14/57)        
remote: Compressing objects:  26% (15/57)        
remote: Compressing objects:  28% (16/57)        
remote: Compressing objects:  29% (17/57)        
remote: Compressing objects:  31% (18/57)        
remote: Compressing objects:  33% (19/57)        
remote: Compressing objects:  35% (20/57)        
remote: Compressing objects:  36% (21/57)        
remote: Compressing objects:  38% (22/57)        
remote: Compressing objects:  40% (23/57)        
remote: Compressing objects:  42% (24/57)        
remote: Compressing objects:  43% (25/57)        
remote: Compressing objects:  45% (26/57)        
remote: Compressing objects:  47% (27/57)        
remote: Compressing objects:  49% (28/57)        
remote: Compressing objects:  50% (29/57)        
remote: Compressing objects:  52% (30/57)        
remote: Compressing objects:  54% (31/57)        
remote: Compressing objects:  56% (32/57)        
remote: Compressing objects:  57% (33/57)        
remote: Compressing objects:  59% (34/57)        
remote: Compressing objects:  61% (35/57)        
remote: Compressing objects:  63% (36/57)        
remote: Compressing objects:  64% (37/57)        
remote: Compressing objects:  66% (38/57)        
remote: Compressing objects:  68% (39/57)        
remote: Compressing objects:  70% (40/57)        
remote: Compressing objects:  71% (41/57)        
remote: Compressing objects:  73% (42/57)        
remote: Compressing objects:  75% (43/57)        
remote: Compressing objects:  77% (44/57)        
remote: Compressing objects:  78% (45/57)        
remote: Compressing objects:  80% (46/57)        
remote: Compressing objects:  82% (47/57)        
remote: Compressing objects:  84% (48/57)        
remote: Compressing objects:  85% (49/57)        
remote: Compressing objects:  87% (50/57)        
remote: Compressing objects:  89% (51/57)        
remote: Compressing objects:  91% (52/57)        
remote: Compressing objects:  92% (53/57)        
remote: Compressing objects:  94% (54/57)        
remote: Compressing objects:  96% (55/57)        
remote: Compressing objects:  98% (56/57)        
remote: Compressing objects: 100% (57/57)        
remote: Compressing objects: 100% (57/57), done.        
Receiving objects:   1% (1/69)
Receiving objects:   2% (2/69)
Receiving objects:   4% (3/69)
Receiving objects:   5% (4/69)
Receiving objects:   7% (5/69)
Receiving objects:   8% (6/69)
Receiving objects:  10% (7/69)
Receiving objects:  11% (8/69)
Receiving objects:  13% (9/69)
Receiving objects:  14% (10/69)
Receiving objects:  15% (11/69)
Receiving objects:  17% (12/69)
Receiving objects:  18% (13/69)
Receiving objects:  20% (14/69)
Receiving objects:  21% (15/69)
Receiving objects:  23% (16/69)
Receiving objects:  24% (17/69)
Receiving objects:  26% (18/69)
Receiving objects:  27% (19/69)
remote: Total 69 (delta 1), reused 45 (delta 1), pack-reused 0 (from 0)        
Receiving objects:  28% (20/69)
Receiving objects:  30% (21/69)
Receiving objects:  31% (22/69)
Receiving objects:  33% (23/69)
Receiving objects:  34% (24/69)
Receiving objects:  36% (25/69)
Receiving objects:  37% (26/69)
Receiving objects:  39% (27/69)
Receiving objects:  40% (28/69)
Receiving objects:  42% (29/69)
Receiving objects:  43% (30/69)
Receiving objects:  44% (31/69)
Receiving objects:  46% (32/69)
Receiving objects:  47% (33/69)
Receiving objects:  49% (34/69)
Receiving objects:  50% (35/69)
Receiving objects:  52% (36/69)
Receiving objects:  53% (37/69)
Receiving objects:  55% (38/69)
Receiving objects:  56% (39/69)
Receiving objects:  57% (40/69)
Receiving objects:  59% (41/69)
Receiving objects:  60% (42/69)
Receiving objects:  62% (43/69)
Receiving objects:  63% (44/69)
Receiving objects:  65% (45/69)
Receiving objects:  66% (46/69)
Receiving objects:  68% (47/69)
Receiving objects:  69% (48/69)
Receiving objects:  71% (49/69)
Receiving objects:  72% (50/69)
Receiving objects:  73% (51/69)
Receiving objects:  75% (52/69)
Receiving objects:  76% (53/69)
Receiving objects:  78% (54/69)
Receiving objects:  79% (55/69)
Receiving objects:  81% (56/69)
Receiving objects:  82% (57/69)
Receiving objects:  84% (58/69)
Receiving objects:  85% (59/69)
Receiving objects:  86% (60/69)
Receiving objects:  88% (61/69)
Receiving objects:  89% (62/69)
Receiving objects:  91% (63/69)
Receiving objects:  92% (64/69)
Receiving objects:  94% (65/69)
Receiving objects:  95% (66/69)
Receiving objects:  97% (67/69)
Receiving objects:  98% (68/69)
Receiving objects: 100% (69/69)
Receiving objects: 100% (69/69), 86.57 KiB | 2.28 MiB/s, done.
Resolving deltas:   0% (0/1)
Resolving deltas: 100% (1/1)
Resolving deltas: 100% (1/1), done.

Cloned github.com/thatbeautifuldream/json-visualizer.git: ✅

Build nixpacks: ✅
Source Type: github: ✅

╔═════════════ Nixpacks v1.29.0 ════════════╗
║ setup      │ nodejs_18, pnpm-9_x, openssl ║
║───────────────────────────────────────────║
║ install    │ pnpm i --frozen-lockfile     ║
║───────────────────────────────────────────║
║ build      │ pnpm run build               ║
║───────────────────────────────────────────║
║ start      │ pnpm run start               ║
╚═══════════════════════════════════════════╝

#0 building with "default" instance using docker driver

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 1.15kB done
#1 DONE 0.0s

#2 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1727136237
#2 DONE 0.4s

#3 [internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s

#4 [stage-0  1/10] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1727136237@sha256:72cd12021740b1c4100a5c53c3b22974dacb86e4b0a35fcdd12605339de25b86
#4 DONE 0.0s

#5 [internal] load build context
#5 transferring context: 398.32kB 0.0s done
#5 DONE 0.0s

#6 [stage-0  2/10] WORKDIR /app/
#6 CACHED

#7 [stage-0  3/10] COPY .nixpacks/nixpkgs-e05605ec414618eab4a7a6aea8b38f6fbbcc8f08.nix .nixpacks/nixpkgs-e05605ec414618eab4a7a6aea8b38f6fbbcc8f08.nix
#7 CACHED

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

#9 [stage-0  5/10] COPY . /app/.
#9 DONE 0.0s

#10 [stage-0  6/10] RUN --mount=type=cache,id=8lAbDZqlB0Y-/root/local/share/pnpm/store/v3,target=/root/.local/share/pnpm/store/v3 pnpm i --frozen-lockfile
#10 0.871 Lockfile is up to date, resolution step is skipped
#10 0.955 Progress: resolved 1, reused 0, downloaded 0, added 0
#10 1.093 Packages: +496
#10 1.093 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#10 1.957 Progress: resolved 496, reused 496, downloaded 0, added 23
#10 2.957 Progress: resolved 496, reused 496, downloaded 0, added 133
#10 3.957 Progress: resolved 496, reused 496, downloaded 0, added 189
#10 4.957 Progress: resolved 496, reused 496, downloaded 0, added 407
#10 5.424 Progress: resolved 496, reused 496, downloaded 0, added 496, done
#10 5.827 
#10 5.827 dependencies:
#10 5.827 + @prisma/client 5.21.1
#10 5.827 + @radix-ui/react-dialog 1.1.1
#10 5.827 + @radix-ui/react-dropdown-menu 2.1.2
#10 5.827 + @radix-ui/react-icons 1.3.0
#10 5.827 + @radix-ui/react-label 2.1.0
#10 5.827 + @radix-ui/react-scroll-area 1.2.0
#10 5.827 + @radix-ui/react-slot 1.1.0
#10 5.827 + @radix-ui/react-tabs 1.1.0
#10 5.827 + @radix-ui/react-toast 1.2.2
#10 5.827 + @redheadphone/react-json-grid 0.7.0
#10 5.827 + @t3-oss/env-nextjs 0.11.1
#10 5.827 + @tanstack/react-query 5.59.0
#10 5.827 + class-variance-authority 0.7.0
#10 5.827 + clsx 2.1.1
#10 5.827 + lucide-react 0.446.0
#10 5.827 + next 14.2.13
#10 5.827 + next-themes 0.3.0
#10 5.827 + nuqs 1.19.3
#10 5.827 + openai 4.67.1
#10 5.827 + react 18.3.1
#10 5.827 + react-dom 18.3.1
#10 5.827 + react-json-view 1.21.3
#10 5.827 + react-syntax-highlighter 15.5.0
#10 5.827 + sonner 1.5.0
#10 5.827 + tailwind-merge 2.5.2
#10 5.827 + tailwindcss-animate 1.0.7
#10 5.827 + zod 3.23.8
#10 5.827 + zustand 5.0.0-rc.2
#10 5.827 
#10 5.827 devDependencies:
#10 5.827 + @types/node 20.16.10
#10 5.827 + @types/react 18.3.10
#10 5.827 + @types/react-dom 18.3.0
#10 5.827 + @types/react-syntax-highlighter 15.5.13
#10 5.827 + eslint 8.57.1
#10 5.827 + eslint-config-next 14.2.13
#10 5.827 + postcss 8.4.47
#10 5.827 + prisma 5.21.1
#10 5.827 + tailwindcss 3.4.13
#10 5.827 + typescript 5.6.2
#10 5.827 
#10 5.862 Done in 5.6s
#10 DONE 6.2s

#11 [stage-0  7/10] COPY . /app/.
#11 DONE 0.0s

#12 [stage-0  8/10] RUN --mount=type=cache,id=8lAbDZqlB0Y-next/cache,target=/app/.next/cache --mount=type=cache,id=8lAbDZqlB0Y-node_modules/cache,target=/app/node_modules/.cache pnpm run build
#12 0.782 
#12 0.782 > json-visualizer@0.1.0 build /app
#12 0.782 > next build
#12 0.782 
#12 1.795   ▲ Next.js 14.2.13
#12 1.796 
#12 1.879    Creating an optimized production build ...
#12 11.09  ⚠ Compiled with warnings
#12 11.09 
#12 11.09 ./src/components/json-explanation.tsx
#12 11.09 Attempted import error: 'a11yLight' is not exported from 'react-syntax-highlighter/dist/cjs/styles/prism' (imported as 'a11yLight').
#12 11.09 
#12 11.09 Import trace for requested module:
#12 11.09 ./src/components/json-explanation.tsx
#12 11.09 ./src/components/json-visualizer.tsx
#12 11.09 
#12 22.13  ⚠ Compiled with warnings
#12 22.13 
#12 22.13 ./src/components/json-explanation.tsx
#12 22.13 Attempted import error: 'a11yLight' is not exported from 'react-syntax-highlighter/dist/cjs/styles/prism' (imported as 'a11yLight').
#12 22.13 
#12 22.13 Import trace for requested module:
#12 22.13 ./src/components/json-explanation.tsx
#12 22.13 ./src/components/json-visualizer.tsx
#12 22.13 
#12 22.33  ✓ Compiled successfully
#12 22.33    Linting and checking validity of types ...
#12 27.01 
#12 27.01 ./src/components/json-explanation.tsx
#12 27.01 42:6  Warning: React Hook useEffect has a missing dependency: 'explainJsonMutation'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
#12 27.01 48:6  Warning: React Hook useEffect has a missing dependency: 'explainJsonMutation?.data?.data'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
#12 27.01 
#12 27.01 info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
#12 29.52 Failed to compile.
#12 29.52 
#12 29.52 ./src/server/db.ts:1:10
#12 29.52 Type error: Module '"@prisma/client"' has no exported member 'PrismaClient'.
#12 29.52 
#12 29.52 > 1 | import { PrismaClient } from "@prisma/client";
#12 29.52     |          ^
#12 29.52   2 |
#12 29.52   3 | import { env } from "@/env";
#12 29.52   4 |
#12 29.60  ELIFECYCLE  Command failed with exit code 1.
#12 ERROR: process "/bin/bash -ol pipefail -c pnpm run build" did not complete successfully: exit code: 1
------
 > [stage-0  8/10] RUN --mount=type=cache,id=8lAbDZqlB0Y-next/cache,target=/app/.next/cache --mount=type=cache,id=8lAbDZqlB0Y-node_modules/cache,target=/app/node_modules/.cache pnpm run build:
29.52 
29.52 ./src/server/db.ts:1:10
29.52 Type error: Module '"@prisma/client"' has no exported member 'PrismaClient'.
29.52 
29.52 > 1 | import { PrismaClient } from "@prisma/client";
29.52     |          ^
29.52   2 |
29.52   3 | import { env } from "@/env";
29.52   4 |
29.60  ELIFECYCLE  Command failed with exit code 1.
------

 1 warning found (use docker --debug to expand):
 - UndefinedVar: Usage of undefined variable '$NIXPACKS_PATH' (line 18)
Dockerfile:24
--------------------
  22 |     # build phase
  23 |     COPY . /app/.
  24 | >>> RUN --mount=type=cache,id=8lAbDZqlB0Y-next/cache,target=/app/.next/cache --mount=type=cache,id=8lAbDZqlB0Y-node_modules/cache,target=/app/node_modules/.cache pnpm run build
  25 |     
  26 |     
--------------------
ERROR: failed to solve: process "/bin/bash -ol pipefail -c pnpm run build" did not complete successfully: exit code: 1
Error: Docker build failed
Error response from daemon: No such container: json-viz-b266dd-4PZEnhCi0y
Error ❌
Error response from daemon: No such container: json-viz-b266dd-4PZEnhCi0y

Provide environment information

.-/+oossssoo+/-.               root@milind-server 
        `:+ssssssssssssssssss+:`           ------------------ 
      -+ssssssssssssssssssyyssss+-         OS: Ubuntu 24.04.1 LTS aarch64 
    .ossssssssssssssssssdMMMNysssso.       Host: vServer 20171111 
   /ssssssssssshdmmNNmmyNMMMMhssssss/      Kernel: 6.8.0-45-generic 
  +ssssssssshmydMMMMMMMNddddyssssssss+     Uptime: 17 days, 20 hours, 23 mins 
 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    Packages: 686 (dpkg) 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Shell: bash 5.2.21 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   Resolution: 1280x800 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   Terminal: node 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   CPU: (4) 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   GPU: 00:01.0 Red Hat, Inc. Virtio 1.0 GPU 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Memory: 1335MiB / 7729MiB 
 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/
  +sssssssssdmydMMMMMMMMddddyssssssss+                             
   /ssssssssssshdmNNNNmyNMMMMhssssss/                              
    .ossssssssssssssssssdMMMNysssso.
      -+sssssssssssssssssyyyssss+-
        `:+ssssssssssssssssss+:`
            .-/+oossssoo+/-.

Which area(s) are affected? (Select all that apply)

Docker

Additional context

I tested on a Hetzner server all details about my box are provided above.

Siumauricio commented 3 weeks ago

Hey, this is not a bug, is a bug with the dependencies of your project or something missing in the scripts looks like you didn't generate the prisma generate maybe

Check the error very well please,

Type error: Module '"@prisma/client"' has no exported member 'PrismaClient'. https://github.com/prisma/prisma/issues/13946

thatbeautifuldream commented 3 weeks ago
image

thanks for pointing out that was the mistake, closing the issue.