Error Codes
When a pam command fails, it prints one stable error code, the message, a suggested fix and a command that verifies the fix:
× ERROR [PAM-E005] `pam commands` must run inside a PAM project Fix: run `pam --help` or `pam help <command>` for valid usage Verify: pam --helpThe code identifies the category of the failure, so scripts and support tickets can rely on it; the message carries the specific cause. This page lists every code the CLI defines, then the HTTP status codes the runtime returns without entering your PHP code.
CLI Error Codes
Section titled “CLI Error Codes”| Code | Category | Exit code | Fix | Verify |
|---|---|---|---|---|
PAM-E001 |
Script unavailable | 66 | Check that the path exists and points to the intended file | pam doctor |
PAM-E002 |
Not a file | 66 | Check that the path exists and points to the intended file | pam doctor |
PAM-E003 |
Development | 70 | Fix the reported development error, then restart pam dev |
pam doctor --json |
PAM-E004 |
Cluster | 70 | Run pam doctor, inspect worker logs, then retry the command |
pam doctor --json |
PAM-E005 |
Command | 70 | Run pam --help or pam help <command> for valid usage |
pam --help |
PAM-E006 |
Doctor | 70 | Run pam doctor --fix, then repeat pam doctor |
pam doctor --json |
PAM-E007 |
Runtime | 70 | Run pam doctor and inspect the PHP runtime diagnostics |
pam doctor --json |
PAM-E008 |
Server | 70 | Inspect the server configuration and retry after pam doctor |
pam doctor --json |
Exit code 66 is EX_NOINPUT and 70 is EX_SOFTWARE from sysexits.h.
PAM-E001: Script Unavailable
Section titled “PAM-E001: Script Unavailable”The PHP file you asked PAM to run cannot be opened.
× ERROR [PAM-E001] cannot open nosuchfile.php: No such file or directory (os error 2)Check the spelling and the current directory. A bare word that is not a command is treated as a script path, so a mistyped command also lands here.
PAM-E002: Not a File
Section titled “PAM-E002: Not a File”The path exists but is a directory or another non-file entry. Pass the entry point itself (for example public/index.php), not its directory.
PAM-E003: Development
Section titled “PAM-E003: Development”pam dev could not start or keep the development session. Read the message, fix the code or configuration it names, and run pam dev again.
PAM-E004: Cluster
Section titled “PAM-E004: Cluster”pam start (or a worker or zygote) failed: invalid flags such as --workers above 256, a pool without --ingress-address, a non-loopback --admin-address without a token, or a worker generation that failed readiness. Inspect the worker output, then run pam doctor.
× ERROR [PAM-E004] non-loopback --admin-address requires PAM_ADMIN_TOKEN or PAM_ADMIN_TOKEN_FILE with a 32 to 256 character ASCII tokenPAM-E005: Command
Section titled “PAM-E005: Command”A command was used incorrectly or its preconditions were not met. This is the most common code; process-manager, deploy and packaging commands report their failures here. Examples:
× ERROR [PAM-E005] `pam commands` must run inside a PAM project× ERROR [PAM-E005] environment file must be owned by the current user and mode 0600 or stricter× ERROR [PAM-E005] application "api" PHP extension profile drifted at extensions; pinned ["mbstring"], derived ["mbstring", "pdo_pgsql"]× ERROR [PAM-E005] no focused help is available for "heap"Read the message: it names the exact option, file or state to fix. pam help <command> shows the valid usage.
PAM-E006: Doctor
Section titled “PAM-E006: Doctor”pam doctor found a problem with the PHP runtime, Composer or the project. Run pam doctor --fix to apply safe repairs (create a missing pam.json, install locked dependencies), then pam doctor again.
PAM-E007: Runtime
Section titled “PAM-E007: Runtime”The embedded PHP runtime failed: the engine did not initialize, the Composer autoloader failed, or a script ended with a fatal error. The message includes PHP’s own output.
× ERROR [PAM-E007] Composer autoload failed with status 255: /srv/acme/vendor/autoload.phpA broken or partial vendor directory is the usual cause; reinstall with pam composer install.
PAM-E008: Server
Section titled “PAM-E008: Server”The HTTP server could not start with its configuration, for example an address it cannot bind, an unreadable TLS certificate or key, or an invalid internal listen address. Check the listen() options and the port, then retry.
JSON Errors
Section titled “JSON Errors”For automation, ask for a JSON envelope with --json-errors (or PAM_ERROR_FORMAT=json):
pam --json-errors nosuchfile.php{ "errorCode": 1, "exitCode": 66, "message": "cannot open nosuchfile.php: No such file or directory (os error 2)", "remediation": "check that the path exists and points to the intended file", "schema": 1, "verificationCommand": "pam doctor"}errorCode is the number after PAM-E. The envelope is printed on standard output, and the process exits with exitCode.
HTTP Errors from the Runtime
Section titled “HTTP Errors from the Runtime”The PAM transport answers these by itself, before or around your PHP code. Responses carry a short plain message; they never include stack traces.
| Status | When | Related setting |
|---|---|---|
400 |
Malformed request, or a multipart body with more parts than max_multipart_body_parts |
PHP INI |
403 |
WebSocket upgrade from an origin that is not allowed | websocketOrigins, PAM_WEBSOCKET_ORIGINS |
413 |
Request body exceeds maxBodyBytes |
maxBodyBytes |
429 |
Per-client rate limit exceeded | rateLimitPerSecond |
431 |
Request headers exceed the configured limit | maxHeaders, maxHeaderBytes |
500 |
Uncaught exception in your handler (message only with exposeErrors), or an internal dispatch protocol error |
exposeErrors |
503 |
Worker body budget exhausted, concurrent request limit reached, WebSocket connection limit reached, or the worker is restarting after a timeout (with Retry-After) |
maxInflightBodyBytes, maxConcurrentRequests, websocketMaxConnections |
504 |
Request exceeded requestTimeoutMs; the worker is then recycled |
requestTimeoutMs |
An uncaught exception produces:
{"error":"Internal Server Error","message":"The request failed. Use the request ID to inspect server logs."}Find the request in the logs with its x-request-id (enable telemetryHeaders to return it) and the access log.
Next Steps
Section titled “Next Steps”- CLI Reference for valid usage of every command.
- Observability & Diagnostics for investigating runtime failures.