Running locally on laptop with sandbox, when I test connection with no projectId or service account keyfile, I get the error:
Anonymous caller does not have storage.buckets.list access to project <--redacted number-->.
BigQuery is returning
Spanner is returning
UNAUTHENTICATED: io.grpc.StatusRuntimeException: UNAUTHENTICATED: Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
In all these cases, it should give a better error indicator with information that project or credentials could not be detected in the environment.