Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My program consistently gets stuck in the "Running" state during deployment. #235

Closed
revealGJW opened this issue Jul 20, 2024 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@revealGJW
Copy link

revealGJW commented Jul 20, 2024

To Reproduce

Create an application with GitHub provider
Use the default Nixpacks build type.
Click deploy.

Current vs. Expected behavior

Error that occurs:
There's a chance that the deployment will remain stuck in the "Running" state indefinitely. After a few minutes, a new deployment will automatically start. This new deployment may also get stuck in the "Running" state. At this point, the service cannot be redeployed.

image
image

the part of running deploy's log:
Build nixpacks: ✅
Source Type: github: ✅

╔════════════ Nixpacks v1.24.4 ════════════╗
║ setup │ nodejs_18, npm-9_x, openssl ║
║──────────────────────────────────────────║
║ install │ npm ci ║
║──────────────────────────────────────────║
║ build │ npm run build ║
║──────────────────────────────────────────║
║ start │ npm run start ║
╚══════════════════════════════════════════╝

#0 building with "default" instance using docker driver

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

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

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

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

#5 [internal] load build context
#5 transferring context: 57.05MB 1.7s done
#5 DONE 1.7s

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

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

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

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

#10 [stage-0 6/10] RUN --mount=type=cache,id=3HhZI4Z6qM-/root/npm,target=/root/.npm npm ci
#10 1.379 npm WARN config production Use --omit=dev instead.
#10 25.55 npm WARN deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
#10 26.70 npm WARN deprecated @humanwhocodes/[email protected]: Use @eslint/config-array instead
#10 26.79 npm WARN deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
#10 27.45 npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
#10 28.12 npm WARN deprecated @humanwhocodes/[email protected]: Use @eslint/object-schema instead
#10 28.20 npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
#10 28.20 npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
#10 28.20 npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
#10 28.20 npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
#10 28.21 npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
#10 29.16 npm WARN deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead
#10 29.60 npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.

Provide environment information

OS:Debian-12.0_x64 2C4G
dokploy version:Version: v0.3.1

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

Application

Additional context

No response

@revealGJW revealGJW added the bug Something isn't working label Jul 20, 2024
@Siumauricio
Copy link
Contributor

Hi @revealGJW, Quesions

  1. What VPS Provider are you using?
  2. What are the specs of the machine?
  3. Have you had VPS freezes?

@revealGJW
Copy link
Author

  1. The VPS provider I'm using is based in Hong Kong.
  2. As for the specs of my machine, it has 2 CPUs, 4GB of RAM, and 30GB SSD storage.
  3. Regarding VPS freezes, I have indeed experienced instances where the VPS becomes unresponsive, particularly during build processes. During these times, the CPU utilization reaches 100%.

Here is some VPS metrics:
CPU:
image

Disk IO:
image

Memory available:
image

Network (Color Green is Input):
image

@Siumauricio
Copy link
Contributor

I understand, unfortunately this is not an issue that we handle because there can be many reasons.

  1. If Your provider does not provide you with an optimized VPS which can cause it to be slow.
  2. Builders like nixpacks consume a lot of ram just to build the project, although even docker building a project consumes a lot of ram.
  3. According to the graph it seems to indicate that dokploy is really optimized, so this problem is due to the 2 reasons I mentioned above.

What I would suggest you to avoid these problems, because really running the applications is not the heavy task, the heavy thing is to build the project, an alternative that I would give you would be to build your project in a CI/CD from github and push to a registry and in dokploy you can use that registry to simply download it and run it and you avoid to be building the project in the VPS, or another solution could be increase your resources to avoid this issue.

@Siumauricio
Copy link
Contributor

Duplicate #85

@Siumauricio Siumauricio closed this as not planned Won't fix, can't repro, duplicate, stale Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants