# Troubleshoot Node.js Hosting (https://developer.godaddy.com/en/docs/api-users/troubleshoot/hosting)

---
title: Troubleshoot Node.js Hosting
description: >-
  Diagnose and resolve common errors when deploying and operating Node.js apps
  on GoDaddy's hosting platform.
agentNotes:
  scopes:
    - 'hosting.application:read'
    - 'hosting.log:read'
  idempotent: true
  destructive: false
  failureRecovery: All diagnostic calls on this page are read-only and safe to retry.
faqItems:
  - question: Why is my hosting app creation job stuck in pending?
    answer: >-
      Most create-app jobs complete within a minute. If the job stays in pending
      for more than 2 minutes, treat it as stuck — retry the POST /apps call
      with a new name.
  - question: Why did my zip upload fail?
    answer: >-
      The most common cause is a missing package.json at the zip root, a missing
      build or start script, or node_modules included in the zip. Verify the zip
      structure against the Node.js app requirements.
  - question: Why am I getting 401 Unauthorized from the Hosting API?
    answer: >-
      The token is expired, revoked, or missing a required scope. Verify the
      required scope is included in your PAT. Create a new PAT with the correct
      scopes.
  - question: Why is the publish variant not showing running after deployment?
    answer: >-
      Allow up to 30 seconds for the variant status to flip to running after
      POST /apps/{appId}/deployments. If it stays in a non-running state, fetch
      application logs to check for startup errors.
keywords: >-
  job stuck pending, upload failed zip, 401 unauthorized hosting, 429 rate
  limit, deployment failed, hosting.secret:read scope, app not running,
  troubleshoot hosting
related:
  tutorials:
    - title: Deploy your Node.js app
      href: /docs/api-users/hosting/workflows/deploy-nodejs-app
  guides:
    - title: Read logs
      href: /docs/api-users/hosting/read-logs
  concepts:
    - title: Hosting concepts
      href: /docs/api-users/hosting/concepts
    - title: Node.js app requirements
      href: /docs/api-users/hosting/app-requirements
  apis:
    - title: Hosting API reference
      href: /docs/references/rest/hosting
---

## Overview

This page covers common failures when using the Hosting API, with causes and steps to resolve them. Go to [Read logs](https://developer.godaddy.com/docs/api-users/hosting/read-logs) for build and application output when diagnosing runtime failures.

## App creation job stuck in pending

**Symptom:** `GET /app-operations/{operationId}` returns `status: "PENDING"` for more than two minutes.

**Cause:** Upstream provisioning delay or a transient platform error.

**Resolution:**

* Wait two minutes. Most create jobs complete within 30–60 seconds.
* If still pending after 2 minutes, treat the job as failed.
* Retry `POST /apps` with a new app name. Don't reuse the stuck operation id.

## Source import job failed

**Symptom:** `GET /apps/{appId}/imports/{importId}` returns `status: "FAILED"`.

**Cause:** A malformed zip or build failure causes most import failures.

**Resolution:**

* Confirm the zip root contains a `package.json`. The build system must find it at the top level.
* Confirm the zip doesn't contain a nested project root (e.g., a folder wrapping all the files).
* Verify the app meets all deployment requirements. Go to [Node.js app requirements](https://developer.godaddy.com/docs/api-users/hosting/app-requirements) for the full list.
* After fixing the zip, upload again with `POST /apps/{appId}/imports`.

## 401 Unauthorized

**Symptom:** Any request returns `401 Unauthorized`.

**Cause:** The token is expired, revoked, or missing a required scope.

**Resolution:**

1. Check the token expiry date in the [Personal Access Tokens](https://developer.godaddy.com/personal-access-token) portal.
2. Verify the token includes the scope the operation requires. Go to [Hosting core concepts](https://developer.godaddy.com/docs/api-users/hosting/concepts#scopes-reference) for the full scopes table.
3. Note: `GET /apps/{appId}/secrets` requires `hosting.secret:read`.
4. Create a new token with the correct scopes if the original has expired or lacked a scope.

## 429 Too Many Requests

**Symptom:** Requests return `429 Too Many Requests`.

**Cause:** Rate limit exceeded. Limits are enforced per client IP and vary by operation (10–120 req/min).

**Resolution:**

* Implement exponential backoff. Start with a 1-second delay and double on each retry, up to a maximum of 30 seconds.
* Avoid tight polling loops — use 2–5 second intervals when polling job status.
* Go to [Rate limits](https://developer.godaddy.com/docs/api-users/rate-limits) for general guidance.

## App not running after publish

**Symptom:** `GET /apps/{appId}/status` shows the `publish` variant in a non-running state after `POST /apps/{appId}/deployments`.

**Cause:** The app might have a startup error, or the deployment is still rolling out.

**Resolution:**

1. Allow up to 30 seconds for the status to flip to `running` after a publish. Poll with a five second interval.

2. If the status remains non-running, fetch application logs to check for startup errors.

3. Fix the error, upload a corrected zip, and publish again. Go to [Deploy your Node.js app](https://developer.godaddy.com/docs/api-users/hosting/workflows/deploy-nodejs-app) for the full deploy flow.

4. Fetch application logs:
