altool sometimes fails with exit code 239

We are seeing some failures every now and then in our notarization TeamCity job where the "altool --notarization-info" command is failing with exit code 239. I didn't find anything about this by googling, except that the Mozilla guys are seeing the same issue (https://bugzilla.mozilla.org/show_bug.cgi?id=1562412).


What does exit code 239 mean and can we prevent it somehow?

Accepted Reply

I ran your problem description past the notarisation server team and, alas, this is a known issue at our end (r. 56388314). Unfortunately I don’t think there’s any guaranteed way around this; your best bet is to retry after a reasonable delay.

On a related note, framillien wrote:

Can you provide a list of exit codes returned by 'xcrun altool' ?

No. If this info would be useful to you, file an enhancement request against the

altool
man page.

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Replies

It seems we are seeing more and more of this lately. Could someone at Apple help with this one?

Can you post a transcript of the failure? That is, the

altool
command you issued and its full output.

Please use the

<>
icon to format it as code.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

At 17:20:19:


$ /Applications/Xcode10.app/Contents/Developer/usr/bin/altool --notarization-info 79a620ce-a210-465c-a04c-2e3970d1b74a --username "$USER" --password "$PASSWORD" --output-format xml
<?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>notarization-info</key>
    <dict>
        <key>Date</key>
        <date>2019-10-22T14:20:20Z</date>
        <key>RequestUUID</key>
        <string>79a620ce-a210-465c-a04c-2e3970d1b74a</string>
        <key>Status</key>
        <string>in progress</string>
    </dict>
    <key>os-version</key>
    <string>10.13.6</string>
    <key>success-message</key>
    <string>No errors getting notarization info.</string>
    <key>tool-path</key>
    <string>/Applications/Xcode10.app/Contents/Applications/Application Loader.app/Contents/Frameworks/ITunesSoftwareService.framework</string>
    <key>tool-version</key>
    <string>1.1.1138</string>
</dict>
</plist>


At 17:20:51:


$ /Applications/Xcode10.app/Contents/Developer/usr/bin/altool --notarization-info 79a620ce-a210-465c-a04c-2e3970d1b74a --username "$USER" --password "$PASSWORD" --output-format xml
<?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.13.6</string>
    <key>product-errors</key>
    <array>
        <dict>
            <key>code</key>
            <integer>1519</integer>
            <key>message</key>
            <string>Could not find the RequestUUID.</string>
            <key>userInfo</key>
            <dict>
                <key>NSLocalizedDescription</key>
                <string>Could not find the RequestUUID.</string>
                <key>NSLocalizedFailureReason</key>
                <string>Apple Services operation failed.</string>
                <key>NSLocalizedRecoverySuggestion</key>
                <string>Could not find the RequestUUID.</string>
            </dict>
        </dict>
    </array>
    <key>tool-path</key>
    <string>/Applications/Xcode10.app/Contents/Applications/Application Loader.app/Contents/Frameworks/ITunesSoftwareService.framework</string>
    <key>tool-version</key>
    <string>1.1.1138</string>
</dict>
</plist>

[For those reading along at home, the point of spartan1’s post is that the two

notarisation-info
requests are identical, and the first works and the second fails.]

I notice you’re using Xcode 10 here. Does the problem reproduce with a more modern

altool
?

Note If you can’t install Xcode 11, you can use the

altool
embedded with the Transporter app.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

I just tried to do couple of notarizations with the altool from Transporter (version 1.1.1149), and it seems to work. I'll report back if we still see the error in the future.

We got the error 239 today also with altool from Transporter. Unfortunately I don't have the command output as the script we use for notarization swallowed it. Anyway, it seems updating altool didn't resolve the issue.

So, just to confirm:

  • You ran an

    --notarization-info
    , as shown by your 22 Oct post
  • altool
    failed, as shown by the second example in that post
  • The exit status was 239?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

$ /Applications/Xcode10.app/Contents/Developer/usr/bin/altool --notarization-info 79a620ce-a210-465c-a04c-2e3970d1b74a --username "$USER" --password "$PASSWORD" --output-format xml


notarization-info Date 2019-10-22T14:20:20Z RequestUUID 79a620ce-a210-465c-a04c-2e3970d1b74a Status in progress os-version 10.13.6 success-message No errors getting notarization info. tool-path /Applications/Xcode10.app/Contents/Applications/Application Loader.app/Contents/Frameworks/ITunesSoftwareService.framework tool-version 1.1.1138

