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

Fastlane fails when downloading metadata from Google Play #19926

Closed
4 tasks done
tkorri opened this issue Feb 8, 2022 · 1 comment · Fixed by #20010
Closed
4 tasks done

Fastlane fails when downloading metadata from Google Play #19926

tkorri opened this issue Feb 8, 2022 · 1 comment · Fixed by #20010
Labels
tool: supply upload_to_playstore

Comments

@tkorri
Copy link
Contributor

tkorri commented Feb 8, 2022

New Issue Checklist

Issue Description

I have an application on Google Play store which has the same release versions on internal and alpha tracks, no other tracks are used at this point.

When I try to download release metadata with download_from_play_store() Fastlane fails with
Unable to find version '1.0.0' for 'net.korri.example.fastlane' in all tracks. Please double check the version number.

This failure is happening because download_from_play_store() executes Supply::Setup.new.perform_download which calls client.release_listings(Supply.config[:version_name]), and this fails when multiple tracks contain the version but neither production nor beta are on the list:

# Verify that tracks have releases
filtered_tracks = tracks.select { |t| !t.releases.nil? && t.releases.any? { |r| r.name == version } }
if filtered_tracks.length > 1
# Production track takes precedence if version is present in multiple tracks
# E.g.: A release might've been promoted from Alpha/Beta track. This means the release will be present in two or more tracks
if filtered_tracks.any? { |t| t.track == Supply::Tracks::DEFAULT }
filtered_tracks = filtered_tracks.select { |t| t.track == Supply::Tracks::DEFAULT }
else
# E.g.: A release might be in both Alpha & Beta (not sure if this is possible, just catching if it ever happens), giving Beta precedence.
filtered_tracks = filtered_tracks.select { |t| t.track == Supply::Tracks::BETA }
end
end
filtered_track = filtered_tracks.first
if filtered_track.nil?
UI.user_error!("Unable to find version '#{version}' for '#{current_package_name}' in all tracks. Please double check the version number.")
return nil
else
UI.message("Found '#{version}' in '#{filtered_track.track}' track.")
end

This failure happens even when track has been given as a parameter to the download_from_play_store() call.

The fix would be to either obey the track parameter if it's available, and/or extend the track selection logic in client.release_listings() to include alpha and internal tracks.

Command executed

bundle exec fastlane metadatas

Complete output when running fastlane, including the stack trace and command used
 
$ bundle exec fastlane metadatas
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:29: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:118: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:118: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:35: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:35: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:44: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:118: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
[✔] 🚀
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:35: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:35: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:29: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:118: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:118: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:35: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:35: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:44: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:118: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:29: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:118: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:118: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:35: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:35: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:44: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/usr/local/lib/ruby/gems/3.0.0/gems/bundler-1.17.2/lib/bundler/shared_helpers.rb:118: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
[13:37:22]: ----------------------------------------
[13:37:22]: --- Step: Verifying fastlane version ---
[13:37:22]: ----------------------------------------
[13:37:22]: Your fastlane version 2.204.2 matches the minimum requirement of 2.68.2  ✅
[13:37:22]: ------------------------------
[13:37:22]: --- Step: default_platform ---
[13:37:22]: ------------------------------
[13:37:22]: Driving the lane 'android metadatas' 🚀
[13:37:22]: --------------------------------------
[13:37:22]: --- Step: download_from_play_store ---
[13:37:22]: --------------------------------------
[13:37:22]: 🕗  Downloading metadata, images, screenshots...
[13:37:24]: 📝  Downloading metadata (fi-FI)
[13:37:24]: Writing to fastlane/metadata/android/fi-FI/title.txt...
[13:37:24]: Writing to fastlane/metadata/android/fi-FI/short_description.txt...
[13:37:24]: Writing to fastlane/metadata/android/fi-FI/full_description.txt...
[13:37:24]: Writing to fastlane/metadata/android/fi-FI/video.txt...
[13:37:24]: 🖼️  Downloading images (fi-FI)
[13:37:24]: Downloading `featureGraphic` for fi-FI...
[13:37:24]: 	Downloaded - fastlane/metadata/android/fi-FI/images/featureGraphic.png
[13:37:24]: Downloading `icon` for fi-FI...
[13:37:25]: 	Downloaded - fastlane/metadata/android/fi-FI/images/icon.png
[13:37:25]: Downloading `tvBanner` for fi-FI...
[13:37:25]: Downloading `phoneScreenshots` for fi-FI...
[13:37:26]: 	Downloaded - fastlane/metadata/android/fi-FI/images/phoneScreenshots/1_fi-FI.png
[13:37:26]: 	Downloaded - fastlane/metadata/android/fi-FI/images/phoneScreenshots/2_fi-FI.png
[13:37:26]: Downloading `sevenInchScreenshots` for fi-FI...
[13:37:27]: Downloading `tenInchScreenshots` for fi-FI...
[13:37:27]: Downloading `tvScreenshots` for fi-FI...
[13:37:27]: Downloading `wearScreenshots` for fi-FI...
+------------------+-------------------+
|             Lane Context             |
+------------------+-------------------+
| DEFAULT_PLATFORM | android           |
| PLATFORM_NAME    | android           |
| LANE_NAME        | android metadatas |
+------------------+-------------------+
[13:37:29]: Unable to find version '1.0.0' for 'net.korri.example.fastlane' in all tracks. Please double check the version number.

