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

Scan hangs when getting build settings #4059

Closed
2 tasks done
ldiqual opened this issue Apr 4, 2016 · 48 comments
Closed
2 tasks done

Scan hangs when getting build settings #4059

ldiqual opened this issue Apr 4, 2016 · 48 comments

Comments

@ldiqual
Copy link
Contributor

ldiqual commented Apr 4, 2016

New Issue Checklist

Issue Description

Scan hangs when getting the build settings:

xcrun xcodebuild -showBuildSettings -workspace './App.xcworkspace' -scheme 'AppTests'

A couple things to note:

  • I thought that it was related to gym hangs on xcrun #1844 since it was the last command showing up in the logs, but after looking at the stacktrace when I force quite fastlane, it seems that it's actually hanging on showBuildSettings.
  • I can reproduce the freeze by running the -showBuildSettings command manually, though it only happens one time out of five, something like that.
  • It happens consistently when running in a CI environment (circleci 7.3)
  • It started happening after I removed all files in the App target from the AppTests target. Instead, I now have @testable import App everywhere. This change required to modify my Podfile to have different pods for the AppTests target (see below)
  • DerivedData is relative to my project directory.
Complete output when running fastlane, including the stack trace and command used

Please note that I modified fastlane_core's sources to show the build settings command, which is why it shows up in the logs. If I hadn't, only the -list command would appear.

ldiqual@ldiqual-mbp ~/S/App-ios-test1> bundle exec fastlane test --verbose
/Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/commander-4.3.5/lib/commander/user_interaction.rb:334: warning: constant ::TimeoutError is deprecated
INFO [2016-04-04 15:18:48.74]: ---------------------------
INFO [2016-04-04 15:18:48.74]: --- Step: opt_out_usage ---
INFO [2016-04-04 15:18:48.74]: ---------------------------
INFO [2016-04-04 15:18:48.74]: Disabled upload of used actions
INFO [2016-04-04 15:18:48.74]: -------------------------------------------------
INFO [2016-04-04 15:18:48.74]: --- Step: Verifying required fastlane version ---
INFO [2016-04-04 15:18:48.74]: -------------------------------------------------
INFO [2016-04-04 15:18:48.74]: fastlane version valid
INFO [2016-04-04 15:18:48.74]: ------------------------------
INFO [2016-04-04 15:18:48.74]: --- Step: default_platform ---
INFO [2016-04-04 15:18:48.74]: ------------------------------
INFO [2016-04-04 15:18:48.91]: Driving the lane 'ios test' 🚀
INFO [2016-04-04 15:18:48.91]: ------------------
INFO [2016-04-04 15:18:48.91]: --- Step: scan ---
INFO [2016-04-04 15:18:48.91]: ------------------
WARN [2016-04-04 15:18:48.93]: xcrun xcodebuild -list -workspace './App.xcworkspace'
2016-04-04 15:18:50.261 xcodebuild[94625:3349109] [MT] PluginLoading: Required plug-in compatibility UUID ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/SparkInspectorXcodePlugin.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2016-04-04 15:18:50.265 xcodebuild[94625:3349109] [MT] PluginLoading: Required plug-in compatibility UUID ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/FixCode.xcplugin' not present in DVTPlugInCompatibilityUUIDs
INFO [2016-04-04 15:18:51.94]: $ xcrun xcodebuild -showBuildSettings -workspace './App.xcworkspace' -scheme 'AppTests'
2016-04-04 15:18:52.174 xcodebuild[94629:3349189] [MT] PluginLoading: Required plug-in compatibility UUID ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/SparkInspectorXcodePlugin.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2016-04-04 15:18:52.176 xcodebuild[94629:3349189] [MT] PluginLoading: Required plug-in compatibility UUID ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/FixCode.xcplugin' not present in DVTPlugInCompatibilityUUIDs
^C/Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane_core-0.41.1/lib/fastlane_core/helper.rb:51:in ``': Interrupt
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane_core-0.41.1/lib/fastlane_core/helper.rb:51:in `backticks'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane_core-0.41.1/lib/fastlane_core/project.rb:203:in `build_settings'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane_core-0.41.1/lib/fastlane_core/project.rb:168:in `mac?'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane_core-0.41.1/lib/fastlane_core/project.rb:180:in `ios?'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/scan-0.5.2/lib/scan/detect_values.rb:23:in `set_additional_default_values'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/scan-0.5.2/lib/scan.rb:27:in `config='
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/scan-0.5.2/lib/scan/manager.rb:4:in `work'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.70.0/lib/fastlane/actions/scan.rb:10:in `run'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.70.0/lib/fastlane/runner.rb:143:in `block (2 levels) in execute_action'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.70.0/lib/fastlane/actions/actions_helper.rb:35:in `execute_action'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.70.0/lib/fastlane/runner.rb:129:in `block in execute_action'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.70.0/lib/fastlane/runner.rb:128:in `chdir'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.70.0/lib/fastlane/runner.rb:128:in `execute_action'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.70.0/lib/fastlane/fast_file.rb:149:in `method_missing'
    from Fastfile:16:in `block (2 levels) in parsing_binding'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.70.0/lib/fastlane/lane.rb:36:in `call'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.70.0/lib/fastlane/runner.rb:52:in `block in execute'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.70.0/lib/fastlane/runner.rb:46:in `chdir'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.70.0/lib/fastlane/runner.rb:46:in `execute'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.70.0/lib/fastlane/lane_manager.rb:46:in `cruise_lane'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.70.0/lib/fastlane/command_line_handler.rb:30:in `handle'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.70.0/bin/fastlane:38:in `block (2 levels) in run'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/commander-4.3.5/lib/commander/command.rb:153:in `run'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/commander-4.3.5/lib/commander/runner.rb:428:in `run_active_command'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane_core-0.41.1/lib/fastlane_core/ui/fastlane_runner.rb:23:in `run!'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/commander-4.3.5/lib/commander/delegates.rb:15:in `run!'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.70.0/bin/fastlane:156:in `run'
    from /Users/ldiqual/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.70.0/bin/fastlane:162:in `<top (required)>'
    from /Users/ldiqual/.rbenv/versions/2.3.0/bin/fastlane:23:in `load'
    from /Users/ldiqual/.rbenv/versions/2.3.0/bin/fastlane:23:in `<main>'
