Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Api Error: Unauthorized - Request is missing required authentication credential when trying to do a Google Play release #21507

Closed
4 tasks done
denissb opened this issue Sep 13, 2023 · 37 comments · Fixed by #21518

Comments

@denissb
Copy link

denissb commented Sep 13, 2023

New Issue Checklist

Issue Description

We have a problem that started 2 days ago with publishing Google Play releases.
When running the release_playstore lane that use supply Google APIs return Google Api Error: Unauthorized - Request is missing required authentication credential.
We have checked the service account key and it is valid and does not have an expiry date. Can someone experienced take a look at this problem. The assumption is Google made changes to the way API requests need to be done.

Command executed
lane :release_playstore do
  identifier = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
  supply(
     package_name: identifier,
     metadata_path: "fastlane/metadata/android/#{identifier}",
)
end
Complete output when running fastlane, including the stack trace and command used
| release_status                     | completed                                                          |
| track                              | beta                                                               |
| json_key                           | /home/vsts/work/_temp/fastlane-serviceaccount.json                 |
| aab                                | /home/vsts/work/1/xxx-Android-Production/xxx-release.aab |
| skip_upload_apk                    | false                                                              |
| skip_upload_aab                    | false                                                              |
| skip_upload_metadata               | false                                                              |
| skip_upload_changelogs             | false                                                              |
| skip_upload_images                 | false                                                              |
| skip_upload_screenshots            | false                                                              |
| track_promote_release_status       | completed                                                          |
| validate_only                      | false                                                              |
| check_superseded_tracks            | false                                                              |
| timeout                            | 300                                                                |
| deactivate_on_promote              | true                                                               |
| changes_not_sent_for_review        | false                                                              |
| rescue_changes_not_sent_for_review | true                                                               |
| ack_bundle_installation_warning    | false                                                              |
+------------------------------------+--------------------------------------------------------------------+

[09:28:36]: Preparing aab at path '/home/vsts/work/1/golive-Android-Production/xxx-release.aab' for upload...
[09:29:02]: Updating track 'beta'...
[09:29:03]: Preparing to upload for language 'de-DE'...
[09:29:04]: Updating changelog for '14551' and language 'de-DE' to default changelog...
[09:29:04]: Preparing to upload for language 'en-US'...
[09:29:04]: Uploading image file fastlane/metadata/android/xxx/en-US/images/featureGraphic.png...
[09:29:07]: Uploading image file fastlane/metadata/android/xxx/en-US/images/icon.png...
[09:29:10]: Uploading screenshot fastlane/metadata/android/xxx/en-US/images/phoneScreenshots/1_en-US.png...
+---------------+---------------------------+
|               Lane Context                |
+---------------+---------------------------+
| ENVIRONMENT   | xxx                    |
| PLATFORM_NAME | android                   |
| LANE_NAME     | android release_playstore |
+---------------+---------------------------+
[09:29:12]: 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.

+------+---------------+-------------+
|          fastlane summary          |
+------+---------------+-------------+
| Step | Action        | Time (in s) |
+------+---------------+-------------+
| 1    | opt_out_usage | 0           |
| 💥   | supply        | 37          |
+------+---------------+-------------+
[09:29:12]: fastlane finished with errors

[!] 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.
 [REPLACE THIS WITH YOUR INFORMATION] 

Environment

 [REPLACE THIS WITH YOUR INFORMATION] 
@denissb denissb changed the title Google Api Error: Unauthorized - Request is missing required authentication credential. Google Api Error: Unauthorized - Request is missing required authentication credential when trying to do a Google Play release Sep 13, 2023
@hemachandsai
Copy link

+1

@chrisvire
Copy link

I am also experiencing this across several stores that have been publishing fine for years. Here is one of the failures.

🚫 fastlane environment 🚫

Stack

Key Value
OS debian_based buster/sid
Ruby 2.7.1
Bundler? false
Git git version 2.17.1
Installation Source ~/.rbenv/versions/2.7.1/bin/fastlane
Host Ubuntu 18.04.4 LTS debian_based buster/sid (4.14.291-218.527.amzn2.x86_64)
Ruby Lib Dir ~/.rbenv/versions/2.7.1/lib
OpenSSL Version OpenSSL 1.1.1 11 Sep 2018
Is contained false
Is homebrew false
Is installed via Fabric.app false

