Compute Engine startup-script exited with a non-zero status (startup-script-url failed)
The VM's startup script failed, so the software it should install or configure is missing.
startup-script exit status 1Script startup-script failed with exit statusstartup-script: exit status 1startup-script-url: AccessDeniedExceptionFinished running startup script. Return code: 1. Meaning
Read the serial port/journal (journalctl -u google-startup-scripts.service), fix the failing command, and make the script idempotent because it runs on every boot. For startup-script-url, make sure the VM's service account can read the bucket object.
Common causes
- Command in the script failing
- Package repo unreachable (no external IP/NAT)
- Script runs on every boot, not idempotent
- GCS URL not readable by the VM SA
- Missing shebang or wrong line endings
⚡ Quick fix
sudo journalctl -u google-startup-scripts.service- Fix and make the script idempotent
- Grant the VM service account read access to the script bucket
Detailed fix by platform
Shell
- bash
sudo journalctl -u google-startup-scripts.service --no-pager | tail -50 gcloud compute instances get-serial-port-output VM --zone=ZONE | grep startup-script
How to diagnose
- Log — Failing line?
- Network — Reachable?
- Script — Idempotent?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- 403: does not have storage.objects.get access Cloud Storage: 403 Forbidden — user@example.com does not have storage.objects.get access to the Google Cloud Storage object
- autohealing Managed instance group keeps recreating VMs: autohealing health check failing
- Cloud NAT Cloud NAT: OUT_OF_RESOURCES dropped connections (port exhaustion)
Most viewed in Google Cloud / Firebase
- Missing or insufficient permissions Firestore: FirebaseError: [code=permission-denied]: Missing or insufficient permissions
- Container failed to start Cloud Run: The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable
- 409: The resource already exists Compute Engine: ERROR: (gcloud.compute.instances.create) Could not fetch resource: The resource 'projects/p/zones/z/instances/vm-1' already exists
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 18 Nov 2026