ldiqual@ldiqual-mbp ~/S/App-ios-test1> xcrun xcodebuild -showBuildSettings -workspace './App.xcworkspace' -scheme 'AppTests'
2016-04-04 15:31:51.235 xcodebuild[94673:3360581] [MT] PluginLoading: Required plug-in compatibility UUID ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/SparkInspectorXcodePlugin.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2016-04-04 15:31:51.238 xcodebuild[94673:3360581] [MT] PluginLoading: Required plug-in compatibility UUID ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/FixCode.xcplugin' not present in DVTPlugInCompatibilityUUIDs
Build settings for action build and target AppTests:

Note that the command above doesn't exit (1 time out of 5), I have to force kill it.

Configuration Files

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

Fastfile:

opt_out_usage
fastlane_version "1.49.0"
default_platform :ios

platform :ios do
  desc "Runs all the tests"
  lane :test do
    scan(scheme: "AppTests")
  end
end

Podfile:

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '9.0'
use_frameworks!
inhibit_all_warnings!

abstract_target 'Common' do

    target 'App'

    target 'AppTests' do
        pod 'SomePod'
    end

    pod 'SomeOtherPod'
end

Environment

fastlane 1.70.0
Bundler + rbenv
ruby 2.3.0
xcode 7.3
cocoapods 1.0.0.beta.6

@ldiqual
Copy link
Contributor Author

ldiqual commented Apr 4, 2016

Looks like carthage had the same issue and added a timeout: Carthage/Carthage#1120. And also on xctool: facebookarchive/xctool#295

