fastlane: Unable to distribute to testflight builds

Question Checklist

Question Subject

Error when distributing testflight builds via pilot.

Question Description

We started seeing these errors in our CI pipe line a couple weeks ago that says we are unable to update the change log. But seems like there is something else going on here. As we haven’t made any changes to our fastlane scripts, anyone else having issues like this starting a couple weeks ago?

Here’s are verbose log:

ERROR [2019-01-07 17:11:12.56]: fastlane finished with errors
Traceback (most recent call last):
	24: from /Users/chwon/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:24:in `<main>'
	23: from /Users/chwon/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:24:in `eval'
	22: from /Users/chwon/.rvm/gems/ruby-2.5.1/bin/fastlane:23:in `<main>'
	21: from /Users/chwon/.rvm/gems/ruby-2.5.1/bin/fastlane:23:in `load'
	20: from /Users/chwon/.rvm/gems/ruby-2.5.1@global/gems/fastlane-2.113.0/bin/fastlane:23:in `<top (required)>'
	19: from /Users/chwon/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/fastlane-2.113.0/fastlane/lib/fastlane/cli_tools_distributor.rb:108:in `take_off'
	18: from /Users/chwon/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/fastlane-2.113.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
	17: from /Users/chwon/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/fastlane-2.113.0/fastlane/lib/fastlane/commands_generator.rb:333:in `run'
	16: from /Users/chwon/.rvm/gems/ruby-2.5.1/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
	15: from /Users/chwon/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/fastlane-2.113.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
	14: from /Users/chwon/.rvm/gems/ruby-2.5.1/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
	13: from /Users/chwon/.rvm/gems/ruby-2.5.1/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
	12: from /Users/chwon/.rvm/gems/ruby-2.5.1/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
	11: from /Users/chwon/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/fastlane-2.113.0/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
	10: from /Users/chwon/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/fastlane-2.113.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
	 9: from /Users/chwon/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/fastlane-2.113.0/fastlane/lib/fastlane/lane_manager.rb:56:in `cruise_lane'
	 8: from /Users/chwon/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/fastlane-2.113.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
	 7: from /Users/chwon/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/fastlane-2.113.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
	 6: from /Users/chwon/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/fastlane-2.113.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
	 5: from /Users/chwon/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/fastlane-2.113.0/fastlane/lib/fastlane/lane.rb:33:in `call'
	 4: from ../../Common/fastlane/Fastfile:382:in `block (2 levels) in parsing_binding'
	 3: from /Users/chwon/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/fastlane-2.113.0/pilot/lib/pilot/build_manager.rb:88:in `distribute'
	 2: from /Users/chwon/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/fastlane-2.113.0/pilot/lib/pilot/build_manager.rb:92:in `rescue in distribute'
	 1: from /Users/chwon/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/fastlane-2.113.0/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in `method_missing'
/Users/chwon/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/fastlane-2.113.0/fastlane_core/lib/fastlane_core/ui/interface.rb:141:in `user_error!': [!] Could not set changelog:


<html> (FastlaneCore::Interface::FastlaneError)
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 409 </title>
</head>
<body>
<h2>HTTP ERROR: 409</h2>
<p>Problem accessing /v2/providers/302756/apps/1382945144/builds/37665298. Reason:
<pre>    ERROR-1: Enter a demo account user name, or deselect "A demo account is required to use all the features of the app."; ERROR-1: Enter demo account password, or deselect "A demo account is required to use all the features of the app."</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>
</body>
</html>

Other jobs failed with this error: The build is not in state for internal testing. - Build is not in internal testing state.

/usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.112.0/spaceship/lib/spaceship/connect_api/client.rb:84:in `handle_response': [!] The build is not in state for internal testing. - Build is not in internal testing state. (Spaceship::UnexpectedResponse)
	from /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.112.0/spaceship/lib/spaceship/connect_api/client.rb:66:in `post_for_testflight_review'
	from /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.112.0/spaceship/lib/spaceship/test_flight/build.rb:223:in `submit_for_testflight_review!'
	from /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.112.0/pilot/lib/pilot/build_manager.rb:183:in `distribute_build'
	from /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.112.0/pilot/lib/pilot/build_manager.rb:108:in `distribute'
	from ../../Common/fastlane/Fastfile:382:in `block (2 levels) in parsing_binding'
	from /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.112.0/fastlane/lib/fastlane/lane.rb:33:in `call'
	from /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.112.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
	from /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.112.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
	from /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.112.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
	from /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.112.0/fastlane/lib/fastlane/lane_manager.rb:56:in `cruise_lane'
	from /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.112.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
	from /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.112.0/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
	from /usr/local/lib/ruby/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
	from /usr/local/lib/ruby/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
	from /usr/local/lib/ruby/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
	from /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.112.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
	from /usr/local/lib/ruby/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
	from /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.112.0/fastlane/lib/fastlane/commands_generator.rb:333:in `run'
	from /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.112.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
	from /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.112.0/fastlane/lib/fastlane/cli_tools_distributor.rb:108:in `take_off'
	from /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.112.0/bin/fastlane:23:in `<top (required)>'
	from /usr/local/bin/fastlane:23:in `load'
	from /usr/local/bin/fastlane:23:in `<main>'

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 6
  • Comments: 76 (25 by maintainers)

Most upvoted comments

Not a problem! I try to respond quickly to most things especially after a release 🙃 I will comment here when the release is out!

Hello, fam! I finally got a working set of API calls to get this fixed over at #14224 😇 There are some example raw spaceship calls right now that will do the job for now.

I’m now going to work on implementing these calls into all the places that pilot needs them for everything to work like it used to 💪 Thank you for being patient with this! ❤️

Update 1: Now able to set demo account info (required, username, and password) for an app as well as bonus contact info (first name, last name, email, and phone number)

I did some logging of what all new APIs App Store Connect is using for doing this now. I have an idea of what needs to get done to get this fixed for everyone now and will be trying to get it out this week 👍

Heyyyy 👋 I’ll be working on a fix for this in the AM and will hopefully a fix for this in the next release early next week 👌

Sent with GitHawk

Okay, this is the one! 2.117.1 is out 💪

This also explains why the first app in my run publishes but the rest fail with the error. All same version and build number but different bundle ids.

Sorry about that! I changed this method name and that commit somehow did not make it in which I’m very confused about 🤔 Running tests now and then I will pop a new build!

Will fix right away!

@matcartmill Yessss! So glad to hear. I have some cleanup to do in the spaceship code that I wrote but should be out later today or tomorrow AM.

And sorry again for taking so long 😔 This fixed ended up adding 11 new APIs that we had to call so discovering, adapting, and testing them all took a lot longer than I expected 😬

sadly 'notify_external_testers: true' didn’t fix it for us, still

Spaceship::UnexpectedResponse: [!] The build is not in state for internal testing. - Build is not in internal testing state.
  /usr/local/lib/ruby/gems/2.6.0/gems/fastlane-2.113.0/spaceship/lib/spaceship/connect_api/client.rb:84:in `handle_response'

@tprevost-phunware Ahhh, thanks for finding that! Going to test this out myself and put a fix in for this right away 😱 😱 😱 Will get this fixed and a new release pushed out tomorrow with this and THEN we can officially close this thread 🙃🤞

@mjooms Hey no prob! Thanks to you guys for all the awesome work you do on Fastlane!

Will look into today!!

Sent with GitHawk

Does not fix the issue for our builds 😔

