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

Release app version using new AppStoreConnect API fails for phased release ( The URL path is not valid - The resource 'appStoreVersionReleaseRequests' does not exist ) #17283

Closed
4 tasks done
dcacenabes opened this issue Sep 21, 2020 · 39 comments

Comments

@dcacenabes
Copy link
Contributor

dcacenabes commented Sep 21, 2020

New Issue Checklist

Issue Description

We are trying to release a new version of the app using the new AppStoreConnect API support introduced recently in Fastlane. When trying to do so, we get the following error:
The URL path is not valid - The resource 'appStoreVersionReleaseRequests' does not exist

The app was in a "Pending developer release" state. We had configured a phased release. The app was configured for manual release.

This only happens for phased releases.

We currently have a workaround: #17283 (comment)

Command executed
Spaceship::ConnectAPI.token = token #we generate this token correctly
app = Spaceship::ConnectAPI::App.get(app_id: $applicationId)
version = app.get_latest_app_store_version
status = version.app_store_state
if status == Spaceship::ConnectAPI::AppInfo::AppStoreState::PENDING_DEVELOPER_RELEASE
  version.create_app_store_version_release_request # This is the call that triggers the error
end
Complete output when running fastlane, including the stack trace and command used
Command:
bundle exec fastlane start_release
Output:
[✔] 🚀
+---------------------------------+---------+-------------------------------------------------------------------+
|                                                 Used plugins                                                  |
+---------------------------------+---------+-------------------------------------------------------------------+
| Plugin                          | Version | Action                                                            |
+---------------------------------+---------+-------------------------------------------------------------------+
| fastlane-plugin-bugsnag         | 1.4.1   | upload_symbols_to_bugsnag send_build_to_bugsnag                   |
| fastlane-plugin-appcenter       | 1.8.0   | appcenter_fetch_version_number appcenter_fetch_devices            |
|                                 |         | appcenter_upload                                                  |
| fastlane-plugin-lokalise        | 2.0.11  | add_keys_to_lokalise lokalise lokalise_metadata                   |
| fastlane-plugin-aws_device_farm | 0.3.15  | aws_device_farm aws_device_farm_package                           |
| fastlane-plugin-properties      | 1.1.2   | increment_version_name_in_properties_file set_properties_value    |
|                                 |         | get_properties_value write_properties_file parse_properties_file  |
|                                 |         | increment_version_code_in_properties_file                         |
+---------------------------------+---------+-------------------------------------------------------------------+

11:04:12: --- Step: default_platform ---
11:04:12: ------------------------------
11:04:12: Driving the lane 'ios start_release' 🚀
+------------------+-------------------+
| Lane Context |
+------------------+-------------------+
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | ios |
| LANE_NAME | ios start_release |
+------------------+-------------------+
[11:04:21]: The URL path is not valid - The resource 'appStoreVersionReleaseRequests' does not exist

+------+------------------+-------------+
| fastlane summary |
+------+------------------+-------------+
| Step | Action | Time (in s) |
+------+------------------+-------------+
| 1 | default_platform | 0 |
+------+------------------+-------------+

+-----------------+--------------+----------------+
| Plugin updates available |
+-----------------+--------------+----------------+
| Plugin | Your Version | Latest Version |
+-----------------+--------------+----------------+
| bugsnag | 1.4.1 | 2.0.0 |
| appcenter | 1.8.0 | 1.9.0 |
| aws_device_farm | 0.3.15 | 0.3.17 |
+-----------------+--------------+----------------+
[11:04:21]: To update all plugins, just run
[11:04:21]: $ bundle exec fastlane update_plugins

[11:04:21]: fastlane finished with errors

Looking for related GitHub issues on fastlane/fastlane...

