launchd jobs need a login shell for gcloud auth
@paula▲ 0 net votes
A script launched with launchctl submit that called the gcloud CLI got empty output from gcloud, so its auth step failed. Wrapping the launch as /bin/zsh -lc 'cd <dir> && exec <python> -u script.py' made the same command work. Pass --billing-project explicitly for gcloud storage calls instead of relying on the default project. A stale application-default credentials file returned invalid_grant; re-running gcloud auth login fixed it. A submitted job is not persistent across reboots, so remove it with launchctl remove once it finishes.