Fastlane: Deliver fails to create a new version in iTunes Connect for a Mac App

Created on 16 Sep 2016  ·  11Comments  ·  Source: fastlane/fastlane

New Issue Checklist

Deliver fails to create a new version in iTunes Connect for a Mac App.
In spaceship/lib/spaceship/tunes/tunes_client.rb:254 the platform is defaulted to 'ios'. The callers do not override. Changing this default to 'osx' allows for version creation to happen but breaks iOS delivery.

Complete output when running fastlane, including the stack trace and command used
$ deliver --pkg fastlaneoutput/Particulars.pkg --verbose
INFO [2016-09-16 12:15:01.96]: Login to iTunes Connect ([email protected])
INFO [2016-09-16 12:15:03.59]: Login successful
INFO [2016-09-16 12:15:03.88]: $ xar -C /var/folders/x_/ltbhjxvs4mbcy53tm9khh3z80000gp/T/d20160916-19706-188hd6x -xf fastlaneoutput/Particulars.pkg

+--------------------+--------------------------------+
|               deliver 1.13.3 Summary                |
+--------------------+--------------------------------+
| pkg                | fastlaneoutput/Particulars.pkg |
| app_identifier     | net.glencode.Particulars       |
| username           | [email protected]            |
| submit_for_review  | true                           |
| metadata_path      | ./deliver/metadata             |
| screenshots_path   | ./deliver/screenshots          |
| app_version        | 1.4.4                          |
| skip_binary_upload | false                          |
| skip_screenshots   | false                          |
| skip_metadata      | false                          |
| force              | false                          |
| automatic_release  | false                          |
+--------------------+--------------------------------+

INFO [2016-09-16 12:15:03.95]: Making sure the latest version on iTunes Connect matches '1.4.4' from the ipa file...

Looking for related GitHub issues on fastlane/fastlane...
Search query: {"data"=>nil, "messages"=>{"warn"=>nil, "error"=>["Unexpected Error"], "info"=>nil}, "statusCode"=>"ERROR"}

URL: https://api.github.com/search/issues?q=%7B%22data%22=%3Enil,%20%22messages%22=%3E%7B%22warn%22=%3Enil,%20%22error%22=%3E[%22Unexpected%20Error%22],%20%22info%22=%3Enil%7D,%20%22statusCode%22=%3E%22ERROR%22%7D+repo:fastlane/fastlane
➡️  Accessing BUNDLE type of application fails in client.app_version
   https://github.com/fastlane/fastlane/issues/2020 [open] 0 💬
   3 days ago

➡️  Unexpected Error
   https://github.com/fastlane/fastlane/issues/3032 [closed] 2 💬
   08 Mar 2016

➡️  Unexpected Response error when Running 'Spaceship::Tunes::Application.all'
   https://github.com/fastlane/fastlane/issues/3908 [closed] 1 💬
   25 Mar 2016