Found no similar issues. To create a new issue, please visit:
https://github.com/fastlane/fastlane/issues/new
Run fastlane env to append the fastlane environment to your issue
bundler: failed to load command: fastlane (/Library/Ruby/Gems/2.6.0/bin/fastlane)
Spaceship::UnexpectedResponse: [!] The URL path is not valid - The resource 'appStoreVersionReleaseRequests' does not exist
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.160.0/spaceship/lib/spaceship/connect_api/api_client.rb:188:in handle_response' /Library/Ruby/Gems/2.6.0/gems/fastlane-2.160.0/spaceship/lib/spaceship/connect_api/api_client.rb:124:in post'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.160.0/spaceship/lib/spaceship/connect_api/tunes/tunes.rb:887:in post_app_store_version_release_request' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/forwardable.rb:230:in post_app_store_version_release_request'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.160.0/spaceship/lib/spaceship/connect_api/models/app_store_version.rb:170:in create_app_store_version_release_request' Fastfile:997:in block (2 levels) in parsing_binding'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.160.0/fastlane/lib/fastlane/lane.rb:33:in call' /Library/Ruby/Gems/2.6.0/gems/fastlane-2.160.0/fastlane/lib/fastlane/runner.rb:49:in block in execute'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.160.0/fastlane/lib/fastlane/runner.rb:45:in chdir' /Library/Ruby/Gems/2.6.0/gems/fastlane-2.160.0/fastlane/lib/fastlane/runner.rb:45:in execute'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.160.0/fastlane/lib/fastlane/lane_manager.rb:47:in cruise_lane' /Library/Ruby/Gems/2.6.0/gems/fastlane-2.160.0/fastlane/lib/fastlane/command_line_handler.rb:36:in handle'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.160.0/fastlane/lib/fastlane/commands_generator.rb:108:in block (2 levels) in run' /Library/Ruby/Gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in call'
/Library/Ruby/Gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in run' /Library/Ruby/Gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in run_active_command'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.160.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in run!' /Library/Ruby/Gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in run!'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.160.0/fastlane/lib/fastlane/commands_generator.rb:352:in run' /Library/Ruby/Gems/2.6.0/gems/fastlane-2.160.0/fastlane/lib/fastlane/commands_generator.rb:41:in start'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.160.0/fastlane/lib/fastlane/cli_tools_distributor.rb:119:in take_off' /Library/Ruby/Gems/2.6.0/gems/fastlane-2.160.0/bin/fastlane:23:in <top (required)>'
/Library/Ruby/Gems/2.6.0/bin/fastlane:23:in load' /Library/Ruby/Gems/2.6.0/bin/fastlane:23:in <top (required)>'

Environment

🚫 fastlane environment 🚫

Stack

Key Value
OS 10.15.6
Ruby 2.6.3
Bundler? true
Git git version 2.24.3 (Apple Git-128)
Installation Source /Library/Ruby/Gems/2.6.0/bin/fastlane
Host Mac OS X 10.15.6 (19G2021)
Ruby Lib Dir /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
OpenSSL Version LibreSSL 2.8.3
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 11.6

System Locale

Error
No Locale with UTF8 found 🚫

fastlane files:

Deleted Fastfile for privacy considerations

No Appfile found

fastlane gems

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

Loaded fastlane plugins:

