Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Notarize plugin doesn't deliver error messages to user. #12

Open
papley opened this issue Oct 25, 2019 · 5 comments
Open

Notarize plugin doesn't deliver error messages to user. #12

papley opened this issue Oct 25, 2019 · 5 comments

Comments

@papley
Copy link

papley commented Oct 25, 2019

Running the plugin locally or under Travis, instead of a comprehensible error message, I got the stack trace at the bottom here. The underlying error was being provided by the xml response from Apple, shown just below, but the xml wasn't passed along, nor was the localized error description.

In order to get to the error, I had to modify my local copy of the plugin and get it to print out the arguments which were being passed to xcrun altool:

xcrun altool --notarize-app -t osx -f "*******" --primary-bundle-id ***** -u ***** -p "*****" --output-format xml,

then run the command locally and view the output. It would really be better to pass along the error, instead of generating a stack dump.

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>os-version</key>
        <string>10.15.1</string>
        <key>product-errors</key>
        <array>
                <dict>
                        <key>code</key>
                        <integer>1048</integer>
                        <key>message</key>
                        <string>You must first sign the relevant contracts online. (1048)</string>
                        <key>userInfo</key>
                        <dict>
                                <key>NSLocalizedDescription</key>
                                <string>You must first sign the relevant contracts online. (1048)</string>
                                <key>NSLocalizedFailureReason</key>
                                <string>You must first sign the relevant contracts online. (1048)</string>
                                <key>NSLocalizedRecoverySuggestion</key>
                                <string>You must first sign the relevant contracts online. (1048)</string>
                        </dict>
                </dict>
        </array>
        <key>tool-path</key>
        <string>/Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/Frameworks/AppStoreService.framework</string>
        <key>tool-version</key>
        <string>4.00.1181</string>
</dict>
</plist>

stack dump:

/Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane_core/lib/fastlane_core/ui/interface.rb:153:in `shell_error!': [!] Shell command exited with exit status 24 instead of 0. (FastlaneCore::Interface::FastlaneShellError)
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in `method_missing'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/helper/sh_helper.rb:80:in `sh_control_output'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/helper/sh_helper.rb:12:in `sh'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-plugin-notarize-0.3.0/lib/fastlane/plugin/notarize/actions/notarize_action.rb:42:in `run'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/runner.rb:256:in `block (2 levels) in execute_action'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/runner.rb:235:in `block in execute_action'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/runner.rb:227:in `chdir'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/runner.rb:227:in `execute_action'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/fast_file.rb:154:in `method_missing'
    from Fastfile:306:in `block (2 levels) in parsing_binding'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/lane.rb:33:in `call'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/lane_manager.rb:56:in `cruise_lane'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/commands_generator.rb:349:in `run'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/cli_tools_distributor.rb:119:in `take_off'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/bin/fastlane:23:in `<top (required)>'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/bin/fastlane:23:in `load'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/bin/fastlane:23:in `<main>'
    from /Users/travis/.rvm/gems/ruby-2.6.4/bin/ruby_executable_hooks:24:in `eval'
    from /Users/travis/.rvm/gems/ruby-2.6.4/bin/ruby_executable_hooks:24:in `<main>'
/Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane_core/lib/fastlane_core/ui/interface.rb:153:in `shell_error!': Shell command exited with exit status 24 instead of 0. (FastlaneCore::Interface::FastlaneShellError)
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in `method_missing'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/helper/sh_helper.rb:80:in `sh_control_output'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/helper/sh_helper.rb:12:in `sh'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-plugin-notarize-0.3.0/lib/fastlane/plugin/notarize/actions/notarize_action.rb:42:in `run'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/runner.rb:256:in `block (2 levels) in execute_action'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/runner.rb:235:in `block in execute_action'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/runner.rb:227:in `chdir'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/runner.rb:227:in `execute_action'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/fast_file.rb:154:in `method_missing'
    from Fastfile:306:in `block (2 levels) in parsing_binding'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/lane.rb:33:in `call'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/lane_manager.rb:56:in `cruise_lane'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/commands_generator.rb:349:in `run'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/cli_tools_distributor.rb:119:in `take_off'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/gems/fastlane-2.131.0/bin/fastlane:23:in `<top (required)>'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/bin/fastlane:23:in `load'
    from /Users/travis/build/USRID/Leash/vendor/bundle/ruby/2.6.0/bin/fastlane:23:in `<main>'
    from /Users/travis/.rvm/gems/ruby-2.6.4/bin/ruby_executable_hooks:24:in `eval'
    from /Users/travis/.rvm/gems/ruby-2.6.4/bin/ruby_executable_hooks:24:in `<main>'
The command "bundle exec fastlane $FLAVOR $LANE" exited with 1.

@berkcebi
Copy link
Member

berkcebi commented Nov 7, 2019

Hey @papley, thanks for the report. Do you think you can share a sample package so that we can recreate the issue on our end and debug it?

@papley
Copy link
Author

papley commented Nov 13, 2019

Now that there's a verbose logging option as of 13 days ago (commit 0d57649), I'm happy.

I use this in my Fastfile and it provides the information I need:
notarize(package: '.app', print_log: true, verbose: true)

It could be taken a step further and extract and present the error from the returned XML, so we don't have to turn on logging to see what went wrong:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> os-version 10.15.2 product-errors code 1048 message You must first sign the relevant contracts online. (1048)
<key>userInfo</key>
<key>NSLocalizedDescription</key> You must first sign the relevant contracts online. (1048) NSLocalizedFailureReason You must first sign the relevant contracts online. (1048) NSLocalizedRecoverySuggestion You must first sign the relevant contracts online. (1048) tool-path <string>/Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/Frameworks/AppStoreService.framework</string>
<key>tool-version</key>
<string>4.00.1181</string>
</dict>
</plist>

@papley
Copy link
Author

papley commented Nov 13, 2019

It seems that apple requires new contracts every few weeks, so such errors are well worth surfacing.

@papley
Copy link
Author

papley commented Nov 13, 2019

If you want to test it, just turn ensure you don't have a valid contract for the account in questions.

@iby
Copy link

iby commented Apr 6, 2020

Just run into the same issue. A detailed error message could have saved lots of debugging time. Like @papley suggests, printing the stderr output instead of the generic Shell command exited with exit status 24 instead of 0. would be enough. This isn't project dependent, so, there's nothing you can reproduce unless have an Apple Developer contract that expired or needs signing.

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

3 participants