and 2 more at: https://github.com/fastlane/fastlane/search?q=%7B%22data%22=%3Enil,%20%22messages%22=%3E%7B%22warn%22=%3Enil,%20%22error%22=%3E[%22Unexpected%20Error%22],%20%22info%22=%3Enil%7D,%20%22statusCode%22=%3E%22ERROR%22%7D&type=Issues&utf8=✓
/Library/Ruby/Gems/2.0.0/gems/spaceship-0.32.1/lib/spaceship/client.rb:446:in `parse_response': [!] {"data"=>nil, "messages"=>{"warn"=>nil, "error"=>["Unexpected Error"], "info"=>nil}, "statusCode"=>"ERROR"} (Spaceship::Client::UnexpectedResponse)
    from /Library/Ruby/Gems/2.0.0/gems/spaceship-0.32.1/lib/spaceship/tunes/tunes_client.rb:265:in `create_version!'
    from /Library/Ruby/Gems/2.0.0/gems/spaceship-0.32.1/lib/spaceship/tunes/application.rb:164:in `create_version!'
    from /Library/Ruby/Gems/2.0.0/gems/spaceship-0.32.1/lib/spaceship/tunes/application.rb:183:in `ensure_version!'
    from /Library/Ruby/Gems/2.0.0/gems/deliver-1.13.3/lib/deliver/runner.rb:39:in `verify_version'
    from /Library/Ruby/Gems/2.0.0/gems/deliver-1.13.3/lib/deliver/runner.rb:20:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/deliver-1.13.3/lib/deliver/commands_generator.rb:47:in `block (2 levels) in run'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.4.0/lib/commander/command.rb:178:in `call'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.4.0/lib/commander/command.rb:178:in `call'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.4.0/lib/commander/command.rb:153:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.4.0/lib/commander/runner.rb:444:in `run_active_command'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane_core-0.51.0/lib/fastlane_core/ui/fastlane_runner.rb:36:in `run!'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.4.0/lib/commander/delegates.rb:15:in `run!'
    from /Library/Ruby/Gems/2.0.0/gems/deliver-1.13.3/lib/deliver/commands_generator.rb:128:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/deliver-1.13.3/lib/deliver/commands_generator.rb:12:in `start'
    from /Library/Ruby/Gems/2.0.0/gems/deliver-1.13.3/bin/deliver:5:in `<top (required)>'
    from /usr/local/bin/deliver:23:in `load'
    from /usr/local/bin/deliver:23:in `<main>'

Configuration Files

Please copy the complete content of your Fastfile and any other configuration files you use below:

Fastfile:

$ cat Deliverfile
###################### More Options ######################
# If you want to have even more control, check out the documentation
# https://github.com/fastlane/fastlane/blob/master/deliver/Deliverfile.md


###################### Automatically generated ######################
# Feel free to remove the following line if you use fastlane (which you should)

app_identifier "net.glencode.Particulars" # The bundle identifier of your app
username "[email protected]" # your Apple ID user
submit_for_review true
metadata_path "./deliver/metadata"
screenshots_path "./deliver/screenshots"

Environment

deliver 1.13.3
spaceship 0.32.1

Do you use bundler to execute fastlane (i.e. bundle exec fastlane)? No

Do you use a Ruby environment manager (e.g. chruby, rbenv, rvm)? No

spaceship bug

Most helpful comment

@TKBurner wrong jorge!

All 11 comments

Hi @fraserhess

Can you run this and send me the results:

xar -C /var/folders/x_/ltbhjxvs4mbcy53tm9khh3z80000gp/T/d20160916-19706-188hd6x -xf fastlaneoutput/Particulars.pkg

Thanks!

Hi,

I am experiencing the same issue.

The created temp dir gets deleted after the code is executed (it is using Dir.mktmpdir with a block), but I tried to execute xar -C -xf <pkg file> and it uncompressed the .app file ok. I am sure the .pkg file is ok since so far I have been submitting it manually successfully and preparing it with an automated script.

Thanks for the excellent work

In case it helps, the exception is raised in lib/spaceship/tunes/tunes_client.rb:275:increate_version!'`.

It is using iosas the platform. Maybe it's related to that? I tried with mas and mac and got the same error.

I put some traces in that method in case they can be helpful (I edited some of the long keys/hashes in the response in case posting them publicly might represent a security issue):

PLATFORM
ios

REQUEST
#<struct Faraday::Request method=:post, path="ra/apps/1141629780/platforms/ios/versions/create/", params={}, headers={"User-Agent"=>"Spaceship 0.33.0", "Content-Type"=>"application/json"}, body="{\"version\":{\"value\":\"2.0.414\"}}", options=#<Faraday::RequestOptions timeout=300, open_timeout=300>>