Plugin Version Update-Status
fastlane-plugin-bugsnag 1.4.1 🚫 Update available
fastlane-plugin-appcenter 1.8.0 🚫 Update available
fastlane-plugin-lokalise 2.0.11 🚫 Update available
fastlane-plugin-aws_device_farm 0.3.15 🚫 Update available
fastlane-plugin-properties 1.1.2 ✅ Up-To-Date
Loaded gems
Gem Version
did_you_mean 1.3.0
bundler 2.1.4
rake 13.0.1
CFPropertyList 3.0.2
ZenTest 4.12.0
RubyInline 3.12.5
concurrent-ruby 1.1.6
i18n 0.9.5
minitest 5.14.0
thread_safe 0.3.6
tzinfo 1.2.6
activesupport 4.2.11.1
public_suffix 4.0.6
addressable 2.7.0
httpclient 2.8.3
json 2.3.1
algoliasearch 1.27.1
atomos 0.1.3
aws-eventstream 1.1.0
aws-partitions 1.373.0
aws-sigv4 1.2.2
jmespath 1.4.0
aws-sdk-core 3.107.0
aws-sdk-accessanalyzer 1.3.0
aws-sdk-acm 1.29.0
aws-sdk-acmpca 1.22.0
aws-sdk-alexaforbusiness 1.34.0
aws-sdk-amplify 1.15.0
aws-sdk-apigateway 1.37.0
aws-sdk-apigatewaymanagementapi 1.12.0
aws-sdk-apigatewayv2 1.18.0
aws-sdk-appconfig 1.3.0
aws-sdk-applicationautoscaling 1.36.0
aws-sdk-applicationdiscoveryservice 1.25.0
aws-sdk-applicationinsights 1.8.0
aws-sdk-appmesh 1.21.0
aws-sdk-appstream 1.39.0
aws-sdk-appsync 1.24.0
aws-sdk-athena 1.24.0
aws-sdk-augmentedairuntime 1.2.0
aws-sdk-autoscaling 1.33.0
aws-sdk-autoscalingplans 1.21.0
aws-sdk-backup 1.12.0
aws-sdk-batch 1.29.0
aws-sdk-budgets 1.28.0
aws-sdk-chime 1.21.0
aws-sdk-cloud9 1.21.0
aws-sdk-clouddirectory 1.22.0
aws-sdk-cloudformation 1.31.0
aws-sdk-cloudfront 1.26.0
aws-sdk-cloudhsm 1.20.0
aws-sdk-cloudhsmv2 1.21.0
aws-sdk-cloudsearch 1.18.0
aws-sdk-cloudsearchdomain 1.17.0
aws-sdk-cloudtrail 1.21.0
aws-sdk-cloudwatch 1.34.0
aws-sdk-cloudwatchevents 1.27.0
aws-sdk-cloudwatchlogs 1.29.0
aws-sdk-codebuild 1.49.0
aws-sdk-codecommit 1.31.0
aws-sdk-codedeploy 1.28.0
aws-sdk-codeguruprofiler 1.2.0
aws-sdk-codegurureviewer 1.1.0
aws-sdk-codepipeline 1.29.0
aws-sdk-codestar 1.19.0
aws-sdk-codestarconnections 1.1.0
aws-sdk-codestarnotifications 1.1.0
aws-sdk-cognitoidentity 1.19.0
aws-sdk-cognitoidentityprovider 1.34.0
aws-sdk-cognitosync 1.17.0
aws-sdk-comprehend 1.30.0
aws-sdk-comprehendmedical 1.14.0
aws-sdk-computeoptimizer 1.1.0
aws-sdk-configservice 1.43.0
aws-sdk-connect 1.23.0
aws-sdk-connectparticipant 1.1.0
aws-sdk-costandusagereportservice 1.19.0
aws-sdk-costexplorer 1.38.0
aws-sdk-databasemigrationservice 1.31.0
aws-sdk-dataexchange 1.1.0
aws-sdk-datapipeline 1.17.0
aws-sdk-datasync 1.18.0
aws-sdk-dax 1.20.0
aws-sdk-detective 1.3.0
aws-sdk-devicefarm 1.31.0
aws-sdk-directconnect 1.27.0
aws-sdk-directoryservice 1.26.0
aws-sdk-dlm 1.25.0
aws-sdk-docdb 1.15.0
aws-sdk-dynamodb 1.45.0
aws-sdk-dynamodbstreams 1.17.0
aws-sdk-ebs 1.2.0
aws-sdk-ec2 1.151.0
aws-sdk-ec2instanceconnect 1.4.0
aws-sdk-ecr 1.26.0
aws-sdk-ecs 1.59.0
aws-sdk-efs 1.26.0
aws-sdk-eks 1.35.0
aws-sdk-elasticache 1.31.0
aws-sdk-elasticbeanstalk 1.27.0
aws-sdk-elasticinference 1.1.0
aws-sdk-elasticloadbalancing 1.20.0
aws-sdk-elasticloadbalancingv2 1.41.0
aws-sdk-elasticsearchservice 1.32.0
aws-sdk-elastictranscoder 1.19.0
aws-sdk-emr 1.25.0
aws-sdk-eventbridge 1.5.0
aws-sdk-firehose 1.25.0
aws-sdk-fms 1.22.0
aws-sdk-forecastqueryservice 1.3.0
aws-sdk-forecastservice 1.3.0
aws-sdk-frauddetector 1.1.0
aws-sdk-fsx 1.17.0
aws-sdk-gamelift 1.28.0
aws-sdk-glacier 1.27.0
aws-sdk-globalaccelerator 1.15.0
aws-sdk-glue 1.50.0
aws-sdk-greengrass 1.29.0
aws-sdk-groundstation 1.6.0
aws-sdk-guardduty 1.28.0
aws-sdk-health 1.22.0
aws-sdk-iam 1.34.0
aws-sdk-imagebuilder 1.3.0
aws-sigv2 1.0.1
aws-sdk-importexport 1.17.0
aws-sdk-inspector 1.24.0
aws-sdk-iot 1.45.0
aws-sdk-iot1clickdevicesservice 1.19.0
aws-sdk-iot1clickprojects 1.19.0
aws-sdk-iotanalytics 1.27.0
aws-sdk-iotdataplane 1.17.0
aws-sdk-iotevents 1.10.0
aws-sdk-ioteventsdata 1.6.0
aws-sdk-iotjobsdataplane 1.18.0
aws-sdk-iotsecuretunneling 1.1.0
aws-sdk-iotthingsgraph 1.5.0
aws-sdk-kafka 1.19.0
aws-sdk-kendra 1.2.0
aws-sdk-kinesis 1.21.0
aws-sdk-kinesisanalytics 1.22.0
aws-sdk-kinesisanalyticsv2 1.14.0
aws-sdk-kinesisvideo 1.22.0
aws-sdk-kinesisvideoarchivedmedia 1.21.0
aws-sdk-kinesisvideomedia 1.19.0
aws-sdk-kinesisvideosignalingchannels 1.1.0
aws-sdk-kms 1.38.0
aws-sdk-lakeformation 1.2.0
aws-sdk-lambda 1.37.0
aws-sdk-lambdapreview 1.17.0
aws-sdk-lex 1.24.0
aws-sdk-lexmodelbuildingservice 1.28.0
aws-sdk-licensemanager 1.12.0
aws-sdk-lightsail 1.29.0
aws-sdk-machinelearning 1.18.0
aws-sdk-macie 1.17.0
aws-sdk-managedblockchain 1.9.0
aws-sdk-marketplacecatalog 1.1.0
aws-sdk-marketplacecommerceanalytics 1.21.0
aws-sdk-marketplaceentitlementservice 1.17.0
aws-sdk-marketplacemetering 1.22.0
aws-sdk-mediaconnect 1.18.0
aws-sdk-mediaconvert 1.44.0
aws-sdk-medialive 1.41.0
aws-sdk-mediapackage 1.26.0
aws-sdk-mediapackagevod 1.10.0
aws-sdk-mediastore 1.22.0
aws-sdk-mediastoredata 1.20.0
aws-sdk-mediatailor 1.24.0
aws-sdk-migrationhub 1.21.0
aws-sdk-migrationhubconfig 1.1.0
aws-sdk-mobile 1.17.0
aws-sdk-mq 1.25.0
aws-sdk-mturk 1.20.0
aws-sdk-neptune 1.22.0
aws-sdk-networkmanager 1.1.0
aws-sdk-opsworks 1.22.0
aws-sdk-opsworkscm 1.30.0
aws-sdk-organizations 1.38.0
aws-sdk-outposts 1.3.0
aws-sdk-personalize 1.10.0
aws-sdk-personalizeevents 1.5.0
aws-sdk-personalizeruntime 1.7.0
aws-sdk-pi 1.17.0
aws-sdk-pinpoint 1.36.0
aws-sdk-pinpointemail 1.17.0
aws-sdk-pinpointsmsvoice 1.14.0
aws-sdk-polly 1.28.0
aws-sdk-pricing 1.17.0
aws-sdk-qldb 1.2.0
aws-sdk-qldbsession 1.2.0
aws-sdk-quicksight 1.18.0
aws-sdk-ram 1.14.0
aws-sdk-rds 1.80.0
aws-sdk-rdsdataservice 1.16.0
aws-sdk-redshift 1.39.0
aws-sdk-rekognition 1.35.0
aws-sdk-resourcegroups 1.22.0
aws-sdk-resourcegroupstaggingapi 1.23.0
aws-sdk-robomaker 1.21.0
aws-sdk-route53 1.32.0
aws-sdk-route53domains 1.19.0
aws-sdk-route53resolver 1.12.0
aws-sdk-s3 1.81.0
aws-sdk-s3control 1.16.0
aws-sdk-sagemaker 1.53.0
aws-sdk-sagemakerruntime 1.19.0
aws-sdk-savingsplans 1.3.0
aws-sdk-schemas 1.1.0
aws-sdk-secretsmanager 1.34.0
aws-sdk-securityhub 1.22.0
aws-sdk-serverlessapplicationrepository 1.25.0
aws-sdk-servicecatalog 1.36.0
aws-sdk-servicediscovery 1.20.0
aws-sdk-servicequotas 1.4.0
aws-sdk-ses 1.28.0
aws-sdk-sesv2 1.3.0
aws-sdk-shield 1.23.0
aws-sdk-signer 1.19.0
aws-sdk-simpledb 1.17.0
aws-sdk-sms 1.18.0
aws-sdk-snowball 1.24.0
aws-sdk-sns 1.22.0
aws-sdk-sqs 1.24.0
aws-sdk-ssm 1.73.0
aws-sdk-sso 1.2.0
aws-sdk-ssooidc 1.1.0
aws-sdk-states 1.26.0
aws-sdk-storagegateway 1.36.0
aws-sdk-support 1.18.0
aws-sdk-swf 1.18.0
aws-sdk-textract 1.13.0
aws-sdk-transcribeservice 1.38.0
aws-sdk-transcribestreamingservice 1.11.0
aws-sdk-transfer 1.17.0
aws-sdk-translate 1.20.0
aws-sdk-waf 1.27.0
aws-sdk-wafregional 1.28.0
aws-sdk-wafv2 1.2.0
aws-sdk-workdocs 1.21.0
aws-sdk-worklink 1.13.0
aws-sdk-workmail 1.22.0
aws-sdk-workmailmessageflow 1.2.0
aws-sdk-workspaces 1.35.0
aws-sdk-xray 1.24.0
aws-sdk-resources 3.70.0
aws-sdk 3.0.1
babosa 1.0.3
certified 1.0.0
claide 1.0.3
colored2 3.1.2
cork 0.3.0
nap 1.1.0
open4 1.3.4
claide-plugins 0.9.2
clamp 1.3.1
fuzzy_match 2.0.4
cocoapods-core 1.8.4
cocoapods-deintegrate 1.0.4
cocoapods-downloader 1.3.0
cocoapods-plugins 1.0.0
cocoapods-search 1.0.0
cocoapods-stats 1.1.0
netrc 0.11.0
cocoapods-trunk 1.4.1
cocoapods-try 1.1.0
escape 0.0.4
fourflusher 2.3.1
gh_inspector 1.1.3
molinillo 0.6.6
ruby-macho 1.4.0
nanaimo 0.3.0
xcodeproj 1.18.0
cocoapods 1.8.4
dotenv 2.7.6
osx_keychain 1.0.2
cocoapods-keys 2.1.0
colored 1.2
highline 1.7.10
commander-fastlane 4.4.6
multipart-post 2.0.0
faraday 1.0.1
faraday-http-cache 2.2.0
rchardet 1.8.0
git 1.7.0
rexml 3.2.4
kramdown 2.3.0
kramdown-parser-gfm 1.1.0
no_proxy_fix 0.1.2
sawyer 0.8.2
octokit 4.18.0
unicode-display_width 1.7.0
terminal-table 1.8.0
danger 8.0.4
danger-duplicate_localizable_strings 0.3.0
danger-plugin-api 1.0.0
danger-lock_dependency_versions 0.0.3
git_diff 0.4.2
danger-suggester 0.1.0
thor 0.20.3
danger-swiftlint 0.24.1
declarative 0.0.20
declarative-option 0.1.0
digest-crc 0.6.1
unf_ext 0.0.7.7
unf 0.1.4
domain_name 0.5.20190701
emoji_regex 3.0.0
excon 0.76.0
http-cookie 1.0.3
faraday-cookie_jar 0.0.7
faraday_middleware 1.0.0
fastimage 2.2.0
jwt 2.2.2
memoist 0.16.2
multi_json 1.15.0
os 1.1.1
signet 0.14.0
googleauth 0.13.1
mini_mime 1.0.2
uber 0.1.0
representable 3.0.4
retriable 3.1.2
google-api-client 0.38.0
google-cloud-env 1.3.3
google-cloud-errors 1.0.1
google-cloud-core 1.5.0
google-cloud-storage 1.28.0
mini_magick 4.10.1
plist 3.5.0
rubyzip 2.3.0
security 0.1.3
naturally 2.2.0
simctl 1.6.8
slack-notifier 2.3.2
terminal-notifier 2.0.0
tty-screen 0.8.1
tty-cursor 0.7.1
tty-spinner 0.9.3
word_wrap 1.0.0
rouge 2.0.7
xcpretty 0.3.0
xcpretty-travis-formatter 1.0.0
fastlane-plugin-appcenter 1.8.0
fastlane-plugin-aws_device_farm 0.3.15
xml-simple 1.1.5
fastlane-plugin-bugsnag 1.4.1
fastlane-plugin-lokalise 2.0.11
java-properties 0.2.1
fastlane-plugin-properties 1.1.2
mini_portile2 2.4.0
nokogiri 1.10.10
slather 2.4.9
xcode-install 2.6.3

