homebysix / recipe-robot

A kick ass tool for creating AutoPkg recipes.
Apache License 2.0
300 stars 28 forks source link

Recipe Robot 2.3.1 gives "[ERROR] Sorry, I can't tell what format this app downloads in" for a .pkg file dragged/dropped onto it #205

Open fseesink opened 3 weeks ago

fseesink commented 3 weeks ago

Describe the bug

While trying to generate a recipe for NetBird using either

Recipe Robot errors out. With OPTION 1, the error is due to

[WARNING] Could not detect GitHub developer.

This is not entirely surprising, as I see it's pulling down the wrong file (a .zip). But if you first download the .pkg file and drag/drop that directly onto Recipe Robot, it gets further but then errors with

[ERROR] Sorry, I can't tell what format this app downloads in. It doesn't seem to be a dmg, zip, or pkg.NoneType: None

This occurs, as said, even when it is specifically a .pkg that is dropped on Recipe Robot! And even though that same file looks perfectly normal when viewed in Suspicious Package.

It is a pretty vanilla package. Inside is a simple app. I know Recipe Robot likely won't succeed anyway further along, since it can't find where it would get updates from (since no Sparkle feed, etc.). But it's the fact it is failing to understand the format when the file is exactly of one of the formats that it says it supports in the error message.

To Reproduce

Steps to reproduce the behavior:

For OPTION 1

  1. Run Recipe Robot
  2. Copy/paste this URL in: https://github.com/netbirdio/netbird
  3. Click [Do It!]

For OPTION 2

  1. Using your browser, visit https://github.com/netbirdio/netbird/releases
  2. Click on the latest version
  3. In the list of assets, click the link for netbird_<version>_darwin.pkg to download this package
  4. Drag/drop this downloaded netbird_<version>_darwin.pkg onto Recipe Robot
  5. Click [Do It!]

Expected behavior

If OPTION 1, I expected Recipe Robot to generate the usual recipes as it does for other GitHub repos. If OPTION 2, obviously something didn't go right with OPTION 1, and I'm simply looking for more info/further steps since I am handing it a .pkg file!

Screenshots

For OPTION 1:

Screenshot 2024-10-29 at 3 22 10 PM Screenshot 2024-10-29 at 3 22 28 PM

For OPTION 2: (after dragging/dropping the .pkg file)

Screenshot 2024-10-29 at 3 23 32 PM

Desktop (please complete the following information):

Additional context

I also tried doing this from Terminal, where I added the --debug flag. This is the output:

$ recipe-robot --debug netbird_0.30.3_darwin.pkg

                      -----------------------------------
                     |  Welcome to Recipe Robot v2.3.1.  |
                      -----------------------------------
                                \   _[]_
                                 \  [oo]
                                   d-||-b
                                     ||
                                   _/  \_

Processing: netbird_0.30.3_darwin.pkg
Input path looks like an installer.
    Download URL found in file metadata: https://objects.githubusercontent.com/github-production-release-asset-2e65be/357897199/e6143be3-839f-4548-bf7b-bb0ba0de6621?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241024%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241024T215341Z&X-Amz-Expires=300&X-Amz-Signature=5638b92d05d1938af9b9a26bd834001fbfcf9f9d3fd9e536be328cfea5c1a96d&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dnetbird_0.30.3_darwin.pkg&response-content-type=application%2Foctet-stream
Checking whether package is signed...
    [DEBUG] Shell command: /usr/sbin/pkgutil --check-signature "netbird_0.30.3_darwin.pkg"
    Package is signed
Getting developer from pkg signature...
    Developer is: Wiretrustee UG
Getting package signature authority names...
    3 authority names recorded
Expanding package to look for clues...
    [DEBUG] Shell command: /usr/sbin/pkgutil --expand "netbird_0.30.3_darwin.pkg" "/Users/frank/Library/Caches/Recipe Robot/2024-10-29_15-07-03_886615/expanded"
    Package expanded to: /Users/frank/Library/Caches/Recipe Robot/2024-10-29_15-07-03_886615/expanded
    [DEBUG] Shell command: /usr/bin/ditto -x "/Users/frank/Library/Caches/Recipe Robot/2024-10-29_15-07-03_886615/expanded/netbird.pkg/Payload" "/Users/frank/Library/Caches/Recipe Robot/2024-10-29_15-07-03_886615/payload0"
Trying to get bundle identifier from PackageInfo file...
    Bundle identifier (tentative): io.netbird.client
    Added blocking application: NetBird.app
    Using app: NetBird.app
    In container package: netbird.pkg
Validating app...
    This app seems valid
Getting bundle name...
    Bundle name is: netbird-ui
Bundle name differs from the actual app filename.
    Actual app filename: NetBird.app
Getting bundle identifier...
    Bundle identifier is: io.netbird.client
Checking for a Sparkle feed...
    No Sparkle feed
Determining whether app was downloaded from the Mac App Store...
    App did not come from the App Store
Looking for version key...
    Version key is: CFBundleShortVersionString (0.30.3)
Looking for icon...
    Icon is: /Users/frank/Library/Caches/Recipe Robot/2024-10-29_15-07-03_886615/payload0/Applications/NetBird.app/Contents/Resources/Netbird
Getting description...
    [DEBUG] Curl command: ['/usr/bin/curl', '--compressed', '--location', '--silent', '--show-error', '--url', 'https://www.macupdate.com/find/mac/context=netbird-ui']
    Description (from MacUpdate.com): Monitor the user interface of OS X apps.
Checking local search index cache...
    [DEBUG] Shell command: curl -sL "https://api.github.com/repos/autopkg/index/contents/index.json?ref=main" -H "Accept: application/vnd.github.v3+json"
    Local search index cache is up to date.
Searching for existing AutoPkg recipes for netbird-ui...
    No results
[ERROR] Sorry, I can't tell what format this app downloads in. It doesn't seem to be a dmg, zip, or pkg.NoneType: None

                                    _[]_
                                    [xx]
                                   q-||-p
                                     ||
                                   _/  \_

[DEBUG] SUPPORTED FILE FORMATS:
('dmg', 'iso', 'zip', 'tar.gz', 'gzip', 'tar.bz2', 'tbz', 'tgz', 'pkg')

[DEBUG] PREFERENCES FOR THIS SESSION:
{'DSPackagesPath': None,
 'IgnoreExisting': None,
 'Initialized': True,
 'LastRecipeRobotVersion': '2.3.1',
 'RecipeCreateCount': 12,
 'RecipeCreateLocation': '/Users/frank/Library/AutoPkg/Recipe Robot Output',
 'RecipeFormat': None,
 'RecipeIdentifierPrefix': 'com.github.fseesink',
 'RecipeTypes': (
    install,
    munki,
    pkg,
    download
),
 'SUEnableAutomaticChecks': True,
 'SUHasLaunchedBefore': True,
 'SULastCheckTime': 2024-10-29 18:50:51 +0000,
 'SUSendProfileInfo': False,
 'StripDeveloperSuffixes': None}

[DEBUG] FACTS WE HAVE COLLECTED:
{'complete': [], 'errors': ["Sorry, I can't tell what format this app downloads in. It doesn't seem to be a dmg, zip, or pkg.NoneType: None\n"], 'icons': [], 'information': [], 'recipes': [{'type': 'download', 'description': 'Downloads an app in whatever format the developer provides.', 'preferred': True, 'existing': False, 'keys': {'Identifier': '', 'MinimumVersion': '1.0.0', 'Input': {'NAME': ''}, 'Process': [], 'Comment': 'Created with Recipe Robot v2.3.1 (https://github.com/homebysix/recipe-robot)'}}, {'type': 'pkg', 'description': 'Creates a standard pkg installer file.', 'preferred': True, 'existing': False, 'keys': {'Identifier': '', 'MinimumVersion': '1.0.0', 'Input': {'NAME': ''}, 'Process': [], 'Comment': 'Created with Recipe Robot v2.3.1 (https://github.com/homebysix/recipe-robot)'}}, {'type': 'munki', 'description': 'Imports into your Munki repository.', 'preferred': True, 'existing': False, 'keys': {'Identifier': '', 'MinimumVersion': '1.0.0', 'Input': {'NAME': ''}, 'Process': [], 'Comment': 'Created with Recipe Robot v2.3.1 (https://github.com/homebysix/recipe-robot)'}}, {'type': 'jamf', 'description': 'Imports package only into Jamf Pro. Does not create policies or groups.', 'preferred': False, 'existing': False, 'keys': {'Identifier': '', 'MinimumVersion': '1.0.0', 'Input': {'NAME': ''}, 'Process': [], 'Comment': 'Created with Recipe Robot v2.3.1 (https://github.com/homebysix/recipe-robot)'}}, {'type': 'ds', 'description': 'Imports into your DeployStudio Packages folder.', 'preferred': False, 'existing': False, 'keys': {'Identifier': '', 'MinimumVersion': '1.0.0', 'Input': {'NAME': ''}, 'Process': [], 'Comment': 'Created with Recipe Robot v2.3.1 (https://github.com/homebysix/recipe-robot)'}}, {'type': 'filewave', 'description': 'Imports a fileset into your FileWave server.', 'preferred': False, 'existing': False, 'keys': {'Identifier': '', 'MinimumVersion': '1.0.0', 'Input': {'NAME': ''}, 'Process': [], 'Comment': 'Created with Recipe Robot v2.3.1 (https://github.com/homebysix/recipe-robot)'}}, {'type': 'lanrev', 'description': 'Imports into your LANrev server.', 'preferred': False, 'existing': False, 'keys': {'Identifier': '', 'MinimumVersion': '1.0.0', 'Input': {'NAME': ''}, 'Process': [], 'Comment': 'Created with Recipe Robot v2.3.1 (https://github.com/homebysix/recipe-robot)'}}, {'type': 'sccm', 'description': 'Creates a cmmac package for deploying via Microsoft SCCM.', 'preferred': False, 'existing': False, 'keys': {'Identifier': '', 'MinimumVersion': '1.0.0', 'Input': {'NAME': ''}, 'Process': [], 'Comment': 'Created with Recipe Robot v2.3.1 (https://github.com/homebysix/recipe-robot)'}}, {'type': 'bigfix', 'description': 'Builds a .bes deployment file and imports it into your BigFix console', 'preferred': False, 'existing': False, 'keys': {'Identifier': '', 'MinimumVersion': '1.0.0', 'Input': {'NAME': ''}, 'Process': [], 'Comment': 'Created with Recipe Robot v2.3.1 (https://github.com/homebysix/recipe-robot)'}}, {'type': 'install', 'description': 'Installs the app on the computer running AutoPkg.', 'preferred': True, 'existing': False, 'keys': {'Identifier': '', 'MinimumVersion': '1.0.0', 'Input': {'NAME': ''}, 'Process': [], 'Comment': 'Created with Recipe Robot v2.3.1 (https://github.com/homebysix/recipe-robot)'}}], 'reminders': [], 'warnings': [], 'args': Namespace(input_path='netbird_0.30.3_darwin.pkg', app_mode=False, config=False, debug=True, ignore_existing=False, keep_cache=False, skip_icon=False, verbose=False), 'inspections': ['pkg', 'app'], 'blocking_applications': ['NetBird.app', 'NetBird.app'], 'codesign_authorities': ['Developer ID Installer: Wiretrustee UG (haftungsbeschrankt) (TA739QLA7A)', 'Developer ID Certification Authority', 'Apple Root CA'], 'download_url': 'https://objects.githubusercontent.com/github-production-release-asset-2e65be/357897199/e6143be3-839f-4548-bf7b-bb0ba0de6621?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241024%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241024T215341Z&X-Amz-Expires=300&X-Amz-Signature=5638b92d05d1938af9b9a26bd834001fbfcf9f9d3fd9e536be328cfea5c1a96d&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dnetbird_0.30.3_darwin.pkg&response-content-type=application%2Foctet-stream', 'developer': 'Wiretrustee UG', 'codesign_input_filename': 'netbird_0.30.3_darwin.pkg', 'bundle_id': 'io.netbird.client', 'app_relpath_from_payload': 'Applications/NetBird.app', 'pkg_filename': 'netbird.pkg', 'app_path': '/Users/frank/Library/Caches/Recipe Robot/2024-10-29_15-07-03_886615/payload0/Applications/NetBird.app', 'app_name': 'netbird-ui', 'app_file': 'NetBird', 'is_from_app_store': False, 'version_key': 'CFBundleShortVersionString', 'icon_path': '/Users/frank/Library/Caches/Recipe Robot/2024-10-29_15-07-03_886615/payload0/Applications/NetBird.app/Contents/Resources/Netbird', 'description': 'Monitor the user interface of OS X apps.'}
homebysix commented 1 week ago

NetBird's repo provides an unusually large number of release asset download formats, and it's understandable that Recipe Robot is having a hard time choosing which one to use. Providing the pkg file directly was a good thing to try, but in this case the enclosed app doesn't have a Sparkle feed or anything else that would point Recipe Robot back to an alternative way to download. Figuring out which asset to download is the main failure point.

One potential solution to this is to adjust Recipe Robot to take another input parameter for asset_regex, which would be used to determine which GitHub asset to download. This isn't something I'm planning to do, but I'd be open to a PR if somebody else was interested.

fseesink commented 3 days ago

That would be a great feature if implemented. But yeah, kinda figured it was something along those lines. If I ever find myself with sufficient quiet time (unlikely), might look into that.

For now, in the end, I actually took the output generated by RecipeRobot for another program (Moonlight), copied the folder over, renamed everything relevant, then adjusted as needed. And got it working quite nicely. Just needed to wrap my head around what was involved. (I don't live in this space but only tweak/add recipes when needed. At this point I have a Munki installation with ~100 apps, but it started with just one 7-8 years ago I think, and I slowly added apps as I got tired of manually updating them on family/friends' computers.)

So RecipeRobot still helped out. Can't thank you enough for this tool.