+------+----------------------------+-------------+
| fastlane summary |
+------+----------------------------+-------------+
| Step | Action | Time (in s) |
+------+----------------------------+-------------+
| 1 | Verifying fastlane version | 0 |
| 2 | default_platform | 0 |
| 💥 | download_from_play_store | 7 |
+------+----------------------------+-------------+

[13:37:29]: fastlane finished with errors

[!] Unable to find version '1.0.0' for 'net.korri.example.fastlane' in all tracks. Please double check the version number.

Environment

🚫 fastlane environment 🚫

Stack

Key Value
OS 11.6.3
Ruby 3.0.3
Bundler? true
Git git version 2.33.1
Installation Source /usr/local/lib/ruby/gems/3.0.0/bin/fastlane
Host macOS 11.6.3 (20G415)
Ruby Lib Dir /usr/local/Cellar/ruby/3.0.3/lib
OpenSSL Version OpenSSL 1.1.1l 24 Aug 2021
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 13.2.1
Swift Version 5.5.2

System Locale

Error
No Locale with UTF8 found 🚫

fastlane files:

`./fastlane/Fastfile`
fastlane_require 'fileutils'
fastlane_require 'net/http'
fastlane_version "2.68.2"

default_platform :android

platform :android do

  lane :metadatas do |options|
    download_from_play_store(
      package_name: "net.korri.example.fastlane",
      json_key: Dir.pwd + "/Google\ Play\ Android\ Developer.json",
      track: "internal"
    )
  end

end
`./fastlane/Appfile`

fastlane gems

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

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
did_you_mean 1.5.0
bundler 1.17.2
etc 1.3.0
pathname 0.1.0
cgi 0.2.1
set 1.0.1
readline-ext 0.1.1
uri 0.10.1
tsort 0.1.0
forwardable 1.3.2
rake 13.0.6
rexml 3.2.5
CFPropertyList 3.0.5
public_suffix 4.0.6
addressable 2.8.0
artifactory 3.0.15
atomos 0.1.3
aws-eventstream 1.2.0
aws-partitions 1.553.0
aws-sigv4 1.4.0
jmespath 1.5.0
aws-sdk-core 3.126.0
aws-sdk-kms 1.54.0
aws-sdk-s3 1.112.0
babosa 1.0.4
claide 1.1.0
colored 1.2
colored2 3.1.2
highline 2.0.3
commander 4.6.0
declarative 0.0.20
digest-crc 0.6.4
unf_ext 0.0.8
unf 0.1.4
domain_name 0.5.20190701
dotenv 2.7.6
emoji_regex 3.2.3
excon 0.91.0
faraday-em_http 1.0.0
faraday-em_synchrony 1.0.0
faraday-excon 1.1.0
faraday-httpclient 1.0.1
multipart-post 2.0.0
faraday-multipart 1.0.3
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.9.3
http-cookie 1.0.4
faraday-cookie_jar 0.0.7
faraday_middleware 1.2.0
fastimage 2.2.6
gh_inspector 1.1.3
jwt 2.3.0
memoist 0.16.2
multi_json 1.15.0
os 1.1.4
signet 0.16.0
googleauth 1.1.0
httpclient 2.8.3
mini_mime 1.1.2
trailblazer-option 0.1.2
uber 0.1.0
representable 3.1.1
retriable 3.1.2
webrick 1.7.0
google-apis-core 0.4.2
google-apis-androidpublisher_v3 0.16.0
google-apis-playcustomapp_v1 0.7.0
google-apis-iamcredentials_v1 0.10.0
google-apis-storage_v1 0.11.0
google-cloud-env 1.5.0
google-cloud-errors 1.2.0
google-cloud-core 1.6.0
google-cloud-storage 1.36.0
json 2.6.1
mini_magick 4.11.0
naturally 2.2.1
optparse 0.1.1
plist 3.6.0
rubyzip 2.3.2
security 0.1.3
simctl 1.6.8
terminal-notifier 2.0.0
unicode-display_width 1.8.0
terminal-table 1.8.0
tty-screen 0.8.1
tty-cursor 0.7.1
tty-spinner 0.9.3
word_wrap 1.0.0
nanaimo 0.3.0
xcodeproj 1.21.0
rouge 2.0.7
xcpretty 0.3.0
xcpretty-travis-formatter 1.0.1

generated on: 2022-02-08

@max-ott max-ott added the tool: supply upload_to_playstore label Feb 11, 2022
@max-ott
Copy link
Contributor

max-ott commented Feb 11, 2022

Thanks for pointing this out! Feel free to open a pull request adding the other tracks to the logic!

joshdholtz pushed a commit that referenced this issue Feb 26, 2022
Prefer tracks in production, beta, alpha, internal order when
searching for a release version from Play Store.
@fastlane fastlane locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tool: supply upload_to_playstore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants