Hosted Targets troubleshooting

You're viewing Apigee Edge documentation.
Go to the Apigee X documentation.

Build/Deploy failed due to missing package.json

A package.json file is required in the root directory of your Node.js app. Any attempt to create/deploy a proxy without a package.json will fail at build time.

Receiving 502 Bad Gateway From Proxy

A "502 Bad Gateway" error can occur when the process fails to start. To debug this check the runtime logs and look for error messages when starting. A common error is a missing or invalid start command in the package.json. At a minimum the package.json should specify "start": "node ." in the scripts property. For example:

  "name": "hello-world",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
   "start": "node ."
  "author": "",
  "license": "",
  "description": "Hello World Application",
  "dependencies": {

Proxy Hangs and Returns 504 Gateway Timeout

A "504 Gateway Timeout" error can occur when the Hosted Targets target app does not respond within a timeout limit. Check to ensure that your application is listening on the port set in the environment variable PORT. You can access this variable with process.env.PORT in your application. Otherwise you can check the runtime logs for any other error messages. See also Environment variables set in the application runtime.

Also, Google App Engine (GAE) imposes a 60 second request timeout. See also Quotas and limits in the GAE documentation.

Illegal character in path

If you see an error similar to the following when you deploy a proxy with Hosted Targets, the cause may be that the proxy name contains a space. You must not use a space in a proxy name with Hosted Targets.

Illegal character in path at index 69: Hash/revision/1733635923

npm ERR! rofs EROFS: read-only file system

Hosted Targets applications run in containers using a tmpfs filesystem. Only the /tmp directory in the filesystem is writable by the Hosted Target application. Unfortunately, newer versions of NPM will attempt to write to /root/.npm for its cache, logs, etc. To address this, please refer to the Change the NPM cache location or Run your application without NPM tasks.