generated on: 2020-09-21

@mmdock
Copy link
Contributor

mmdock commented Sep 22, 2020

I literally just used the following and it worked just fine:

  lane :release do
    Spaceship::Tunes.login(ENV["APPLE_ID"])
    app = Spaceship::ConnectAPI::App.find(ENV["BUNDLE_ID"])

    unless app.get_latest_app_store_version.nil? 
      version = app.get_latest_app_store_version
      status = version.app_store_state
      if status == Spaceship::ConnectAPI::AppInfo::AppStoreState::PENDING_DEVELOPER_RELEASE
        version.create_app_store_version_release_request
        upload_dsyms(version: version)
      else #Give feedback that is not an error as to what is wrong
        print("NOTICE: - Edit version is not ready for release\n")
        print("NOTICE: - Current status is: " + status +  "\n")
      end
    else
      print("ERROR: - No Edit Version exists\n")
    end

  end

  desc "Fetch and upload dSYM files to Crashlytics"
  lane :upload_dsyms do |options|
    download_dsyms(version: options[:version])                # Download dSYM files from ASC
    upload_symbols_to_crashlytics   # Upload them to Crashlytics
    clean_build_artifacts           # Delete the local dSYM files
  end

The only key differences are the older style Spaceship::Tunes.login(ENV["APPLE_ID"]) (which I have been too lazy to change) and I use ConnectAPI::App.find instead of ConnectAPI::App.get

