Stapler returned with EX_NOHOST (68)

Dear Apple Support,

sometimes we observe exit code 68 in stapling via

xcrun stapler staple <pkg_file.pkg>

The notarization went fine but then stapling does not work. The output for the last ast failed launch looks like

Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=-2102, NSUnderlyingError=0x60000363c7b0 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <4F2E1620-9251-4525-91E7-C5F3E3681CD0>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(

"LocalDataTask <4F2E1620-9251-4525-91E7-C5F3E3681CD0>.<1>"

NSLocalizedDescription=The request timed out., NSErrorFailingURLStringKey=https://api.apple-cloudkit.com/database/1/com.apple.gk.ticket-delivery/production/public/records/lookup, NSErrorFailingURLKey=https://api.apple-cloudkit.com/database/1/com.apple.gk.ticket-delivery/production/public/records/lookup, _kCFStreamErrorDomainKey=4}

CloudKit's response is inconsistent with expections: (null)

As per manual of stapler and sysexit(3) the exit code means

EX_NOHOST (68)
The host specified did not exist. This is used in mail addresses or network requests.

Make a retry sense or is there any other things which is not set correctly at that time? What is your suggestion to avoid this failure and stabilizing our automation of notarization?

Best ergards, Stefan

stapler needs to be able to access Apple’s CloudKit servers. Clearly that’s failing in this case. My experience is that the CloudKit servers are pretty darned reliable, and most problems like this are caused by networking issues on the client side. However, if you’re automating this then there will inevitably some cases where the root cause is beyond your control.

I don’t think there’s a one-size-fits-all approach for this. If I were in your shoes I’d probably do the following:

  • Retry immediately, with the -v flag.
  • And if that still fails, retry after some delay.

The immediate retry has a couple of advantages:

  • It’ll resolve any truly transient issues.
  • If it fails, the -v will give you significantly more debug logging to investigate the problem.
sometimes we observe exit code 68 in stapling via

How often is “sometimes”?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Stapler returned with EX_NOHOST (68)
 
 
Q