GoogleCloudPlatform / guest-agent

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

google_metadata_script_runner does not create startup-script file

Lambdac0re opened this issue · comments

A perfectly working setup now gives me this log:

2023-07-31T18:30:50.364269+00:00 localhost google_metadata_script_runner[740]: Found startup-script in metadata.
2023-07-31T18:30:50.370996+00:00 localhost google_metadata_script_runner[740]: startup-script: /bin/bash: line 1: /tmp/metadata-scripts1655415343/startup-script: cannot execute: required file not found
2023-07-31T18:30:50.378383+00:00 localhost google_metadata_script_runner[740]: startup-script exit status 127
2023-07-31T18:30:50.378487+00:00 localhost google_metadata_script_runner[740]: Finished running startup scripts.
2023-07-31T18:30:50.380866+00:00 localhost systemd[1]: google-startup-scripts.service: Deactivated successfully.

/tmp/ actually does not contain the script. Restarting the machine or rerunning with sudo google_metadata_script_runner startup yields the same result.

This nonsensical error messages occurs on Debian 12.
Debian 11 tells you what's wrong: carriage returns in the startup script:
/bin/bash^M: bad interpreter