I don't know why my code would work when yours do not, but hope it helps in debugging yours

@TragedyStar
Copy link
Contributor

I run into this too

here is my code

Spaceship::ConnectAPI.token = token
app = Spaceship::ConnectAPI.get_app(app_id: 00000000).first
app_store_version = app.get_pending_release_app_store_version
app_store_version.create_app_store_version_release_request

and I got this error

The URL path is not valid - The resource 'appStoreVersionReleaseRequests' does not exist

I can't find appStoreVersionReleaseRequests in official App Store Connect API docs and open API spec(download), I'm not sure whether it is a private API.

@dcacenabes
Copy link
Contributor Author

I run into this too

here is my code

Spaceship::ConnectAPI.token = token
app = Spaceship::ConnectAPI.get_app(app_id: 00000000).first
app_store_version = app.get_pending_release_app_store_version
app_store_version.create_app_store_version_release_request

and I got this error

The URL path is not valid - The resource 'appStoreVersionReleaseRequests' does not exist

I can't find appStoreVersionReleaseRequests in official App Store Connect API docs and open API spec(download), I'm not sure whether it is a private API.

Hi @TragedyStar ,
Exactly, that is nowhere to be found in the official documentation. Furthermore, I could not find in the official docs which are the endpoints you're supposed to call in order to change a version from "Pending developer release" to "Ready for sale"

