fastlane: Unable to distribute to testflight builds
Question Checklist
- Updated fastlane to the latest version
- I read the Contribution Guidelines
- I read docs.fastlane.tools
- I searched for existing GitHub issues
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)
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@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 😔
@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'
topilot
method and now it works fine. Have just tested this twice. So now I pass next parameters:We are seeing this too, on both
2.112.0
and2.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-447713864We 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 thenot 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
System Locale
Loaded gems
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.
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:
@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 currentpilot
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: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:@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 abundle update
, I’m still getting theThe build is not in state for internal testing. - Build is not in internal testing state
error for the same builds, even though they have theITSAppUsesNonExemptEncryption
key (with a value ofNO
) 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 withbundle install
orbundle update
🤞🤞🤞🤞🤞🤞🤞🤞 #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 thewait_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 withbundle install
orbundle update
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 existingpilot
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 :
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 sameFastfile
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 ❤️