System Locale

Variable Value
LANG en_US.UTF-8 ✅
LC_ALL en_US.UTF-8 ✅
LANGUAGE en_US:en 🚫

fastlane files:

No Fastfile found

No Appfile found

fastlane gems

Gem Version Update-Status
fastlane 2.214.0 ✅ Up-To-Date

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
did_you_mean 1.4.0
atomos 0.1.3
CFPropertyList 3.0.6
claide 1.1.0
colored2 3.1.2
nanaimo 0.3.0
rexml 3.2.6
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.3
addressable 2.8.5
multipart-post 2.3.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.100.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.7
gh_inspector 1.1.3
json 2.3.0
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.1.4
simctl 1.6.10
jwt 2.7.1
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.5
memoist 0.16.2
multi_json 1.15.0
os 1.1.4
signet 0.17.0
googleauth 1.7.0
httpclient 2.8.3
webrick 1.6.0
google-apis-core 0.11.1
google-apis-playcustomapp_v1 0.13.0
google-apis-androidpublisher_v3 0.48.0
google-cloud-env 1.6.0
google-cloud-errors 1.3.1
google-cloud-core 1.6.0
google-apis-iamcredentials_v1 0.17.0
google-apis-storage_v1 0.19.0
rake 13.0.1
digest-crc 0.6.5
google-cloud-storage 1.44.0
emoji_regex 3.2.3
jmespath 1.6.2
aws-partitions 1.805.0
aws-eventstream 1.2.0
aws-sigv4 1.6.0
aws-sdk-core 3.180.3
aws-sdk-kms 1.71.0
aws-sdk-s3 1.132.1
uri 0.10.0
forwardable 1.3.1
logger 1.4.2
cgi 0.1.0
date 3.0.0
timeout 0.1.0
stringio 0.1.0
ipaddr 1.2.2
openssl 2.1.2
zlib 1.1.0
mutex_m 0.1.0
ostruct 0.2.0
strscan 1.0.3
io-console 0.5.6
delegate 0.1.0
fileutils 1.4.1
etc 1.1.0
singleton 0.1.0
open3 0.1.0
yaml 0.1.0
psych 3.1.0

generated on: 2023-09-12

 +------------------------------------+--------------------------------------+