@dcacenabes
Copy link
Contributor Author

dcacenabes commented Sep 23, 2020

I literally just used the following and it worked just fine:

  lane :release do
    Spaceship::Tunes.login(ENV["APPLE_ID"])
    app = Spaceship::ConnectAPI::App.find(ENV["BUNDLE_ID"])

    unless app.get_latest_app_store_version.nil? 
      version = app.get_latest_app_store_version
      status = version.app_store_state
      if status == Spaceship::ConnectAPI::AppInfo::AppStoreState::PENDING_DEVELOPER_RELEASE
        version.create_app_store_version_release_request
        upload_dsyms(version: version)
      else #Give feedback that is not an error as to what is wrong
        print("NOTICE: - Edit version is not ready for release\n")
        print("NOTICE: - Current status is: " + status +  "\n")
      end
    else
      print("ERROR: - No Edit Version exists\n")
    end

  end

  desc "Fetch and upload dSYM files to Crashlytics"
  lane :upload_dsyms do |options|
    download_dsyms(version: options[:version])                # Download dSYM files from ASC
    upload_symbols_to_crashlytics   # Upload them to Crashlytics
    clean_build_artifacts           # Delete the local dSYM files
  end

The only key differences are the older style Spaceship::Tunes.login(ENV["APPLE_ID"]) (which I have been too lazy to change) and I use ConnectAPI::App.find instead of ConnectAPI::App.get

I don't know why my code would work when yours do not, but hope it helps in debugging yours

Hi @mmdock, thanks for your comment. Which version of Fastlane are you using? Also, I wonder if by logging in using the old Tunes way you still get to work with the AppConnect API. According to the fastlane docs you need to log in a different way for it to work: https://docs.fastlane.tools/app-store-connect-api/

Regarding the find-get difference, I've been checking the source and under the hood both are calling the same endpoint, so that should not make a difference.

Out of curiosity, your app has a phased release? Or it gets automatically released to all users?

@TragedyStar
Copy link
Contributor

I run into this too
here is my code

Spaceship::ConnectAPI.token = token
app = Spaceship::ConnectAPI.get_app(app_id: 00000000).first
app_store_version = app.get_pending_release_app_store_version
app_store_version.create_app_store_version_release_request

and I got this error

The URL path is not valid - The resource 'appStoreVersionReleaseRequests' does not exist

I can't find appStoreVersionReleaseRequests in official App Store Connect API docs and open API spec(download), I'm not sure whether it is a private API.

Hi @TragedyStar ,
Exactly, that is nowhere to be found in the official documentation. Furthermore, I could not find in the official docs which are the endpoints you're supposed to call in order to change a version from "Pending developer release" to "Ready for sale"

Yes, me too. Maybe, it is a private API which is captured by fastlane authors using Charles and App Store Connect API team refactor it recently.

@dcacenabes
Copy link
Contributor Author

I have been looking and this was introduced in:
#16765

@dcacenabes
Copy link
Contributor Author

This is maybe related to this: #17140

@dcacenabes
Copy link
Contributor Author

@TragedyStar does your app have a phased release configured? Or you release to 100% of the users?

@TragedyStar
Copy link
Contributor

@TragedyStar does your app have a phased release configured? Or you release to 100% of the users?

Yes, phased release configured and app in pending developer release state

@TragedyStar
Copy link
Contributor

I have been looking and this was introduced in:

#16765

@valerio-castelli we need help 🥺

@rabbitinspace
Copy link
Contributor

rabbitinspace commented Oct 1, 2020

So, I have the same issue after migrating to ASC token. The only endpoint I see in the docs that may work is Modify Phased Release: https://developer.apple.com/documentation/appstoreconnectapi/modify_an_app_store_version_phased_release

My guess is creating a phased release and moving it to ACTIVE state and then to COMPLETE state should do the trick. Want to try this when we will be doing our next release.

@dcacenabes
Copy link
Contributor Author

So, I have the same issue after migrating to ASC token. The only endpoint I see in the docs that may work is Modify Phased Release: https://developer.apple.com/documentation/appstoreconnectapi/modify_an_app_store_version_phased_release