@TKBurner
Copy link

TKBurner commented Apr 5, 2016

Hi @ldiqual Hope you are doing well! Can you let me know if this is a duplicate of #3886? Thanks!

@stepanhruda
Copy link

I solved this by having fewer targets in the scheme, I'm not sure if this applies to you. Oddly enough I was only experiencing this inside a VM, there is definitely something sketchy but after some investigation I blame xcodebuild

@ldiqual
Copy link
Contributor Author

ldiqual commented Apr 6, 2016

@TKBurner Thanks for getting back to me. I'm not too sure why you're thinking those issues could be related, I don't see any mention of -showBuildSettings hanging.

@stepanhruda Turns out that I worked around the issue by using scan on the main scheme instead of the test scheme. To be more specific, I had two schemes: App and AppTests, and was running scan ... -scheme AppTests, which was hanging during the -showBuildSettings step. Using scan ... - scheme App fixed the issue. As a result, I deleted the AppTests scheme to avoid future confusion.

I'll close the issue since I won't be able to reproduce it anyway, but @TKBurner I believe fastlane should have a timeout+retry on the showBuildSettings step, as implemented by other tools (see links above).

Thanks and have a great day!

@TKBurner
Copy link

TKBurner commented Apr 7, 2016

@ldiqual Thanks for following up. I'm going to mark this as a feature request so we can triage your idea:

I believe fastlane should have a timeout+retry on the showBuildSettings step, as implemented by other tools (see links above).'

Really glad to have you using Fastlane 👍

@bencollier
Copy link

We sorted this by moving the test schema up in the list of Manage Schemes. We had some schemes with spaces in - not sure if that could be part of the problem? We moved it above them and it started working.

Similar environment, CI (Jenkins) with rbenv.

Although - might have just been coincidental...

@TKBurner
Copy link

@bencollier Thanks for documenting your fix!

@fcy
Copy link
Contributor

fcy commented Apr 12, 2016

I'm having the same problem with a similar environment, my CI is TeamCity and I don't use rbenv (only Bundler). +1000 for timeout+retry

Also the logs should print the command that is being run, instead of the previous one.

@fcy
Copy link
Contributor

fcy commented Apr 12, 2016

Should this issue be closed since it is now a feature request?

@TKBurner
Copy link

@fcy Thanks for following up. We'll review this as a team and reply to it as a feature request. Hope that you have a wonderful week!

@TKBurner TKBurner reopened this Apr 13, 2016
@fcy
Copy link
Contributor

fcy commented Apr 13, 2016

Forgot to mention that none of the fixes worked for me. It happens constantly I the only that works for me is re-run the CI build.

@TKBurner
Copy link

@fcy Thanks for following up 👍 We'll follow up here with relevant updates.

@fcy
Copy link
Contributor

fcy commented Apr 15, 2016

One more thing for when you guys discuss it. If adding the auto-retry if not a good idea for you, at least add the timeout to make it fail fast so CI builds don't hang for 10 minutes or more before getting killed.

@TKBurner
Copy link

@fcy Thanks for following up! Good point 👍

@bencollier
Copy link

We hit this again in a different project, again running on Jenkins. Trying all these things fixed it;

  • Unticking show on all of the schemes that aren't actively used (for example, all the pods)
  • Unticking Shared on all the shared schemes
  • Reticking Shared on all the shared schemes
  • Changing some of the Scheme settings (like the targets that should be built)

It seems that sometimes the project / scheme files just needs something to change to fix this, these steps above seem to somehow kick it into action.

@TKBurner
Copy link

Hi @bencollier Thanks for following up. Can you let me know if it works consistently if you only have one target per scheme? Thanks!

@fcy
Copy link
Contributor

fcy commented May 2, 2016

Thanks for sharing @bencollier. FWIW I tried and none of that solved it for me.

@fcy
Copy link
Contributor

fcy commented May 3, 2016

