diff --git a/lib/modules/datasource/docker/common.ts b/lib/modules/datasource/docker/common.ts index a91a712ff611a39c965e736ffafbf737f5d78777..e6d7ba57fd5081e8dfd36e0a5197a179299727f8 100644 --- a/lib/modules/datasource/docker/common.ts +++ b/lib/modules/datasource/docker/common.ts @@ -110,12 +110,23 @@ export async function getAuthHeaders( { registryHost, dockerRepository }, `Using google auth for Docker registry` ); - const accessToken = await getGoogleAccessToken(); - if (accessToken) { - const auth = Buffer.from( - `${'oauth2accesstoken'}:${accessToken}` - ).toString('base64'); - opts.headers = { authorization: `Basic ${auth}` }; + try { + const accessToken = await getGoogleAccessToken(); + if (accessToken) { + const auth = Buffer.from( + `${'oauth2accesstoken'}:${accessToken}` + ).toString('base64'); + opts.headers = { authorization: `Basic ${auth}` }; + } + } catch (err) /* istanbul ignore next */ { + if (err.message?.includes('Could not load the default credentials')) { + logger.once.debug( + { registryHost, dockerRepository }, + 'Could not get Google access token, using no auth' + ); + } else { + throw err; + } } } else if (opts.username && opts.password) { logger.trace(