2019-03-05T01:14:00.4929920Z Spaceship::UnexpectedResponse: [!] The build is not in state for internal testing. - Build is not in internal testing state.
2019-03-05T01:14:00.4930960Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/spaceship/lib/spaceship/connect_api/client.rb:274:in `handle_response'
2019-03-05T01:14:00.4931740Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/spaceship/lib/spaceship/connect_api/client.rb:256:in `post_beta_app_review_submissions'
2019-03-05T01:14:00.4932500Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/spaceship/lib/spaceship/test_flight/build.rb:223:in `submit_for_testflight_review!'
2019-03-05T01:14:00.4933170Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/pilot/lib/pilot/build_manager.rb:217:in `distribute_build'
2019-03-05T01:14:00.4933860Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/pilot/lib/pilot/build_manager.rb:93:in `distribute'
2019-03-05T01:14:00.4934530Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/pilot/lib/pilot/build_manager.rb:61:in `upload'
2019-03-05T01:14:00.4935200Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/actions/upload_to_testflight.rb:16:in `run'
2019-03-05T01:14:00.4936560Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/runner.rb:253:in `block (2 levels) in execute_action'
2019-03-05T01:14:00.4937240Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
2019-03-05T01:14:00.4937920Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/runner.rb:232:in `block in execute_action'
2019-03-05T01:14:00.4939000Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/runner.rb:227:in `chdir'
2019-03-05T01:14:00.4939670Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/runner.rb:227:in `execute_action'
2019-03-05T01:14:00.4940370Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
2019-03-05T01:14:00.4940890Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/fast_file.rb:154:in `method_missing'
2019-03-05T01:14:00.4941210Z   Fastfile:205:in `block (2 levels) in parsing_binding'
2019-03-05T01:14:00.4941610Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/lane.rb:33:in `call'
2019-03-05T01:14:00.4942870Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/runner.rb:204:in `try_switch_to_lane'
2019-03-05T01:14:00.4943310Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/runner.rb:146:in `trigger_action_by_name'
2019-03-05T01:14:00.4943730Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/fast_file.rb:154:in `method_missing'
2019-03-05T01:14:00.4944060Z   Fastfile:193:in `block (2 levels) in parsing_binding'
2019-03-05T01:14:00.4944460Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/lane.rb:33:in `call'
2019-03-05T01:14:00.4944880Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
2019-03-05T01:14:00.4945300Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/runner.rb:45:in `chdir'
2019-03-05T01:14:00.4945710Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/runner.rb:45:in `execute'
2019-03-05T01:14:00.4946130Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/lane_manager.rb:56:in `cruise_lane'
2019-03-05T01:14:00.4946550Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
2019-03-05T01:14:00.4947040Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
2019-03-05T01:14:00.4947460Z   /drop/vendor/bundle/ruby/2.3.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
2019-03-05T01:14:00.4948210Z   /drop/vendor/bundle/ruby/2.3.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
2019-03-05T01:14:00.4948630Z   /drop/vendor/bundle/ruby/2.3.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
2019-03-05T01:14:00.4949060Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
2019-03-05T01:14:00.4949470Z   /drop/vendor/bundle/ruby/2.3.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
2019-03-05T01:14:00.4950140Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/commands_generator.rb:333:in `run'
2019-03-05T01:14:00.4950560Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
2019-03-05T01:14:00.4951000Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/fastlane/lib/fastlane/cli_tools_distributor.rb:119:in `take_off'
2019-03-05T01:14:00.4951400Z   /drop/vendor/bundle/ruby/2.3.0/gems/fastlane-2.117.1/bin/fastlane:23:in `<top (required)>'
2019-03-05T01:14:00.4951770Z   /drop/vendor/bundle/ruby/2.3.0/bin/fastlane:23:in `load'
2019-03-05T01:14:00.4952160Z   /drop/vendor/bundle/ruby/2.3.0/bin/fastlane:23:in `<top (required)>'
2019-03-05T01:14:00.5444320Z ##[error]Bash exited with code '1'.

@joshdholtz I ll be taking a look at this as well - unless you found out what’s going on.

I have just added an additional parameter 'notify_external_testers: true' to pilot method and now it works fine. Have just tested this twice. So now I pass next parameters:

pilot(
				changelog: '[RELEASE_NOTES]',
				skip_submission: false,
				skip_waiting_for_build_processing: false,
				beta_app_feedback_email: '[FEEDBACK_EMAIL]',
				beta_app_description: '[DESCRIPTION]',
				distribute_external: true,
				notify_external_testers: true,
				wait_for_uploaded_build: true,
				groups: ENV['TESTFLIGHT_GROUPS']
			)

We are seeing this too, on both 2.112.0 and 2.113.0, but it seems to be sporadic. It’s been happening since the original changes to the App Store Connect API last month https://github.com/fastlane/fastlane/issues/13903#issuecomment-447713864

The build is not in state for internal testing. - Build is not in internal testing state. 

We were able to get past it I think by brute force but we’re having repeated failures now trying to get a new release out the door. Happy to supply additional info/logs/etc

amazing! thanks everyone.

Thx for the one-two @tprevost-phunware Great that it’s fixed!

Nice that we’re closing in on the fix - thanks @joshdholtz!

But … (sorry) … I have that key in my Info.plist and have for a while but I still get the not in internal testing error.

Weirder still though, is that I use the same project/repo on two Jenkins builds, calling the same build/fastlane script, and one of them will succeed every time, and another will fail with that error every time.

If this fix makes it go away then lovely, otherwise happy to provide any info / troubleshooting needed.

i have the same problem.

✅ fastlane environment ✅

Stack

Key Value
OS 10.14.3
Ruby 2.4.0
Bundler? true
Git git version 2.17.2 (Apple Git-113)
Installation Source ~/.rvm/gems/ruby-2.4.0/bin/fastlane
Host Mac OS X 10.14.3 (18D109)
Ruby Lib Dir ~/.rvm/rubies/ruby-2.4.0/lib
OpenSSL Version OpenSSL 1.1.1b 26 Feb 2019
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 10.1

System Locale

Variable Value
LANG en_US.UTF-8
LC_ALL en_US.UTF-8
LANGUAGE en_US.UTF-8
Gem Version Update-Status
fastlane 2.117.1 ✅ Up-To-Date
Loaded gems
Gem Version
did_you_mean 1.1.0
executable-hooks 1.6.0
bundler-unload 1.0.2
rubygems-bundler 1.4.5
bundler 1.16.6
CFPropertyList 3.0.0
concurrent-ruby 1.1.4
i18n 0.9.5
minitest 5.11.3
thread_safe 0.3.6
tzinfo 1.2.5
activesupport 4.2.11
public_suffix 2.0.5
addressable 2.6.0
atomos 0.1.3
babosa 1.0.2
chunky_png 1.3.11
claide 1.0.2
fuzzy_match 2.0.4
nap 1.1.0
cocoapods-core 1.5.3
cocoapods-deintegrate 1.0.2
cocoapods-downloader 1.2.2
cocoapods-plugins 1.0.0
cocoapods-search 1.0.0
cocoapods-stats 1.1.0
netrc 0.11.0
cocoapods-trunk 1.3.1
cocoapods-try 1.1.0
colored2 3.1.2
escape 0.0.4
fourflusher 2.0.1
gh_inspector 1.1.3
molinillo 0.6.6
ruby-macho 1.4.0
nanaimo 0.2.6
xcodeproj 1.8.1
cocoapods 1.5.3
colorize 0.8.1
gli 2.18.0
plist 3.5.0
big_resources 0.1.1
big_stash 0.6.0
bigkeeper 0.9.1.pre.dada
colored 1.2
highline 1.7.10
commander-fastlane 4.4.6
declarative 0.0.10
declarative-option 0.1.0
digest-crc 0.4.1
unf_ext 0.0.7.5
unf 0.1.4
domain_name 0.5.20180417
dotenv 2.7.1
emoji_regex 1.0.1
excon 0.62.0
multipart-post 2.0.0
faraday 0.15.4
http-cookie 1.0.3
faraday-cookie_jar 0.0.6
faraday_middleware 0.13.1
fastimage 2.1.5
jwt 2.1.0
memoist 0.16.0
multi_json 1.13.1
os 1.0.0
signet 0.11.0
googleauth 0.6.7
httpclient 2.8.3
mime-types-data 3.2018.0812
mime-types 3.2.2
uber 0.1.0
representable 3.0.4
retriable 3.1.2
google-api-client 0.23.9
google-cloud-env 1.0.5
google-cloud-core 1.3.0
google-cloud-storage 1.16.0
json 2.2.0
mini_magick 4.5.1
multi_xml 0.6.0
rubyzip 1.2.2
security 0.1.3
naturally 2.2.0
simctl 1.6.5
slack-notifier 2.3.2
terminal-notifier 1.8.0
unicode-display_width 1.5.0
terminal-table 1.8.0
tty-screen 0.6.5
tty-cursor 0.6.1
tty-spinner 0.9.0
word_wrap 1.0.0
rouge 2.0.7
xcpretty 0.3.0
xcpretty-travis-formatter 1.0.0
fastlane-plugin-pgyer 0.2.2

generated on: 2019-03-12

################################

[!] The build is not in state for internal testing. - Build is not in internal testing state. (Spaceship::UnexpectedResponse) from /Users/lishaoshuai/.rvm/gems/ruby-2.4.0/gems/fastlane-2.117.1/spaceship/lib/spaceship/connect_api/client.rb:256:in `post_beta_app_review_submissions’

