fastlane: [spaceship] all_builds_for_train: error 410 gone

New Issue Checklist

Issue Description

/Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/spaceship/lib/spaceship/test_flight/client.rb:321:in `handle_response': [!] <html> (Spaceship::UnexpectedResponse)
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 410 Gone</title>
</head>
<body><h2>HTTP ERROR 410</h2>
<p>Problem accessing */platforms/ios/trains/2.3.0/builds. Reason:
<pre>    Gone</pre></p>
</body>
</html>

	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/spaceship/lib/spaceship/test_flight/client.rb:38:in `block in get_builds_for_train'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/spaceship/lib/spaceship/client.rb:620:in `with_retry'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/spaceship/lib/spaceship/test_flight/client.rb:36:in `get_builds_for_train'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/spaceship/lib/spaceship/test_flight/build.rb:115:in `builds_for_train'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/spaceship/lib/spaceship/tunes/application.rb:315:in `all_builds_for_train'
	from Fastfile:343:in `block (2 levels) in parsing_binding'
	from Fastfile:342:in `each'
	from Fastfile:342:in `block in parsing_binding'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/fastlane/lib/fastlane/lane.rb:33:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/fastlane/lib/fastlane/runner.rb:204:in `try_switch_to_lane'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/fastlane/lib/fastlane/runner.rb:146:in `trigger_action_by_name'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/fastlane/lib/fastlane/fast_file.rb:154:in `method_missing'
	from Fastfile:276:in `block (2 levels) in parsing_binding'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/fastlane/lib/fastlane/lane.rb:33:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/fastlane/lib/fastlane/runner.rb:45:in `chdir'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/fastlane/lib/fastlane/runner.rb:45:in `execute'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/fastlane/lib/fastlane/lane_manager.rb:56:in `cruise_lane'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
	from /Library/Ruby/Gems/2.3.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
	from /Library/Ruby/Gems/2.3.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
	from /Library/Ruby/Gems/2.3.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/fastlane/lib/fastlane/commands_generator.rb:333:in `run'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/fastlane/lib/fastlane/cli_tools_distributor.rb:119:in `take_off'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.121.1/bin/fastlane:23:in `<top (required)>'
	from /usr/local/bin/fastlane:22:in `load'
	from /usr/local/bin/fastlane:22:in `<main>'
Command executed
  lane :spaceship_build_number_plus_one do
    fastlane_require 'spaceship'
    Spaceship::Tunes.login("foo@bar.de")
    app = Spaceship::Tunes::Application.find("foo.bar")
    versions = app.all_build_train_numbers
    build_versions = []
    app.all_build_train_numbers.each do |version|
        build = app.all_builds_for_train(train: version).map(&:build_version).max
        build_versions.push(build)
    end
    build_number = build_versions.max.to_i + 1
  end

Environment

| Gem | Version | Update-Status | | -------- | ------- | ------------- | | fastlane | 2.121.1 | ✅ Up-To-Date |

image

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 19 (8 by maintainers)

Most upvoted comments

@pparmaei 2.120.0 can not be considered any more at all, as the updates were released to fix problems with that version. Please check if the problem also exists with 2.121.1 and report back - but as your error message is also totally different, and the method you are using is as well, please do so in a new issue you create. I don’t think this has any direct relation to what @volmus reported here. Thanks.

Using fastlane 2.125.2, the three methods (I know of) to get to a build train or the builds within one are all failing. From the spaceship playground:

[4] pry(#<Spaceship::Playground>)> app = Spaceship::Tunes::Application.find("my.bundle.id")                                                                                              
=> <Spaceship::Tunes::Application 
	apple_id="xxxxx", 
	name="mycompany", 
	vendor_id="CGAPP-001", 
	bundle_id="my.bundle.id", 
	last_modified=1560273211000, 
	issues_count=0, 
	app_icon_preview_url="https://url-to-our-icon-image.png", 
	version_sets=[<Spaceship::Tunes::VersionSet 
		type="APP", 
		application=<Spaceship::Tunes::Application 
		#<Object ...>>, 
		platform="ios">]>

[5] pry(#<Spaceship::Playground>)> versions = app.all_build_train_numbers                                                                                                                   
NoMethodError: undefined method `[]' for #<Spaceship::ConnectAPI::Response:0x007fd86f49c768>
from /Users/lbrownell/.rvm/gems/ruby-2.3.3/gems/fastlane-2.125.2/spaceship/lib/spaceship/test_flight/build_trains.rb:24:in `block in all'

[6] pry(#<Spaceship::Playground>)> train = app.build_trains["6.0"]                                                                                                                          
NoMethodError: undefined method `[]' for #<Spaceship::ConnectAPI::Response:0x007fd81d3664b8>
from /Users/lbrownell/.rvm/gems/ruby-2.3.3/gems/fastlane-2.125.2/spaceship/lib/spaceship/test_flight/build_trains.rb:24:in `block in all'

[7] pry(#<Spaceship::Playground>)> app.all_processing_builds                                                                                                                                
NoMethodError: undefined method `[]' for #<Spaceship::ConnectAPI::Response:0x007fd878031760>
from /Users/lbrownell/.rvm/gems/ruby-2.3.3/gems/fastlane-2.125.2/spaceship/lib/spaceship/test_flight/build_trains.rb:24:in `block in all'```

My workaround is broken since 2.125.0:

/Library/Ruby/Gems/2.3.0/gems/fastlane-2.125.0/spaceship/lib/spaceship/test_flight/build_trains.rb:24:in `block in all': [!] undefined method `[]' for #<Spaceship::ConnectAPI::Response:0x00007fe97250b7d0> (NoMethodError)
        from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.125.0/spaceship/lib/spaceship/test_flight/build_trains.rb:22:in `loop'
        from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.125.0/spaceship/lib/spaceship/test_flight/build_trains.rb:22:in `all'
        from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.125.0/spaceship/lib/spaceship/tunes/application.rb:301:in `build_trains'
        from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.125.0/spaceship/lib/spaceship/tunes/application.rb:307:in `all_build_train_numbers'
        from Fastfile:371:in `block in parsing_binding'

For anyone interested here’s my current workaround:

lane :spaceship_build_number_plus_one do
  fastlane_require 'spaceship'
    Spaceship::Tunes.login("username")
    app = Spaceship::Tunes::Application.find("foo.bar")
    versions = app.all_build_train_numbers
    build_versions = []
    app.all_build_train_numbers.each do |version|
        build = latest_testflight_build_number(version: version, app_identifier: "foo.bar", username: "username")
        build_versions.push(build)
    end
    build_number = build_versions.max.to_i + 1
  end

@volmus @pparmaei I just noticed that I confused you both as you have the both avatar - hazard of reading a few dozens new issues a day across repositories. I apologize.

Problem is that Apple removed some APIs and we are trying to find replacements and get those implemented.

@pparmaei You could help us by creating a new issue and including the whole output including the full stacktrace you are getting and also your fastlane env (even if for 2.210.0) output. I think your problem is separate from what @volmus reported here, so having its own issue would help us - even if just to track that you update it when 2.212.0 was released.) Thanks.