autopkg / apettinen-recipes

5 stars 14 forks source link

Brave reporting: CodeSignatureVerifier: hdiutil imageinfo error hdiutil: imageinfo failed - image not recognised #27

Closed jby closed 3 years ago

jby commented 3 years ago

The last week Brave.munki has been giving me these errors:


Processing local.munki.Brave...
URLDownloader
URLDownloader: Item at URL is unchanged.
URLDownloader: Using existing /Users/jonasb/Library/AutoPkg/Cache/local.munki.Brave/downloads/Brave.dmg
EndOfCheckPhase
CodeSignatureVerifier
CodeSignatureVerifier: hdiutil imageinfo error hdiutil: imageinfo failed - image not recognised
 with image /Users/jonasb/Library/AutoPkg/Cache/local.munki.Brave/downloads/Brave.dmg.
/Users/jonasb/Library/AutoPkg/Cache/local.munki.Brave/downloads/Brave.dmg is not mounted
Failed.
Receipt written to /Users/jonasb/Library/AutoPkg/Cache/local.munki.Brave/receipts/local.munki-receipt-20200922-131717.plist

The following recipes failed:
    local.munki.Brave
        Error in local.munki.Brave: Processor: CodeSignatureVerifier: Error: /Users/jonasb/Library/AutoPkg/Cache/local.munki.Brave/downloads/Brave.dmg is not mounted

Nothing downloaded, packaged or imported.
jby commented 3 years ago

Removed the downloaded file and re-ran autopkg still though image not recognised

jby commented 3 years ago

Ok, after downloading it manually I realized that you're downloading the pkg into a dmg-file for some strange reason, the download URL in brave.download.recipe does point to the dmg-download, but somehow the pkg is downloaded instead...

jby commented 3 years ago

Or maybe it's simply that they've renamed Brave.dmg into Brave-browser.dmg that's causing this problem...

jby commented 3 years ago

Nope, wget https://laptop-updates.brave.com/latest/osx (or curl) still produces a pkg and not a dmg... But - going to https://laptop-updates.brave.com/latest/osx in a browser downloads Brave-browser.dmg which is a dmg...

apettinen commented 3 years ago

Thanks for reporting this so nicely! :) I will take a look and adjust the recipe accordingly!

apettinen commented 3 years ago

Alright, this get's a bit weird: I got a dmg via the autopkg recipe. Will investigate more.

apettinen commented 3 years ago

Seems to be a kind-of Duplicate of #20 but not really. The reason behind this error is that the (Varnish/Fastly) cache Brave is using resolves to either https://brave-browser-downloads.s3.brave.com/latest/Brave-Browser.dmg or https://referrals.brave.com/latest/Brave-Browser.pkg depending on which cache node you hit.

Decided to switch to Sparkle's AppCastXML i.e. SparkleUpdateInfoProvider. This issue is fixed by: https://github.com/autopkg/apettinen-recipes/commit/6a331bd9fcb6d624dda23cc6813c0ce40b884b78