My guess is creating a phased release and moving it to ACTIVE state and then to COMPLETE state should do the trick. Want to try this when we will be doing our next release.

Hi @rabbitinspace ,

I have attempted that, but it does not work.
I have an existing phased release object, which is set to INACTIVE. I retrieve it using phasedRelease = version.fetch_app_store_version_phased_release, and then I do phasedRelease.resume. This triggers the following error:

An attribute value is not acceptable for the current resource state. - You cannot change the state of a phased release in the current version state.

So apparently you can not change the state of a phased release when the app is in PENDING_DEVELOPER_RELEASE. I also attempted to create a new phased release object by calling version.create_app_store_version_phased_release, but this also fails (sorry I don't have the log for this one).

@rabbitinspace
Copy link
Contributor

rabbitinspace commented Oct 6, 2020

@dcacenabes thanks for checking it! That's really unfortunate. I hope it's possible to change manual release to automatic one after a review. If so, then there's this API to set an automatic release date (now + 1h). If not, looks like going back to Apple ID auth is the only way :(

@dcacenabes
Copy link
Contributor Author

dcacenabes commented Oct 6, 2020

@dcacenabes thanks for checking it! That's really unfortunate. I hope it's possible to change manual release to automatic one after a review. If so, then there's this API to set an automatic release date (now + 1h). If not, looks like going back to Apple ID auth is the only way :(

That is actually a good idea. My next release is scheduled in 2 weeks, so I can't test this right away. I'll give it a shot and update this thread.

@dcacenabes
Copy link
Contributor Author

dcacenabes commented Oct 19, 2020

@dcacenabes thanks for checking it! That's really unfortunate. I hope it's possible to change manual release to automatic one after a review. If so, then there's this API to set an automatic release date (now + 1h). If not, looks like going back to Apple ID auth is the only way :(

Ok so this actually worked.

now = Time.now
release_date_string = now.strftime("%Y-%m-%dT%H:00%:z")
version.update(attributes: {
    earliest_release_date: release_date_string,
    release_type: Spaceship::ConnectAPI::AppStoreVersion::ReleaseType::SCHEDULED
})

It scheduled the release to happen not earlier than the given date (which is actually a date in the past). After a couple of minutes waiting the phased release started!!!
So at least we have a workaround 🎉

@dcacenabes dcacenabes changed the title Release app version using new AppStoreConnect API fails ( The URL path is not valid - The resource 'appStoreVersionReleaseRequests' does not exist ) Release app version using new AppStoreConnect API fails for phased release ( The URL path is not valid - The resource 'appStoreVersionReleaseRequests' does not exist ) Oct 20, 2020
@dave-perry
Copy link

dave-perry commented Oct 23, 2020

Having the same issue too.

[EDIT] Unfortunately the workaround still fails for me with an error of An attribute value is invalid. - The attribute 'earliestReleaseDate' cannot be set before today

@ceeK
Copy link

ceeK commented Nov 12, 2020

@dcacenabes's workaround works for me too, thanks. I wonder if it's worth adopting this as the solution within create_app_store_version_release_request (or something similar) until the App Store Connect API adds proper support. In our code we are rounding the last hour to achieve "release this now, please". I.e. calling the code at 12:23 updates the earliest_release_date to 12:00.

@dave-perry
Copy link

@dcacenabes's workaround works for me too, thanks. I wonder if it's worth adopting this as the solution within create_app_store_version_release_request (or something similar) until the App Store Connect API adds proper support. In our code we are rounding the last hour to achieve "release this now, please". I.e. calling the code at 12:23 updates the earliest_release_date to 12:00.

Could you share that code, please?

@ceeK
Copy link

ceeK commented Nov 13, 2020

Might not be the most elegant but assuming you're logged in with your App Store Connect key and have the pending developer version:

# Round to the current hour, trimming minutes, seconds 
now = Time.now
seconds = now.sec
minutes_in_seconds = (now.min * 60)
release_date = (now - minutes_in_seconds - seconds)
release_date_string = release_date.strftime('%Y-%m-%dT%H:%M:%S%:z')

version.update(attributes: {
    earliest_release_date: release_date_string,
    release_type: Spaceship::ConnectAPI::AppStoreVersion::ReleaseType::SCHEDULED
})

One thing worth noting is that the App Store Connect APIs rejected my request if I tried to send in a release_date_string that included minutes. It responded with an error that it only accepts hour based precision.

I haven't been able to test this more than once though due to our release cycle. There may be edge cases where this might not work? I'll report back if I find any.

@dave-perry
Copy link

Thanks - I'll give that a try :)

@dcacenabes
Copy link
Contributor Author

dcacenabes commented Nov 13, 2020

Might not be the most elegant but assuming you're logged in with your App Store Connect key and have the pending developer version:

# Round to the current hour, trimming minutes, seconds 
now = Time.now
seconds = now.sec
minutes_in_seconds = (now.min * 60)
release_date = (now - minutes_in_seconds - seconds)
release_date_string = release_date.strftime('%Y-%m-%dT%H:%M:%S%:z')

version.update(attributes: {
    earliest_release_date: release_date_string,
    release_type: Spaceship::ConnectAPI::AppStoreVersion::ReleaseType::SCHEDULED
})

One thing worth noting is that the App Store Connect APIs rejected my request if I tried to send in a release_date_string that included minutes. It responded with an error that it only accepts hour based precision.

I haven't been able to test this more than once though due to our release cycle. There may be edge cases where this might not work? I'll report back if I find any.

You can make it simpler:

now = Time.now
release_date_string = now.strftime("%Y-%m-%dT%H:00%:z")

Seconds are not necessary.

@ceeK
Copy link

ceeK commented Nov 13, 2020

Nice! 👍 I thought that there might be a more elegant way. I was just using the same format that was provided in the fastlane code when they set earliest_release_date themselves.

@dcacenabes
Copy link
Contributor Author

Nice! 👍 I thought that there might be a more elegant way. I was just using the same format that was provided in the fastlane code when they set earliest_release_date themselves.

Makes sense. I just updated my original workaround comment with my latest comment so that all the info is in 1 single comment.

@eamonn-alphin
Copy link

Apple changed the API address, the new one is:

"AppStoreVersionCreateRequest" : { "type" : "object", "title" : "AppStoreVersionCreateRequest", "properties" : { "data" : { "type" : "object", "properties" : { "type" : { "type" : "string", "enum" : [ "appStoreVersions" ] }, "attributes" : { "type" : "object", "properties" : { "platform" : { "$ref" : "#/components/schemas/Platform" }, "versionString" : { "type" : "string" }, "copyright" : { "type" : "string" }, "releaseType" : { "type" : "string", "enum" : [ "MANUAL", "AFTER_APPROVAL", "SCHEDULED" ] }, "earliestReleaseDate" : { "type" : "string", "format" : "date-time" }, "usesIdfa" : { "type" : "boolean" } }, "required" : [ "versionString", "platform" ] },....

@eamonn-alphin
Copy link

my bad, that's for version 1.2. Version 1.0 throws the error when you try to log in using ConnectAPI.Auth(key_id...).

Logging in using ConnectAPI.login(username,password) then using post_app_store_veresion_release_request works just fine though... but obviously I don't want to leave my username and password in a ruby file...

@fastlane-bot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest fastlane version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

Friendly reminder: contributions are always welcome! Check out CONTRIBUTING.md for more information on how to help with fastlane and feel free to tackle this issue yourself 💪

@fastlane-bot
Copy link

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍

@dcacenabes
Copy link
Contributor Author

This is still an issue. The workaround still works.

@iliao58
Copy link

iliao58 commented Feb 8, 2021

@max-ott this appears to be an issue after I recently switched to the AppStore Connect API for authentication. do we have any plans to support this with ASC?

@max-ott
Copy link
Contributor

max-ott commented Feb 8, 2021

It’s probably not supported by Apple at this point. If it is, please check out the official docs from Apple and link it here so we have a reference.

@iliao58
Copy link

iliao58 commented Feb 8, 2021

@max-ott no. last time I checked, it's not in the apple api spec. so only the ones in the spec are supported when authenticated via ASC?

@max-ott
Copy link
Contributor

max-ott commented Feb 9, 2021

Yes when using the API key for authentication, only the official resources / endpoints are allowed.

@dcacenabes
Copy link
Contributor Author

As discussed here:
#18190

Seems like the workaround is not working anymore. The app will not get automatically released, it will remain as scheduled.

@dcacenabes
Copy link
Contributor Author

dcacenabes commented Feb 25, 2021

@rogerluan sorry for tagging you. Could you remove the label "workardound available"? Unfortunately that is not the case any more :(
Edit: Disregard, @max-ott already took care of it (thank you)

@rogerluan
Copy link
Member

rogerluan commented Feb 26, 2021

@dcacenabes don't feel sorry, tag away! 😊 glad Max helped you out quickly 🙌

@ainame
Copy link
Contributor

ainame commented Mar 17, 2021

I confirmed that the workaround started working again as of today. We need more people to confirm it but I added "workaround available" label to clarify the current status (more people would try it if they see the label)
#18190 (reply in thread)

@dave-perry
Copy link

Worked for me just now - there was a few minutes of lag however that I don't recall happening previously.

@dcacenabes
Copy link
Contributor Author

Confirmed also on my end. It working once again!

@andrew54068
Copy link

Confirmed on my end. Great!!

@fastlane fastlane locked and limited conversation to collaborators Jun 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests