Question

Deployment is always in a building state

Hey! I’ve been trying to deploy an app with the App Platform but the status always keeps building without throwing any errors on the logs. In another DO account (where I am the owner), I deployed the same app in a couple of minutes. In the project where I don’t pass the building phase, I have a member role, I am not sure if it could be causing the problems. Has someone had this issue before?

Logs:

[slack-bot] [2023-06-07 20:42:58] ╭──────────── git repo clone ───────────╼
[slack-bot] [2023-06-07 20:42:58] │  › fetching app source code
[slack-bot] [2023-06-07 20:42:58] │ => Selecting branch "main"
[slack-bot] [2023-06-07 20:42:58] │ => Checking out commit "857fabed71134e26f46098d0f460c42a6566627a"
[slack-bot] [2023-06-07 20:42:58] │ 
[slack-bot] [2023-06-07 20:42:58] │  ✔ cloned repo to /workspace
[slack-bot] [2023-06-07 20:42:58] ╰────────────────────────────────────────╼
[slack-bot] [2023-06-07 20:42:58] 
[slack-bot] [2023-06-07 20:42:58]  › configuring build-time app environment variables:
[slack-bot] [2023-06-07 20:42:58]      DB_USER DB_NAME SLACK_CLIENT_ID SLACK_CLIENT_SECRET DB_HOSTNAME SLACK_SIGNING_SECRET DB_PASSWORD DB_PORT SERVER_PORT
[slack-bot] [2023-06-07 20:42:58] 
[slack-bot] [2023-06-07 20:42:58]  › configuring custom build command to be run at the end of the build:
[slack-bot] [2023-06-07 20:42:58]    │ npm run build
[slack-bot] [2023-06-07 20:42:58] 
[slack-bot] [2023-06-07 20:42:58] ╭──────────── buildpack detection ───────────╼
[slack-bot] [2023-06-07 20:42:58] │  › using Ubuntu 18.04 stack
[slack-bot] [2023-06-07 20:42:59] │ Detected the following buildpacks suitable to build your app:
[slack-bot] [2023-06-07 20:42:59] │ 
[slack-bot] [2023-06-07 20:42:59] │    heroku/nodejs-engine   v0.5.2  
[slack-bot] [2023-06-07 20:42:59] │    digitalocean/node      v0.3.6  (Node.js)
[slack-bot] [2023-06-07 20:42:59] │    digitalocean/procfile  v0.0.3  (Procfile)
[slack-bot] [2023-06-07 20:42:59] │    digitalocean/custom    v0.1.1  (Custom Build Command)
[slack-bot] [2023-06-07 20:42:59] │ 
[slack-bot] [2023-06-07 20:42:59] │ For documentation on the buildpacks used to build your app, please see:
[slack-bot] [2023-06-07 20:42:59] │ 
[slack-bot] [2023-06-07 20:42:59] │    Node.js  v0.3.6  https://do.co/apps-buildpack-node
[slack-bot] [2023-06-07 20:42:59] ╰─────────────────────────────────────────────╼
[slack-bot] [2023-06-07 20:42:59] 
[slack-bot] [2023-06-07 20:42:59] ╭──────────── app build ───────────╼
[slack-bot] [2023-06-07 20:42:59] │ ---> Node.js Buildpack
[slack-bot] [2023-06-07 20:42:59] │ ---> Installing toolbox
[slack-bot] [2023-06-07 20:42:59] │ ---> - jq
[slack-bot] [2023-06-07 20:43:00] │ ---> - yj
[slack-bot] [2023-06-07 20:43:00] │ ---> Getting Node version
[slack-bot] [2023-06-07 20:43:00] │ ---> Resolving Node version
[slack-bot] [2023-06-07 20:43:01] │ ---> Downloading and extracting Node v17.9.1
[slack-bot] [2023-06-07 20:43:06] │ ---> Parsing package.json
[slack-bot] [2023-06-07 20:43:06] │ ---> No file to start server
[slack-bot] [2023-06-07 20:43:06] │ ---> either use 'docker run' to start container or add index.js or server.js
[slack-bot] [2023-06-07 20:43:06] │ Project contains package-lock.json, using npm
[slack-bot] [2023-06-07 20:43:07] │ Using npm v8.11.0. To configure a different version of npm, set the engines.npm property in package.json.
[slack-bot] [2023-06-07 20:43:07] │   See https://do.co/apps-buildpack-node for further instructions.
[slack-bot] [2023-06-07 20:43:07] │ Installing node_modules using npm (from package-lock.json)
[slack-bot] [2023-06-07 20:43:07] │ Running npm ci
[slack-bot] [2023-06-07 20:43:07] │ 
[slack-bot] [2023-06-07 20:43:15] │ 
[slack-bot] [2023-06-07 20:43:15] │ added 188 packages, and audited 189 packages in 7s
[slack-bot] [2023-06-07 20:43:15] │ 
[slack-bot] [2023-06-07 20:43:15] │ 54 packages are looking for funding
[slack-bot] [2023-06-07 20:43:15] │   run `npm fund` for details
[slack-bot] [2023-06-07 20:43:15] │ 
[slack-bot] [2023-06-07 20:43:15] │ found 0 vulnerabilities
[slack-bot] [2023-06-07 20:43:15] │ npm notice 
[slack-bot] [2023-06-07 20:43:15] │ npm notice New major version of npm available! 8.11.0 -> 9.7.1
[slack-bot] [2023-06-07 20:43:15] │ npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.7.1>
[slack-bot] [2023-06-07 20:43:15] │ npm notice Run `npm install -g npm@9.7.1` to update!
[slack-bot] [2023-06-07 20:43:15] │ npm notice 
[slack-bot] [2023-06-07 20:43:15] │ 
[slack-bot] [2023-06-07 20:43:15] │ Running custom build command: npm run build
[slack-bot] [2023-06-07 20:43:15] │ 
[slack-bot] [2023-06-07 20:43:15] │ > slackbot@1.0.0 build
[slack-bot] [2023-06-07 20:43:15] │ > node ./src/app.js
[slack-bot] [2023-06-07 20:43:15] │ 
[slack-bot] [2023-06-07 20:43:15] │ [WARN]  OAuth:InstallProvider:0 You've set InstallProvider#stateVerification to false. This flag is intended to enable org-wide app installations from admin pages. If this isn't your scenario, we recommend setting stateVerification to true and starting your OAuth flow from the provided `/slack/install` or your own starting endpoint.
[slack-bot] [2023-06-07 20:43:15] │ ⚡️ Bolt app is running!

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
June 8, 2023
Accepted Answer

Hi there,

From the logs, it seems like your application is getting stuck at the “Bolt app is running!” step. This indicates that the app is stuck at the build stage because it’s not correctly recognizing when the build phase has completed because you’re using - npm run build, which executes node ./src/app.js.

This command is starting your application rather than just building it, causing the build to hang as it thinks the app is still being built.

To resolve this issue, you should modify your build process to make sure it only builds the app and doesn’t run it. This might involve moving the server start-up command (node ./src/app.js) into a separate start command (such as npm start), while the npm run build should only be responsible for preparing the application for running, for example, compiling source code or installing dependencies.

Here’s a general example:

  1. In your package.json, you can separate your build and start scripts like this:
"scripts": {
    "start": "node ./src/app.js",
    "build": "npm install"
}
  1. In your DigitalOcean App Platform settings, set the run command to npm start.

After these changes, the build command (npm run build) will install all necessary dependencies but won’t start the app.

The npm start command, which is used to start the application, will then be handled separately by the DigitalOcean App Platform when the app is deployed and ready to be run.

Let me know how it goes!

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.