bitrise-steplib / steps-google-play-deploy

MIT License
54 stars 38 forks source link

error: googleapi: Error 401: Request is missing required authentication credential #153

Closed DavidAZimmerly closed 1 year ago

DavidAZimmerly commented 1 year ago

Troubleshooting

Useful information

Issue description

When running the google play deploy step, I occasionally get a failure with: Failed to upload application(s): failed to upload app bundle, error: googleapi: Error 401: 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., unauthorized

Bitrise info

Getting configuration
Configs:
- JSONKeyPath: *****
- PackageName: com.arcxp.thearcxp
- AppPath: /bitrise/deploy/app-arcXPInternal-release.aab
- ExpansionfilePath: 
- Track: internal
- UserFraction: 0
- UpdatePriority: 0
- WhatsnewsDir: 
- MappingFile: 
- ReleaseName: 
- Status: 
- RetryWithoutSendingToReview: false
- AckBundleInstallationWarning: false
Using app from: /bitrise/deploy/app-arcXPInternal-release.aab
Configuration read successfully
Authenticating
Authenticated client created
Create new edit
 editID: 05832712845556463172
Edit insert created
Available tracks on Google Play:
- production
- beta
- alpha
- internal
- Investigation
- ReleaseCandidate
Tracks listed
Upload apks or app bundles
Uploading /bitrise/deploy/app-arcXPInternal-release.aab 1/1
Failed to upload application(s): failed to upload app bundle, error: googleapi: Error 401: 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., unauthorized
  

Steps to reproduce

unsure, it happens regularly though

mmiller-wfc commented 1 year ago

This started happening for our account as well (as of today 9/15/23). Some builds deploy successfully and some fail with the same error.

richdapice commented 1 year ago

The same is happening today for us as well.

sebastian-zero commented 1 year ago

Same, our Android builds fail constantly now.

daniel-zero commented 1 year ago

Fastlane was able to find a workaround: https://github.com/fastlane/fastlane/pull/21518

jaymengxy commented 1 year ago

I encountered the same issue yesterday.

dranoer commented 1 year ago

We faced the same issue today.

CrazyScrubber commented 1 year ago

Same issue since last week

lpusok commented 1 year ago

Released a workaround in version 3.7.4 wich retries on the 401 errors: https://github.com/bitrise-steplib/steps-google-play-deploy/releases/tag/3.7.4

martyphee commented 1 year ago

Having issues also and I'm using 3.7.4

sameermore412 commented 1 year ago

Encountered the same issue. Version 3.7.4 was used when it failed.

lpusok commented 1 year ago

Version 3.7.4 retries 4 times with relatively short wait (1, 2, 4 and 8 seconds). There is a verbose_log input you can set to true to see these in the log. Version 3.7.5 retires more times with more wait time (2, 4, 8, 16, 30 and 30 seconds).

I recommend to report the 401 status issue to Google Play at https://support.google.com/googleplay/android-developer/contact/general_contact, so they can hopefully resolve it.

martyphee commented 1 year ago

3.7.5 seems to have fixed the issue. At least my last build worked

CrazyScrubber commented 1 year ago

3.7.5 => Still have the same issue. But not with the app bundle upload with the mapping file upload

J6ey commented 1 year ago

@CrazyScrubber Also not able to upload with mapping file on 3.7.5. Are you saying it uploads fine without it?

CrazyScrubber commented 1 year ago

@J6ey Yes. We got the following error Failed to upload application(s): failed to upload mapping file, error: googleapi: Error 401: 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., unauthorized

The upload of the app bundle works but the mapping file is causing us the 401 exception. It just works every 10 tries of restarting the build

lpusok commented 1 year ago

@CrazyScrubber can you share a log with verbose_log enabled?

lpusok commented 1 year ago

Anecdotally recreating the Google Play service account can help, maybe worth a try.

jordan819 commented 1 year ago

Same problem here in 3.7.5: can't deploy 2 out of 20 applications due to authorization error. I've tried several times and get exactly the same error.

Failed to upload application(s): failed to upload app bundle, error: googleapi: Error 401: 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., unauthorized

CrazyScrubber commented 1 year ago

OK with verbose_log it is the same app bundle issue as before. There were 6 Tries but every time 401. We deploy multiple apps with one Build. Sometimes 2 of three will be uploaded to Google Play and the last one gets the 401. Failed to upload application(s): failed to upload app bundle, error: googleapi: Error 401: 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., unauthorized

anthony-fresneau-kiplin commented 1 year ago

3.7.5 => Still have the same issue.

koral-- commented 1 year ago

@lpusok here is the log of the build failed for the same reason. Support access granted: https://app.bitrise.io/build/183b9a60-dc54-4063-a6bb-550b48475c60

ruialmeida51 commented 1 year ago

+1 Also having the same issue using the latest version.

labreu-bc commented 1 year ago

Same issue here, we're on 3.7.5, multiple attempts for the past couple of hours and only 1 got through

toddsantaniello commented 1 year ago

same here, cannot upload our builds to the play store anymore using 3.7.5

empowerDan commented 1 year ago

Same.

Ahmadin29 commented 1 year ago

Same issue on latest version

minalaroraswiggy commented 1 year ago

same issue https://app.bitrise.io/build/213af157-3882-448f-9fed-761804beeb2a

scruffyfox commented 1 year ago

Same issue with 3.7.x

80% of builds are failing

valls commented 1 year ago

Same issue, Previous deploy with version 3.7.3 on 8/29/23 working ✅ Last deploy with version 3.7.5 on 9/20/23 failing ❌

xcibik00 commented 1 year ago

Same issue

martyphee commented 1 year ago

Failing again for me

bmgswile commented 1 year ago

Same issue here.

The workaround that worked for me was to downgrade to version 3.6.x

lpusok commented 1 year ago

It seems we can not fix this problem with Google API. Error 401 is returned at random, and retrying does not always help. Reached out to Google Play developer support, waiting for a response. Please also report the problem here, to speed up resolution: https://support.google.com/googleplay/android-developer/contact/general_contact.

Would like to try a different approach:

toddsantaniello commented 1 year ago

~I'm not sure if this is related, but after these problems, I manually uploaded an apk and the Play Store had a new Financial Products compliance declaration I needed to accept. After doing that, my last 2 executions of the task have worked. using version 3.7.5~ Not related, but leaving here for posterity (see @GrahamBorland 's comment below)

GrahamBorland commented 1 year ago

It's not related to Financial Products. We submitted that declaration a few weeks ago, and have been hitting this error much more recently.

GrahamBorland commented 1 year ago

Discussion and some possible workarounds in this thread: https://androidstudygroup.slack.com/archives/C51GTR17A/p1695146387223879

scruffyfox commented 1 year ago

@GrahamBorland can you post the possible solution here for those without slack access?

GrahamBorland commented 1 year ago

The possible solution may not be the answer after all, but the suggestion was to make sure the tools are on the latest version of the androidpublisher npm package. Maybe it doesn't apply here at all.

Sorry for giving false hope...

RichardLima commented 1 year ago

same issue on 3.7.x we used 3.6.x as workaround and it worked

J6ey commented 1 year ago

3.6.x is working on my end too. I also had to stop sending the mapping file or it would error out the same way

Ahmadin29 commented 1 year ago

Working well after downgrade to 3.6.x

bbq-all-stars commented 1 year ago

I had the same issue, but after downgrading to 3.6.x it's working completely.

lpusok commented 1 year ago

Good news everyone, Google finally fixed the issue based on Step success rates.