Finally! PR #4492 fixes the problem once and for all. I hope it gets merged.

@TKBurner
Copy link

TKBurner commented May 4, 2016

Thanks @fcy! I'm going to bump that pull request internally so we can hopefully merge soon 👍

@hotbott
Copy link

hotbott commented Jul 21, 2016

Any news or plans to create a new PR?

@fcy
Copy link
Contributor

fcy commented Aug 12, 2016

Closed? Has it been fixed (I mean a fix merged and released)?

@TKBurner TKBurner reopened this Aug 12, 2016
@TKBurner
Copy link

@fcy What version of Xcode are you still experiencing this in? Thanks!

@fcy
Copy link
Contributor

fcy commented Aug 12, 2016

@TKBurner 7.3.1, I have been using #5188 to solve the problem but simce it isn't merged I asked to see if there were an official merged fix already.

@arkku
Copy link

arkku commented Aug 15, 2016

FWIW I am still experiencing this issue with XCode 8 Beta 5. It seems to me that fastlane does sometimes retry once, but that retry may also hang so I have to retry manually.

@TKBurner TKBurner self-assigned this Aug 15, 2016
larslockefeer pushed a commit to larslockefeer/fastlane that referenced this issue Aug 17, 2016
Update run_command to use Helper.backticks, and add the ability to retry before raising Timeout::Error

Fixes fastlane#4059
@hotbott
Copy link

hotbott commented Aug 18, 2016

@TKBurner I can see this issue on several App and Library projects. That leads to a hanging build server.
PR #5188 solves the issue. What's the reason not to accept it?
I don't want to remove fastlane from our projects, but that workaround is currently under discussion in my team.

@TKBurner
Copy link

Hi @hotbott Are you using Xcode 7 or 8? We are working on merging our PRs, so you'll see this in master soon.

Thanks!

@cooksimo
Copy link
Contributor

I'm having the same issue (using Xcode 7), this is getting pretty frustrating.

@TKBurner
Copy link

@revile Have you checked out the PR to see if it clears things up for you? Thanks!

@hotbott
Copy link

hotbott commented Aug 24, 2016

@TKBurner We're using Xcode 7.3.1 but Xcode 8 beta still has the same problem.
Thanks

@cooksimo
Copy link
Contributor

@TKBurner The PR will definitely help. Like others I can reproduce the issue manually in the command line by running the command in question, roughly 20% of the time this will hang in Terminal. Retrying will fix it.

@TKBurner
Copy link

@revile Thanks! Are you able to run it locally. We are working to merge our PRs but as you can see there are about 30 right now so it'll be faster for you to use that version until we are able to merge.

Thanks!

@mfurtak
Copy link
Contributor

mfurtak commented Sep 7, 2016

Hi all, we've shipped a workaround (#5626) and timeout/retry solution (#5188) as part of fastlane_core 0.51.0 🚀

Thanks very much for your help! Please let us know how it looks 👍

@mfurtak mfurtak reopened this Sep 7, 2016
@mfurtak mfurtak self-assigned this Sep 7, 2016
@mfurtak
Copy link
Contributor

mfurtak commented Sep 7, 2016

To test the latest release, please run [sudo] gem update fastlane_core or if you have a Gemfile, bundle update

@hotbott
Copy link

hotbott commented Sep 8, 2016

Thanks for merging! It works :)

@mfurtak
Copy link
Contributor

mfurtak commented Sep 8, 2016

Hi all, gym 1.9.0 💪 and scan 0.12.0 🔍 have been released to pick up these fastlane_core improvements.

To get updated and try them out, please run [sudo] gem update gym scan 🚀

@mfurtak
Copy link
Contributor

mfurtak commented Sep 9, 2016

I'm going to close this for now, but please feel free to continue the conversation and we can reopen as needed! 👍

@mfurtak mfurtak closed this as completed Sep 9, 2016
@fastlane fastlane locked and limited conversation to collaborators Dec 8, 2016
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