Yes, --notarization-info failed with 239 again. This time I didn't see an "in-progress" response between --notarize-app returning and the failure, though.


The notarization is done by a script, so --notarization-info was ran right after --notarize-app returned.


$ /Applications/Transporter.app/Contents/Frameworks/ITunesServices.framework/Versions/A/Frameworks/ITunesSoftwareService.framework/Versions/A/Support/altool --notarize-app --primary-bundle-id "$BUNDLE_ID" --username "$USER" --password "$PASSWORD" --file $ZIP --output-format xml
<?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>notarization-upload</key>
    <dict>
        <key>RequestUUID</key>
        <string>08ebc7eb-1a21-493f-9dbe-af06d2423911</string>
    </dict>
    <key>os-version</key>
    <string>10.13.6</string>
    <key>success-message</key>
    <string>No errors uploading '/var/folders/jy/22t1qnw112d37fg586q4gb_40000gr/T/tmp.9URV0deH.zip'.</string>
    <key>tool-path</key>
    <string>/Applications/Transporter.app/Contents/Frameworks/ITunesServices.framework/Versions/A/Frameworks/ITunesSoftwareService.framework</string>
    <key>tool-version</key>
    <string>1.1.1149</string>
</dict>
</plist>


$ /Applications/Transporter.app/Contents/Frameworks/ITunesServices.framework/Versions/A/Frameworks/ITunesSoftwareService.framework/Versions/A/Support/altool --notarization-info 08ebc7eb-1a21-493f-9dbe-af06d2423911 --username "$USER" --password "$PASSWORD" --output-format xml
<?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.13.6</string>
    <key>product-errors</key>
    <array>
        <dict>
            <key>code</key>
            <integer>1519</integer>
            <key>message</key>
            <string>Could not find the RequestUUID.</string>
            <key>userInfo</key>
            <dict>
                <key>NSLocalizedDescription</key>
                <string>Could not find the RequestUUID.</string>
                <key>NSLocalizedFailureReason</key>
                <string>Apple Services operation failed.</string>
                <key>NSLocalizedRecoverySuggestion</key>
                <string>Could not find the RequestUUID.</string>
            </dict>
        </dict>
    </array>
    <key>tool-path</key>
    <string>/Applications/Transporter.app/Contents/Frameworks/ITunesServices.framework/Versions/A/Frameworks/ITunesSoftwareService.framework</string>
    <key>tool-version</key>
    <string>1.1.1149</string>
</dict>
</plist>

Hi,


Same problem in our CI server. Sometime xcrun altool answer with a 239 error, and an explicit message:

*** Error: Apple Services operation failed. Could not find the RequestUUID.


If we retry later (from 1 to 3mn) the same call succeed with a result "In progress", until notarization completion. So, we can ignore this return code, and keep waiting for an "in progress" answer but more informations could be helpfull:
- Is this code 239 dedicated to 'requestUUID not found' response or it's a more generic error code ?
- Can you provide a list of exit codes returned by 'xcrun altool' ?
Thanks,

# First call right after the UUID was returned by 'xcrun altool'
xcrun altool -u 'XXXX' --notarization-info 9dcb6928-c3d1-4ae7-84ce-5aaa5203e709
2019-10-28 19:00:41.161 altool[89282:31450767] *** Error: Apple Services operation failed. Could not find the RequestUUID.

# Another call 1mn later:
xcrun altool -u 'XXXX' --notarization-info 9dcb6928-c3d1-4ae7-84ce-5aaa5203e709
2019-10-28 19:01:51.960 altool[89504:31451843] No errors getting notarization info.

   RequestUUID: 9dcb6928-c3d1-4ae7-84ce-5aaa5203e709
          Date: 2019-10-28 18:00:43 +0000
        Status: in progress
    LogFileURL: (null)

I observed the same issue around the 20th of October. The product-errors tag started appearing. And altool started exited with an error code accordingly.


This required to modify a bit the shell script running the notarization process.


It would help if the product-errors code were documented.

I ran your problem description past the notarisation server team and, alas, this is a known issue at our end (r. 56388314). Unfortunately I don’t think there’s any guaranteed way around this; your best bet is to retry after a reasonable delay.

On a related note, framillien wrote:

Can you provide a list of exit codes returned by 'xcrun altool' ?

No. If this info would be useful to you, file an enhancement request against the

altool
man page.

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks for confirming. We'll add the retry logic to our script.