Connection to GCS repository works in script, not from cron

I built a shell-script (copy-paste-edit …) to sync a local sftp repository to a google cloud storage repository.

This shell script works when called from the shell (as root). When I call it from cron or a systemd-timer I get things like (anonymized quote):

ERROR can't connect to storage: unable to list from the bucket: ListBlobs: Get "": oauth2: cannot fetch token: Post "": dial tcp i/o timeout

The relevant part in the script:

$KOPIA repository sync-to gcs \
 --credentials-file "/root/somekey.json" \
 --bucket "somebucket" \
 --max-upload-speed=948576 \
 --no-delete \
 --no-update \

As mentioned: it works on the shell. So I assume some environment variables might miss. While I type this I think of $http_proxy etc … I will test in that direction.

Yes, exporting the proxy-variables helps.