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.

Exact message you may see startup-script exit status 1Script startup-script failed with exit statusstartup-script: exit status 1startup-script-url: AccessDeniedExceptionFinished running startup script. Return code: 1.
Seen on: Google Cloud Linux

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

  1. sudo journalctl -u google-startup-scripts.service
  2. Fix and make the script idempotent
  3. Grant the VM service account read access to the script bucket

Detailed fix by platform

Shell

  1. 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

  1. Log — Failing line?
  2. Network — Reachable?
  3. 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:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

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 (Google Cloud / Firebase)403: does not have st…autohealing — Managed instance group keeps recreating VMs: autohealing health check failing (Google Cloud / Firebase)autohealingCloud NAT — Cloud NAT: OUT_OF_RESOURCES dropped connections (port exhaustion) (Google Cloud / Firebase)Cloud NATCompute Engine: Quota exceeded (regional limit) — Compute Engine: Quota 'N2_CPUS' exceeded. Limit: 24.0 in region europe-west1 / QUOTA_EXCEEDED (Google Cloud / Firebase)Compute Engine: Quota…disk full — Compute Engine VM disk full: No space left on device — resize the persistent disk and filesystem (Google Cloud / Firebase)disk fullgrub rescue unknown filesystem — error: unknown filesystem. Entering rescue mode... grub rescue> (Linux)grub rescue unknown f…image family — Compute Engine: The resource 'projects/X/global/images/family/Y' was not found (image or family missing) (Google Cloud / Firebase)image familyIN_USE_ADDRESSES — Quota 'IN_USE_ADDRESSES' exceeded (external IP addresses) in region (Google Cloud / Firebase)IN_USE_ADDRESSESstartup-s…

Explore the map of this error Full error map →

🧠 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.