fastlane: "Google Api Error: Unauthorized - Request is missing required authentication credential" running create_app_on_managed_play_store/upload_to_play_store lanes
New Issue Checklist
- Updated fastlane to the latest version
- I read the Contribution Guidelines
- I read docs.fastlane.tools
- I searched for existing GitHub issues
Issue Description
When we execute the “create_app_on_managed_play_store” lane we’re always getting a “Google Api Error: Unauthorized - Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential.” error since a month ago. The App in the Managed Google Play Console is not created.
The json we use was generated on a project in Google Cloud Platform and has privileges to execute Google Play APIs (Google Play Android Developer API and Google Play Custom App Publishing API) and also has admin privileges on Managed Google Play Console. Prior to a month ago, it always worked fine.
It seems that Google requires a different authentication method now? It is possible that fastlane has not adapted?
Command executed
fastlane run create_app_on_managed_play_store
Complete output when running fastlane, including the stack trace and command used
vmontana@K9XLDQKJR9 fastlane % fastlane run create_app_on_managed_play_store language:"es_ES" [✔] 🚀 [08:38:47]: fastlane detected a Gemfile in the current directory [08:38:47]: However, it seems like you didn't use `bundle exec` [08:38:47]: To launch fastlane faster, please use [08:38:47]: [08:38:47]: $ bundle exec fastlane run create_app_on_managed_play_store language:es_ES [08:38:47]: [08:38:47]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile [08:38:48]: ---------------------------------------------- [08:38:48]: --- Step: create_app_on_managed_play_store --- [08:38:48]: ---------------------------------------------- [08:38:48]: To not be asked about this value, you can specify it using 'json_key' [08:38:48]: The service account json file used to authenticate with Google: ./mdona-cloud-dev-cicdmovd.json±---------±-----------------------------------------------------------+ | Summary for create_app_on_managed_play_store | ±---------±-----------------------------------------------------------+ | language | es_ES | | json_key | /Users/vmontana/Documents/fastlane/mdona-cloud-dev-cicdmo | | | vd.json | | apk | oficinas_and-1.2.61(23022711).apk | | timeout | 300 | ±---------±-----------------------------------------------------------+
[08:39:04]: To not be asked about this value, you can specify it using ‘app_title’ [08:39:04]: App Title: oficinas_and [08:39:45]: To not be asked about this value, you can specify it using ‘developer_account_id’ [08:39:45]: The ID of your Google Play Console account. Can be obtained from the URL when you log in (
https://play.google.com/apps/publish/?account=...or when you ‘Obtain private app publishing rights’ (https://developers.google.com/android/work/play/custom-app-api/get-started#retrieve_the_developer_account_id): <HIDDEN_VALUE>[!] Google Api Error: Unauthorized - 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.
Environment
✅ fastlane environment ✅
Stack
Key Value OS 12.6.3 Ruby 3.2.1 Bundler? false Git git version 2.37.1 (Apple Git-137.1) Installation Source /opt/homebrew/lib/ruby/gems/3.2.0/bin/fastlane Host macOS 12.6.3 (21G419) Ruby Lib Dir /opt/homebrew/Cellar/ruby/3.2.1/lib OpenSSL Version OpenSSL 1.1.1t 7 Feb 2023 Is contained false Is homebrew false Is installed via Fabric.app false Xcode Path /Applications/Xcode-14.2.app/Contents/Developer/ Xcode Version 14.2 Swift Version 5.7.2 System Locale
Variable Value LANG es_ES.UTF-8 ✅ LC_ALL LANGUAGE fastlane files:
No Fastfile found
No Appfile found
fastlane gems
Gem Version Update-Status fastlane 2.212.1 ✅ Up-To-Date Loaded fastlane plugins:
No plugins Loaded
Loaded gems
Gem Version error_highlight 0.5.1 did_you_mean 1.6.3 syntax_suggest 1.0.2 atomos 0.1.3 rexml 3.2.5 CFPropertyList 3.0.6 claide 1.1.0 colored2 3.1.2 nanaimo 0.3.0 xcodeproj 1.22.0 rouge 2.0.7 xcpretty 0.3.0 terminal-notifier 2.0.0 unicode-display_width 1.8.0 terminal-table 1.8.0 plist 3.7.0 public_suffix 5.0.1 addressable 2.8.1 multipart-post 2.0.0 word_wrap 1.0.0 optparse 0.1.1 tty-screen 0.8.1 tty-cursor 0.7.1 tty-spinner 0.9.3 artifactory 3.0.15 babosa 1.0.4 colored 1.2 highline 2.0.3 commander 4.6.0 excon 0.99.0 faraday-em_http 1.0.0 faraday-em_synchrony 1.0.0 faraday-excon 1.1.0 faraday-httpclient 1.0.1 faraday-multipart 1.0.4 faraday-net_http 1.0.1 faraday-net_http_persistent 1.2.0 faraday-patron 1.0.0 faraday-rack 1.0.0 faraday-retry 1.0.3 ruby2_keywords 0.0.5 faraday 1.10.3 unf_ext 0.0.8.2 unf 0.1.4 domain_name 0.5.20190701 http-cookie 1.0.5 faraday-cookie_jar 0.0.7 faraday_middleware 1.2.0 fastimage 2.2.6 gh_inspector 1.1.3 json 2.6.3 mini_magick 4.12.0 naturally 2.2.1 rubyzip 2.3.2 security 0.1.3 xcpretty-travis-formatter 1.0.1 dotenv 2.8.1 bundler 2.4.6 simctl 1.6.10 jwt 2.7.0 uber 0.1.0 declarative 0.0.20 trailblazer-option 0.1.2 representable 3.2.0 retriable 3.1.2 mini_mime 1.1.2 memoist 0.16.2 multi_json 1.15.0 os 1.1.4 signet 0.17.0 googleauth 1.3.0 httpclient 2.8.3 webrick 1.8.1 google-apis-core 0.11.0 google-apis-playcustomapp_v1 0.12.0 google-apis-androidpublisher_v3 0.34.0 google-cloud-env 1.6.0 google-cloud-errors 1.3.0 google-cloud-core 1.6.0 google-apis-iamcredentials_v1 0.17.0 google-apis-storage_v1 0.19.0 rake 13.0.6 digest-crc 0.6.4 google-cloud-storage 1.44.0 emoji_regex 3.2.3 jmespath 1.6.2 aws-partitions 1.716.0 aws-eventstream 1.2.0 aws-sigv4 1.5.2 aws-sdk-core 3.170.0 aws-sdk-kms 1.62.0 aws-sdk-s3 1.119.1 set 1.0.3 forwardable 1.3.3 logger 1.5.3 pathname 0.2.1 shellwords 0.1.0 cgi 0.3.6 date 3.3.3 timeout 0.3.1 securerandom 0.2.2 uri 0.12.0 openssl 3.1.0 digest 3.1.1 ipaddr 1.2.5 resolv 0.2.2 time 0.2.1 stringio 3.0.4 open-uri 0.3.0 mutex_m 0.1.2 net-http 0.3.2 net-protocol 0.2.1 ostruct 0.5.5 english 0.7.2 erb 4.0.2 abbrev 0.1.1 tempfile 0.1.3 delegate 0.3.0 fileutils 1.7.0 tmpdir 0.1.3 base64 0.1.1 singleton 0.1.1 open3 0.1.2 nkf 0.1.2 prettyprint 0.1.1 pp 0.4.0 find 0.1.1 yaml 0.2.1 psych 5.0.1 generated on: 2023-02-28
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 18
- Comments: 101 (6 by maintainers)
Commits related to this issue
- Retry failed Google API calls See https://github.com/fastlane/fastlane/issues/21091 — committed to fmasa/wfrp-master by fmasa 9 months ago
We shipped fastlane
2.215.1this weekend, which includes my patch to workaround this Google API issue.Once you update to fastlane
2.215.1, set theSUPPLY_UPLOAD_MAX_RETRIESenv var to an integer >1 to auto-retry each randomly failed Google API error.You can do this either in your
fastalane/.envfile (if you use one), or inside yourFastfileusingENV['SUPPLY_UPLOAD_MAX_RETRIES']='5'for example.same issue too
This is probably a temporary Google Issue. Found one report on their issue tracker, and one member said they’re looking into it. https://issuetracker.google.com/issues/300236995#comment2
hello, is there any update on this one? i am also experiencing same issue.
I confirm, by setting these params, the upload goes through successfully:
I’m also seeing this on the
upload_to_play_storecommand. Last ran successfully on 7th September. No runs over the weekend but since Monday it’s failed consistently. No config changes on our endI have the same problem intermittently while using supply
Started getting this yesterday as well, not on every run, but about 75% of the time.
In fact on some cases it even many retries don’t fix the issue if upload is large, we need a better solution or get in touch with Google?
I opened this case for the “create_app_on_managed_play_store” lane (Android enterprise private apps). I am still facing this problem since February without a solution yet.
Now, I’m getting the same error in the ‘public’ lane “upload_to_play_store” like you guys. It seems like the same problem is affecting both lanes.
Please, Fastlane developers, could you check what’s going on?
facing this same issue from today
@vmontana try this guide https://medium.com/@muhammedqazi/mastering-fastlane-the-ultimate-guide-to-effortless-android-and-ios-deployments-with-github-e0878c3f9529
I believe that Google has fixed its issue. Personally, I am leaving the retry logic in place for a while.
5 hours ago, I received an email from someone on the Android DevRel team at Google saying that they some of their partners reported the issue and that they thus started to monitor https://github.com/fastlane/fastlane/issues/21507. In the email they mention:
This looks very promising and might explains why @chrisvire 's attempt today passed without any retry needed 🙏
I think Google has made some changes to the API. I’m encountering this issue because I’ve integrated the Play Store API into my project, and I’ve been receiving the same error since yesterday…
We’re facing the same issue. Please help. We’ve a production release today.
We’re facing the same issue. Please help. We’ve a production release today.
We have the same problem, JSON keys are ok, permissions are there. If anyone has a solution, please tell us! 😃
There was another attempt today to publish the same app with retries=12. Good news is there were no failures that needed to be retried. So maybe they have fixed the underlying problem?
Alright, addding the MAX_RETRIES env var also fixes it so both fixes work! i also added the root_url for good measure
Yes, the one I linked above
the one with youtube seems to be the same to me because it is also related to missing authorization, there is no other recent report at the same channel, and the user states they’re using the same code/token for years, just like we are. And also because someone at Google said they’re looking internally.
Let’s hope it’s the same issue. I’ll try to link this issue on their issue tracker so they can see it’s happening to more people
this workaround worked for me
@fabiendem Nothing to do: I refreshed the JSON key and created a new service account, but the result is the same.
That’s possible. The failed uploads include the following output
The linked page has a deprecation warning at the top but it also links to a deprecation & sunsetting page where the sunset date is still marked as TBD. It seems plausible that Google sunsetted something without proper notice, but what makes me doubt it is that a few people in this thread have reported successful uploads. Maybe it’s something less drastic.
No such luck on my end. Our config already includes those params
https://github.com/fastlane/fastlane/issues/21507 the same scenario for us too, the error gets triggered during screenshots upload
The same issue if we are trying to upload more than one localization at a time.
I’m facing the same issue, any updates here?
access_token url paramaterHi
Getting the same when running
upload_to_play_store- worked 3 weeks ago. Setting store/key pw, store file and alias ingradleproperties.