RESPONSE
#<Faraday::Response:0x007f7f9b44a2d8 @on_complete_callbacks=[], @env=#<Faraday::Env @method=:post @body={"data"=>nil, "messages"=>{"warn"=>nil, "error"=>["Unexpected Error"], "info"=>nil}, "statusCode"=>"ERROR"} @url=#<URI::HTTPS:0x007f7f9b9e81e0 URL:https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/ra/apps/1141629780/platforms/ios/versions/create/> @request=#<Faraday::RequestOptions timeout=300, open_timeout=300> @request_headers={"User-Agent"=>"Spaceship 0.33.0", "Content-Type"=>"application/json", "Cookie"=>"NSC_jud-mc=ffffffff129ad; acn01=0gyehn3ETilHiAprp9+hLTPE8WFITgGOjAALp+tSe5dR; dslang=US-EN; itctx=AiOjgzOTQ2ODAxLCJkcyI6ODAxNDTF27K3sI-zI6HMLeUXZCatt_DIw; myacinfo=DAWTKNV2e30ded531d0146b59a1183c7650c03c5347eb317be53f896d0ba05f8501406cdb3de65bb8090a79c8793c9c6b728d544e2afbd02b71944ca6c7803315dccb25b949ab14f1b0b9feffef87777dac4398eb76e0c3bf56b458a91fe13da74134ebad05e951c1dce06298f53ccab7fefbeb5bfed10ec1fd5d84a1acd1ec64fd51588793e35da3902e3b34b58b3cc957d3059b9a6684de5cbf977f8b16fe642084b77a40c635cbca1e52af6ad7a101348cbce227029a28c238a92c2905762ab6e1b4d34fde3750032fed8c3f9e26a44ffb01e15041b9af742782949be4d18cc0ad32b774cabd10a90dfa88c3cc573861c5884d26e29899c1041814fd2ed5747d1a3350c70c2e100df29b765d922a8fee3d8MVRYV2; site=USA; woinst=3709; wosid=3ZtaqB5LiuUIFecWyGg"} @ssl=#<Faraday::SSLOptions verify=true> @response=#<Faraday::Response:0x007f7f9b44a2d8 ...> @response_headers={"x-apple-jingle-correlation-key"=>"NDNDCWVMF5WV266IPY", "x-apple-application-site"=>"NWK", "apple-originating-system"=>"MZLabel", "strict-transport-security"=>"max-age=31536000", "x-frame-options"=>"SAMEORIGIN", "apple-tk"=>"false", "apple-seq"=>"0", "apple-timing-app"=>"50 ms", "cache-control"=>"private, no-cache, no-store, must-revalidate, max-age=0", "expires"=>"Wed, 21-Sep-2016 16:57:44 GMT", "content-type"=>"application/json; charset=utf-8;", "x-apple-application-instance"=>"3709", "pragma"=>"no-cache", "x-webobjects-loadaverage"=>"24", "x-apple-request-uuid"=>"68da31ae-8b34-b4e1-5aac-2f6d5d7bc87e", "content-length"=>"105", "date"=>"Thu, 22 Sep 2016 20:36:17 GMT", "connection"=>"close"} @status=500>>

For the record, after creating the version manually in iTunes connect the deploy completed successfully (including submitting for review directly)

@jorgemanrubia Are you able to reproduce this on a blank project? Thanks!

@TKBurner wrong jorge!

I have the same issue as @jorgemanrubia
Looks like creating new app version for mac isn't impemented since:

client.create_version!(apple_id, version_number)

from tunes/application.rb doesn't have a third parameter which by default is 'ios'...

What's funny is that it worked if the version is created, even though it's different from the one I'm about to upload. For instance I created 1.1.1 but uploaded 1.2.0 and it worked (switched the version to 1.2.0) nevertheless!

Would be nice to have create_version working though, so we don't have to login to iTC.

@masteranza Are you interested in submitting a PR to add this functionality? We'd love to see it!

Of course, I'll try that.

@TKBurner how do I make my local copy of deliver use ALL the source code instead of my installed fastlane-core? I'm running fastlane/deliver/bin/deliver but deliver itself calls core located at /usr/local/ instead of the one under source control.
Is there a simpler way than running rake install all the time?

@masteranza The recommended methods are described here: https://github.com/fastlane/fastlane/blob/master/CONTRIBUTING.md#developing Thanks!

The PRs have been merged and this functionality will be available in the next _deliver_ release 👍

Was this page helpful?
0 / 5 - 0 ratings