The problem isn’t fixed. See logs below.

[16:19:47]: Successfully finished processing the build 2019.5 - 41102
[16:19:49]: Successfully set the changelog for build
[16:19:59]: Another build is already in review. Going to expire that build and submit the new one.
[16:19:59]: Expiring build: 2019.6 - 41033
[16:20:03]: Expired previous build: 2019.6 - 41033
[16:20:03]: Distributing new build to testers: 2019.5 - 41102
+------------------+------------+
|         Lane Context          |
+------------------+------------+
| DEFAULT_PLATFORM | ios        |
| ENVIRONMENT      | radarpro   |
| PLATFORM_NAME    | ios        |
| LANE_NAME        | ios upload |
+------------------+------------+
[16:20:06]: The build is not in state for internal testing. - Build is not in internal testing state.

It seems to me that a little more time is needed cause the dsyms download also don’t work immediately after the build has been processed. I delayed the download_dsyms job by 20 seconds and then it works. I know it sounds like a work around but may the distribution needs a timeout or another check if the api provides such a check?!

I also noticed that setting a changelog also doesn’t work. Seems to be a related issue cause the build ain’t ready yet.

I’m experiencing the same as @tprevost-phunware on 2.117.0:

NoMethodError: [!] undefined method `post_for_testflight_review' for #<Spaceship::ConnectAPI::Client:0x007fd35e861378>

@joshdholtz Your branch fixed the issue for me. Any timeframe on when this will be available as a release?

Hopefully (🤞) this is the last update before this are ready to test and get merged in 😉 Things are all working now but today I’m spending time on doing a lot of testing around this and trying to minimize any migration that may need to happen. Since we are using new APIs now, the options no longer are a 1-to-1 match with the the API expects. The new API allow for more settings (and even localized values) but the current pilot options do not. I’m working on massaging the current pilot options to work with the new localize values so there shouldn’t be any migration for anyway that doesn’t want to do it (yet).

I will add one more comment on here on how to update to my PR/branch in your Gemfile (along with any notes about new things) if you’d like to give this a try later today ❤️

@joshdholtz Yep, that worked for me! Thanks so much! 😄 🎉

@joshdholtz Oh wow that was quick! Thanks! I’m testing it out now! 🤞😁

I did some digging. Looks like app is not present in the builds list as an attribute, but you CAN filter by it when you have the (numeric) app id.

https://appstoreconnect.apple.com/iris/v1/builds?filter[app]=$numericAppId

I’m not familiar with the fastlane codebase, but this might just fix the issue, assuming app_id is the same as the $numericAppId in the URL above:

resp = Spaceship::ConnectAPI::Base.client.get_builds(
  filter: { 
    app: app_id,
    expired: false, 
    processingState: "PROCESSING,VALID", 
    version: self.build_version 
})

I’m going to see if I can use this next upload.

@tprevost-phunware Interesting find about the version numbers. We have two apps with different bundle IDs too, but with the same version number and same build number. It looks like fastlane is retrieving all builds for version nr X and build number Y but is ignoring the bundle ID. It then finds all builds with version X build Y and uses the first one it finds. But if the first one found is of another app… it makes sense that build is not in the correct state then.

Based on the implementation of find_app_store_connect_build looks like bundle ID might be missing in the filter:

resp = Spaceship::ConnectAPI::Base.client.get_builds(
  filter: { expired: false, processingState: "PROCESSING,VALID", version: self.build_version })
resp.first

@joshdholtz WYT?

I just did an update of fastlane to 2.118.1 and did another deploy run and got same errors. Not sure whatever fix is merged into latest release yet. x10 apps all the same version and build number.

@joshdholtz Pleased to say that my failing build has now succeeded a few times since the change, so whether it was a direct or indirect fix it seems to be working ok! Don’t wanna jinx it but 👍 Nice one!

@joshdholtz After trying out the master branch (since joshdholtz-patch-beta-build-and-wait has been deleted) and doing a bundle update, I’m still getting the The build is not in state for internal testing. - Build is not in internal testing state error for the same builds, even though they have the ITSAppUsesNonExemptEncryption key (with a value of NO) in their Info.plists. 😞

A PR is up if anybody wants to give this a whirl! Put this in your Gemfile to switch to my branch and running with bundle install or bundle update

gem "fastlane", :git => "https://github.com/fastlane/fastlane.git", :branch => "joshdholtz-patch-beta-build-and-wait"

🤞🤞🤞🤞🤞🤞🤞🤞 #worksonmymachine

Same as @tprevost-phunware we have 10+ apps utilising same codebase (via local pod) with each host app being identical except for a config param and icons. One of 10 works deploying successfully. The rest get the The build is not in state for internal testing. - Build is not in internal testing state. I was thinking about increasing the wait_processing_interval from default of 30 to a minute just to see if that solves it. 🤷‍♂️ Appreciate all looking into the issue.

@tprevost-phunware Thanks. Then that’s not it.

Got a solution for this! Finishing up and then hopefully getting this out the door today

With 2.117.1, I am experiencing the same as @pchmelar.

Again, I’m experiencing the same as @pchmelar unfortunately.

Awesome! Thanks so much!! I’m trying it out asap!

No worries! Thanks for responding and fixing it so quickly! 😄

Okay, its ready!! So for taking so long 😱 Put this in your Gemfile to switch to my branch and running with bundle install or bundle update

gem "fastlane", :git => "https://github.com/fastlane/fastlane.git", :branch => "joshdholtz-fix-pilot-with-new-connect-api-beta-calls"

This ended up being a whole thing because the new API introduce localizations into things that we didn’t support. I added a few new options in pilot that allow for setting of things differently for localizations but I also back supported the existing pilot options that you are all using which sets the same value over all localizations.

So switching to this branch sshhhooouuuuuuulllldddnnn’ttttttt requires any changes in your Fastfile 🤞 I will monitor this all week and please let me know of any feedback/errors that occur! It “works on my machine” 😝 (and in the tests)

@joshdholtz I can try to test this today. We are seeing three separate classes of failures intermittently :

  1. 500 - server error. Probably a systemwide issue.
  2. Silent failure.
  3. Failure that is reported on spaceship on this issue.

And sometimes, magically it works. 😦

I’m also seeing the "The build is not in state for internal testing. - Build is not in internal testing state." error, but only on 2 of 3 identical Jenkins build jobs. They had all been using the same Fastfile successfully, then 2 of them failed as soon as we updated to fastlane 2.109.1. I’m yet to work out what the difference is to make them fail - but happy to provide debug info as requested.

@charles-won Heyyyyyy 👋 So we recently had to make a change to use the new App Store Connect API to distribute builds via Test Flight. Apple removed the private APIs that we were using. This implementation just went out today in 2.113.0 which appears you may have run into an issue with that. It worked for me and some other users that tried out that feature early but it appears that its implementation isn’t working 100% yet.

Are you attempting to to set demo account into at all? How are you calling this? Can you paste what commands you are using or what your Fastfile looks like so I can try to replicate?

Thanks ❤️