|                        �[32mSummary for supply 2.214.0�[0m                         |
+------------------------------------+--------------------------------------+
| package_name                       | org.scriptureearth.qxl.salasaca.qui  |
|                                    | chua                                 |
| version_code                       | 20                                   |
| release_status                     | completed                            |
| track                              | production                           |
| metadata_path                      | play-listing                         |
| json_key                           | /secrets/playstore_api.json          |
| apk                                | /artifacts/qxl_Salasaca_Quichua_Bib  |
|                                    | lia-11.0.2.apk                       |
| skip_upload_apk                    | false                                |
| skip_upload_aab                    | false                                |
| skip_upload_metadata               | false                                |
| skip_upload_changelogs             | false                                |
| skip_upload_images                 | false                                |
| skip_upload_screenshots            | false                                |
| track_promote_release_status       | completed                            |
| validate_only                      | false                                |
| check_superseded_tracks            | false                                |
| timeout                            | 300                                  |
| deactivate_on_promote              | true                                 |
| changes_not_sent_for_review        | false                                |
| rescue_changes_not_sent_for_review | true                                 |
| ack_bundle_installation_warning    | false                                |
+------------------------------------+--------------------------------------+

DEBUG [2023-09-12 20:52:40.79]: Fetching a new access token from Google...
INFO [2023-09-12 20:52:41.49]: Preparing apk at path '/artifacts/qxl_Salasaca_Quichua_Biblia-11.0.2.apk' for upload...
INFO [2023-09-12 20:52:45.14]: 	Version Code: 20
INFO [2023-09-12 20:52:45.14]: Updating track 'production'...
INFO [2023-09-12 20:52:46.09]: Preparing to upload for language 'en-US'...
INFO [2023-09-12 20:52:46.72]: Uploading image file play-listing/en-US/images/featureGraphic.png...
INFO [2023-09-12 20:52:48.80]: Uploading image file play-listing/en-US/images/icon.png...
INFO [2023-09-12 20:52:50.74]: Uploading screenshot play-listing/en-US/images/phoneScreenshots/qxl1.png...
INFO [2023-09-12 20:52:52.44]: Uploading screenshot play-listing/en-US/images/phoneScreenshots/qxl2.png...
INFO [2023-09-12 20:52:54.29]: Uploading screenshot play-listing/en-US/images/phoneScreenshots/qxl3.png...
/root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/fastlane_core/lib/fastlane_core/ui/interface.rb:141:in `user_error!': \e[31m[!] 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.\e[0m (FastlaneCore::Interface::FastlaneError)
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in `method_missing'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/client.rb:95:in `rescue in call_google_api'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/client.rb:80:in `call_google_api'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/client.rb:573:in `upload_image'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:290:in `block (2 levels) in upload_screenshots'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:288:in `each'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:288:in `block in upload_screenshots'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:281:in `each'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:281:in `upload_screenshots'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:100:in `block (2 levels) in perform_upload_meta'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:92:in `each'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:92:in `block in perform_upload_meta'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:84:in `each'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:84:in `perform_upload_meta'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:35:in `perform_upload'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/commands_generator.rb:40:in `block (2 levels) in run'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in `run!'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/commands_generator.rb:61:in `run'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/commands_generator.rb:13:in `start'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/cli_tools_distributor.rb:115:in `take_off'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/bin/fastlane:23:in `<top (required)>'
	from /root/.rbenv/versions/2.7.1/bin/fastlane:23:in `load'
	from /root/.rbenv/versions/2.7.1/bin/fastlane:23:in `<main>'
/root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/google-apis-core-0.11.1/lib/google/apis/core/http_command.rb:230:in `check_status': Unauthorized (Google::Apis::AuthorizationError)
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/google-apis-core-0.11.1/lib/google/apis/core/api_command.rb:137:in `check_status'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/google-apis-core-0.11.1/lib/google/apis/core/http_command.rb:202:in `process_response'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/google-apis-core-0.11.1/lib/google/apis/core/upload.rb:174:in `process_response'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/google-apis-core-0.11.1/lib/google/apis/core/upload.rb:259:in `execute_once'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/google-apis-core-0.11.1/lib/google/apis/core/http_command.rb:126:in `block (2 levels) in do_retry'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `times'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/google-apis-core-0.11.1/lib/google/apis/core/http_command.rb:123:in `block in do_retry'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `times'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/google-apis-core-0.11.1/lib/google/apis/core/http_command.rb:113:in `do_retry'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/google-apis-core-0.11.1/lib/google/apis/core/http_command.rb:104:in `execute'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/google-apis-core-0.11.1/lib/google/apis/core/base_service.rb:418:in `execute_or_queue_command'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/google-apis-androidpublisher_v3-0.48.0/lib/google/apis/androidpublisher_v3/service.rb:1078:in `upload_edit_image'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/client.rb:574:in `block in upload_image'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/client.rb:81:in `call_google_api'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/client.rb:573:in `upload_image'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:290:in `block (2 levels) in upload_screenshots'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:288:in `each'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:288:in `block in upload_screenshots'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:281:in `each'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:281:in `upload_screenshots'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:100:in `block (2 levels) in perform_upload_meta'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:92:in `each'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:92:in `block in perform_upload_meta'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:84:in `each'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:84:in `perform_upload_meta'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/uploader.rb:35:in `perform_upload'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/commands_generator.rb:40:in `block (2 levels) in run'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in `run!'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/commands_generator.rb:61:in `run'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/commands_generator.rb:13:in `start'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/cli_tools_distributor.rb:115:in `take_off'
	from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/fastlane-2.214.0/bin/fastlane:23:in `<top (required)>'
	from /root/.rbenv/versions/2.7.1/bin/fastlane:23:in `load'
	from /root/.rbenv/versions/2.7.1/bin/fastlane:23:in `<main>'

@clemissile
Copy link

+1
Same since this morning, with jobs who were running just fine moments before.

+------+------------------------+-------------+
|              fastlane summary               |
+------+------------------------+-------------+
| Step | Action                 | Time (in s) |
+------+------------------------+-------------+
| 1    | default_platform       | 0           |
| 2    | load_json              | 0           |
| 3    | increment_version_name | 0           |
| 4    | bundleRelease          | 664         |
| 💥   | upload_to_play_store   | 34          |
+------+------------------------+-------------+
[12:05:50]: fastlane finished with errors
[!] 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.

@thangphanurani
Copy link

the same :(

@markpar
Copy link

markpar commented Sep 13, 2023

Our nightly build hit this same error about 9 hours ago. I re-ran the process 15 minutes ago and again received the error. Then I ran it again with the --verbose flag and this time the upload was successful! Maybe it was an issue on Google's end that they have resolved? My gut doubts that the --verbose flag had an effect.

@chrisvire
Copy link

@markpar I report above was executed with the --verbose flag and it was an error.

@wxxedu
Copy link

wxxedu commented Sep 13, 2023

I think that this has been an issue with Google service accounts. My upload did not work and my RevenueCat service account also broke down.

@sregg
Copy link

sregg commented Sep 13, 2023

Lots of folks are (were?) having the same issue here: #21091

@nverdavtyan
Copy link

hey i have same problem

@bogdannedelcu
Copy link

bogdannedelcu commented Sep 14, 2023

+1
works after retry

@jonatasteixeira
Copy link

Same problem here!

@vareversat
Copy link

Same problem here

@scott-hill-alkami
Copy link

Try setting the root_url:

upload_to_play_store(
    root_url: "https://androidpublisher.googleapis.com/",
    ...
)

@dlorddd
Copy link

dlorddd commented Sep 15, 2023

Try setting the root_url:

upload_to_play_store(
    root_url: "https://androidpublisher.googleapis.com/",
    ...
)

This worked for me.

@thangphanurani
Copy link

thangphanurani commented Sep 15, 2023

Try setting the root_url:

upload_to_play_store(
    root_url: "https://androidpublisher.googleapis.com/",
    ...
)

That worked, thanks

@patelnishantk
Copy link

Try setting the root_url:

upload_to_play_store(
    root_url: "https://androidpublisher.googleapis.com/",
    ...
)

Worked for me as well. Thanks!

@enginegl
Copy link

Try setting the root_url:

upload_to_play_store(
    root_url: "https://androidpublisher.googleapis.com/",
    ...
)

Didn't help for screenshots uploading

@nzaghini-phorest
Copy link

Try setting the root_url:

upload_to_play_store(
    root_url: "https://androidpublisher.googleapis.com/",
    ...
)

Didn't help for screenshots uploading

same here sadly

@impactotecnologico
Copy link

+1
I'm using MS Appcenter to build and publish the app, how can I set the root_url: "https://androidpublisher.googleapis.com/"?

@AliSoftware
Copy link
Contributor

AliSoftware commented Sep 15, 2023

I'm pretty sure the issue is on Google's end, because the request failure is completely random, sometimes it passes sometimes it doesn't.

When you're doing only one apk upload request to the Google API it can be enough to retry a couple of times until it passes, but if you need to upload new screenshots for example, that requires many Google API calls (one per image upload), so there is a way higher chance that one of them will fail along the many ones that are sent.


In the meantime—i.e. until Google fixes it on their end—I was able to apply a quick-and-dirty patch to my local copy of the fastlane gem:

  1. Open vendor/bundle/ruby/2.7.0/gems/fastlane-2.214.0/supply/lib/supply/client.rb in your favorite code editor
    • Adjust the path to wherever your local fastlane gem is located (e.g. if you don't use bundler or don't use vendor/bundle as your BUNDLE_PATH for your bundler config like we do)
    • Adjust the -2.214.0 in that path according to which fastlane version your project is using
      Apply the following changes to the call_google_api method
  2. Apply the following changes to the def call_google_api method:
     def call_google_api
+      tries_left ||= 5
       yield if block_given?
     rescue Google::Apis::Error => e
       error = begin
@@ -92,7 +93,13 @@ module Supply
         message = e.body
       end
 
-      UI.user_error!("Google Api Error: #{e.message} - #{message}")
+      if tries_left.positive?
+        UI.error("Google Api Error: #{e.message} - #{message} - Retrying...")
+        tries_left -= 1
+        retry
+      else
+        UI.user_error!("Google Api Error: #{e.message} - #{message}")
+      end
     end

Obviously this is a temporary workaround and dirty patch, that is only aimed to get you out of a bind if you need to call upload_to_play_store today and can't wait for Google to fix the issue on their end hopefully soon. Once you're done with it, you should ideally revert that patch (e.g. remove vendor/bundle then re-install the original fastlane gem code from scratch using bundle install again).


Note about why not making a PR to fastlane with that patch

I thought about submitting a PR to fastlane but I think this would need a nicer implementation than my dirty patch above — especially adding a max_retries option to Supply::Options that you could then pass as a parameter to upload_to_play_store, etc.

Also I'm pretty sure this is a very exceptional case that we should probably not officially cover for in fastlane's end but in GoogleApis' end, as the Google::Apis gem that supply uses internally already implements a retry mechanism.

Indeed, the reason why this mechanism from the Google:Apis gem doesn't retry in the case we're seeing here is because Google::Apis::AuthorizationError is not one of the codes for which they retry; which makes sense because if the error was really about the request not including an OAuth token in the headers or had incorrect credentials, there would be no point in retrying the exact same request (still without valid authentication) over and over anyway. Which kinda confirms that this being a random issue is really on Google servers' side.

@scott-hill-alkami
Copy link

Unfortunately, setting the root_url does not solve the issue...
This seems to be a timing issue like the lease on the authorization token is not long enough. The deployment does not always fail in the same spot and network speed seems to play apart as well.

The only way I have been able to get an app uploaded with upload_to_play_store is by disabling the image and screenshots.
I've even tried uploading them separately but it always seems to fail at some point uploading screenshots.

upload_to_play_store(
    root_url: "https://androidpublisher.googleapis.com/",
     skip_upload_images: true,
     skip_upload_screenshots: true,
    ...
)

@dsyrstad
Copy link

Like @AliSoftware, I just wrote a script to repeatedly keep trying the deployment and it eventually goes through. It's a problem on Google's end.

@MauScheff
Copy link

MauScheff commented Sep 15, 2023

When deploying manually I found a new paid applications agreement, I think it could be correlated, although accepting the agreement doesn't immediately fix this problem.

chrisvire added a commit to sillsdev/docker-appbuilder-agent that referenced this issue Sep 15, 2023
* fastlane/fastlane#21507
* Google Api Error: Unauthorized - Request is missing required
  authentication credentials
* Retry
chrisvire added a commit to sillsdev/docker-appbuilder-agent that referenced this issue Sep 15, 2023
* fastlane/fastlane#21507
* Google Api Error: Unauthorized - Request is missing required
  authentication credentials
* Retry
chrisvire added a commit to sillsdev/appbuilder-buildengine-api that referenced this issue Sep 18, 2023
lpusok added a commit to bitrise-steplib/steps-google-play-deploy that referenced this issue Sep 18, 2023
Similar workaround to fastlane/fastlane#21507 (comment).
Retry HTTP calls when 401 is (randomly) returned by Google, that causes customer impact.
@alefwd
Copy link

alefwd commented Sep 19, 2023

Try setting the root_url:

upload_to_play_store(
    root_url: "https://androidpublisher.googleapis.com/",
    ...
)

This worked for me

hyuwah added a commit to hyuwah/imusic that referenced this issue Sep 19, 2023
- update fastlane to 2.15.1 which includes fix for the following [issue](fastlane/fastlane#21507)
- also adds `root_url` to the upload_playstore_internal lane
@rodrigo-lima
Copy link

2.215.1 + SUPPLY_UPLOAD_MAX_RETRIES did the trick for us!
Thank you !

@kmajor
Copy link

kmajor commented Sep 20, 2023

2.216.0 + SUPPLY_UPLOAD_MAX_RETRIES did the trick for me.
Thanks @AliSoftware

@agbamajeremiah
Copy link

2.215.1 + SUPPLY_UPLOAD_MAX_RETRIES did the trick for us! Thank you !

How can I add this to my Fastfile.. Kindly, drop screenshot of how you did it.

@agbamajeremiah
Copy link

2.215.1 + SUPPLY_UPLOAD_MAX_RETRIES did the trick for us! Thank you !

Can you share a code snippet of how you set SUPPLY_UPLOAD_MAX_RETRIES?

@anh1979
Copy link

anh1979 commented Sep 20, 2023

2.215.1 + SUPPLY_UPLOAD_MAX_RETRIES did the trick for us! Thank you !

Can you share a code snippet of how you set SUPPLY_UPLOAD_MAX_RETRIES?

See #21507 (comment)
Description already given there!

@SamuelGadiel
Copy link

Try setting the root_url:

upload_to_play_store(
    root_url: "https://androidpublisher.googleapis.com/",
    ...
)

Worked as a charm! Thank you

@rodrigo-lima
Copy link

As @anh1979 mentioned, after updating Fastlane version, we added the SUPPLY_UPLOAD_MAX_RETRIES to our Jenkins pipeline and it just worked...
Even saw the Retring... message in the logs

fl-21507

@AliSoftware
Copy link
Contributor

AliSoftware commented Sep 21, 2023

Someone on the Android DevRel team at Google contacted me 5h ago saying they were made aware of this and were monitoring this GitHub issue, and that the Play team had identified an issue which may have contributed to this issue and believe they have now fixed this. 🤞

They added:

It isn't confirmed that the issue that they identified and fixed was indeed the cause of the issue Fastlane has been experiencing, but we'd be interested to know whether users of Fastlane are now seeing an improvement, with no more failures, and no more need for retries?

So feel free to comment here to indicate if from now on your upload_to_play_store calls don't even need retrying anymore and the issue is fixed, or if you're still experiencing issues even after their patch.

vareversat added a commit to vareversat/chabo-app that referenced this issue Sep 21, 2023
vareversat added a commit to vareversat/chabo-app that referenced this issue Sep 23, 2023
vareversat added a commit to vareversat/chabo-app that referenced this issue Sep 23, 2023
* chore(deps): update fastlane to v2.213.0

* feat(notifications): allow user to use keyboard to edit time based notifications

* feat(boat-notifications): change the notification message to know if the boat is coming or is leaving Bordeaux

* chore(version): increment version to `v1.9.2`

* test 1

* feat(ui): rework of the forecast widget

* fix(boats-detection): fix the regex to better match multi boat events

* fix(multi-day-detection): the events spread over to day are now correctly detected

* feat(ui): complete redesign of the forecast information dialog

* feat(ui): remove closure time on forecast info bottom sheet

* feat(ui): add animations and little tweeks

* chore(deps): run `flutter pub upgrade`

* feat(ui): set `maxWidth` for tablet mode for the info bottom sheet

* feat(docked-boat): display the current docker boat in the Moon harbord (#79)

* WIP

* test 1

* feat(ui): rework of the forecast widget

* fix(multi-day-detection): the events spread over to day are now correctly detected

* chore(ci): set the reporter on github when running `flutter test`

* feat(ui): complete redesign of the forecast information dialog

* feat(ui): remove closure time on forecast info bottom sheet

* feat(ui): add animations and little tweeks

* chore(deps): run `flutter pub upgrade`

* feat(ui): set `maxWidth` for tablet mode for the info bottom sheet

* chore(ui): set the highlight color to warningColor

* chore(ci): run `dart format lib`

* WIP

* add test

* chore: remove unused file

* fix typo

* chore(ui): adjust the size of the status tile more pricesily

* fix(ui): set the correct color in the info bottom sheet

* fix(ui): lower the border width

* chore(ui): rework forecast widget

* chore(playstore): regenerate all screenshots

* chore(version): increment version to `v2.0.0`

* chore(deps): update actions/checkout to v3.5.3

* chore(deps): update kotlin_version to v1.8.22

* chore(deps): update androidx.window:window to v1.1.0

* chore(deps): update androidx.window:window-java to v1.1.0

* chore(deps): update ruby/setup-ruby to v1.151.0

* feat(ui): add divider to MontWidget

* fix(ui): prevent day to overlap with the warning icon

* fix(ui): make more readable if a boat is leaving or not

* chore(changelogs): move all CHANGELOGS into a proper directory

* chore(licenses): add OFL (Open Font License) to license list

* feat(ui): set dynamic font size for the main text & move the moon harbor button status

* fix(bug): the arriving boat count was wrong during an event where one is leaving and another is coming

* fix(typo): fix french translation when the brisge will soon close

* chore(flutter): add all missing files

* feat(vessel-info): change vessel info redirect page

* chore(ci): run `dart format lib`

* fix(translation): set new translation keys for better handling

* feat(wine-festival): add support for the Wine Festival Event

* chore(version): increment version to `v2.1.0`

* chore(deps): update ruby/setup-ruby to v1.152.0

* chore(apm): add sentry integration

* chore(ci): run `dart format lib`

* fix(ci): add missing `$`

* chore(ads): add consent management platform (CMP) to comply to new regulation

* chore(sentry): add custom integration for sentry

* fix(ci): typo in Sentry secret name

* chore(version): increment version to `v2.2.0`

* fix: CI & default env value

* chore(deps): update animated_toggle_switch to ^0.7.0

* chore(sentry): improve integration

* chore(ci): run `dart format lib`

* ci: fix `--dart-define` usage

* chore(deps): update gradle to v7.6.2

* chore(deps): update flutter_local_notifications to v15 (#91)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat: rework of the 'About' page

* feat: add fr and es privacy policies

* fix: add missing translated pages for site

* fix: asset pages for privacy pages

* fix: ui tweaks

* chore(version): increment version to `v2.3.0`

* chore(deps): update kotlin_version to v1.9.0

* fix: the sentry_dsn value is now correctly injected during the build process

* fix: wrong job for sentry_dsn secret injection

* chore: fix Android build by downgrading the kotlin version to ´1.8´

* chore: refresh the ´.gitignore´ file

* fix: portrait mode was broken when a info widget was open

* fix: rate link broke if we cancel the Android in App rating

* chore: adjust padding for the About Screen

* fix: make ´check_secret_decryption.sh´ and ´decrypt_secret.sh´executable

* chore: refresh store screen captures

* chore(version): increment version to `v2.3.1`

* chore(version): upgrade main to v2.1.0 (#87)

* chore(deps): update fastlane to v2.213.0

* fix(notifications): prevent Android notifications from being stuck on lockscreen

* feat(notifications): allow user to use keyboard to edit time based notifications

* feat(boat-notifications): change the notification message to know if the boat is coming or is leaving Bordeaux

* fix(CI): set the correct Changelog path on new tag

* chore(version): increment version to `v1.9.2`

* test 1

* feat(ui): rework of the forecast widget

* fix(boats-detection): fix the regex to better match multi boat events

* fix(multi-day-detection): the events spread over to day are now correctly detected

* chore(ci): set the reporter on github when running `flutter test`

* feat(ui): complete redesign of the forecast information dialog

* feat(ui): remove closure time on forecast info bottom sheet

* feat(ui): add animations and little tweeks

* chore(deps): run `flutter pub upgrade`

* feat(ui): set `maxWidth` for tablet mode for the info bottom sheet

* chore(ui): set the highlight color to warningColor

* feat(docked-boat): display the current docker boat in the Moon harbord (#79)

* WIP

* test 1

* feat(ui): rework of the forecast widget

* fix(multi-day-detection): the events spread over to day are now correctly detected

* chore(ci): set the reporter on github when running `flutter test`

* feat(ui): complete redesign of the forecast information dialog

* feat(ui): remove closure time on forecast info bottom sheet

* feat(ui): add animations and little tweeks

* chore(deps): run `flutter pub upgrade`

* feat(ui): set `maxWidth` for tablet mode for the info bottom sheet

* chore(ui): set the highlight color to warningColor

* chore(ci): run `dart format lib`

* WIP

* add test

* chore: remove unused file

* fix typo

* chore(ui): adjust the size of the status tile more pricesily

* fix(ui): set the correct color in the info bottom sheet

* fix(ui): lower the border width

* chore(ui): rework forecast widget

* chore(playstore): regenerate all screenshots

* chore(version): increment version to `v2.0.0`

* chore(deps): update actions/checkout to v3.5.3

* chore(deps): update kotlin_version to v1.8.22

* chore(deps): update androidx.window:window to v1.1.0

* chore(deps): update androidx.window:window-java to v1.1.0

* chore(deps): update ruby/setup-ruby to v1.151.0

* feat(ui): add divider to MontWidget

* fix(ui): prevent day to overlap with the warning icon

* fix(ui): make more readable if a boat is leaving or not

* chore(changelogs): move all CHANGELOGS into a proper directory

* chore(licenses): add OFL (Open Font License) to license list

* feat(ui): set dynamic font size for the main text & move the moon harbor button status

* fix(bug): the arriving boat count was wrong during an event where one is leaving and another is coming

* fix(typo): fix french translation when the brisge will soon close

* fix(typo)

* chore(flutter): add all missing files

* feat(vessel-info): change vessel info redirect page

* chore(ui): change the theme picker color

* chore(ui): change the day picker color

* chore(ci): run `dart format lib`

* fix(translation): set new translation keys for better handling

* feat(wine-festival): add support for the Wine Festival Event

* chore(version): increment version to `v2.1.0`

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(ci): remove dart code metrics package (the free version is not anymore maintained)

* chore(deps): update fastlane to v2.214.0

* chore: run ´flutter pub upgrade --major-versions´

* chore: change like due to a git repo rename

* chore(deps): update kotlin_version to v1.9.10

* chore(deps): update actions/checkout to v3.6.0

* chore(deps): update animated_toggle_switch to ^0.8.0

* fix: set correct params value following [email protected] update

* fix: set kotlin version to ´1.8.0´

* chore: upgrade to flutter ´3.13.3´

* chore: fix README.md (repo URL changed)

* feat: add the user the ability to choose the time format (#101)

* feat: add the user the ability to choose the time format

* chore: add missing tests

* chore: run ´flutter pub upgrade --major-versions´

* fix: set valid project name ('-' => '_')

* chore(version): increment version to `v2.4.0`

* chore(deps): update actions/checkout to v4

* fix(time-format): the notifications now correctly use the time format picked by the user

* fix(settings): set the correct behaviour when device is in landscape mode

* fix(ui): move the button when the screen is in portrait mode on the about screen

* fix(ui): when the device is in portrait mode, the setting buttons are now correctly displayed

* fix(ui): set the correct behaviour an tablet for bottom bar

* chore(version): increment version to `v2.4.1`

* fix(ui): buttons are now displayed properly when the "About screen" is in landscape mode

* chore(version): increment version to `v2.4.2`

* chore(deps): update ruby/setup-ruby to v1.153.0

* chore(deps): update google_fonts to v6

* chore(deps): update fastlane to v2.215.1

* fix(deps): set correct version of fastlane into Gemfile.lock

* feat(ui): set special UI for the King's Charles boat

* Revert "feat(ui): set special UI for the King's Charles boat"

This reverts commit e79452b.

* fix(ci): set ´SUPPLY_UPLOAD_MAX_RETRIES´ env var to prevent fastlane from failing

See fastlane/fastlane#21507 (comment)

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
L3o-pold added a commit to Infomaniak/mobile-kchat that referenced this issue Sep 25, 2023
L3o-pold added a commit to Infomaniak/mobile-kchat that referenced this issue Sep 25, 2023
@CoryWritesCode
Copy link

@AliSoftware I'm not seeing our builds have to retry anymore. Just as a note like you mention.

@CoryWritesCode
Copy link

Try setting the root_url:

upload_to_play_store(
    root_url: "https://androidpublisher.googleapis.com/",
    ...
)

Worked as a charm! Thank you

As an additional note, we started doing this before google fixed their systems and is seems like our build is getting lost in the aether as it says upload successful but the build never shows up in the google console.

@zsilverzweig
Copy link

zsilverzweig commented Nov 9, 2023

I'm still getting this error and not able to resolve with the above, here is my lane:

lane :update_images do
ENV['SUPPLY_UPLOAD_MAX_RETRIES']='5'
supply(
root_url: "https://androidpublisher.googleapis.com/",
json_key: ENV["PLAY_STORE_KEY_FILEPATH"],
skip_upload_apk: true,
skip_upload_aab: true,
skip_upload_metadata: true,
skip_upload_changelogs: true,
skip_upload_images: false,
)
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet