Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MEGA.munki FlatPkgUnpacker recipe fails #142

Open
oliverweinm opened this issue Mar 12, 2021 · 1 comment
Open

MEGA.munki FlatPkgUnpacker recipe fails #142

oliverweinm opened this issue Mar 12, 2021 · 1 comment

Comments

@oliverweinm
Copy link

When running the MEGA.munki recipe it fails when encountering the FlatPkgUnpacker. However, what seems suspicious to me is that the .pkg which is downloaded only has a size of 78 bytes so that's also worth looking into, perhaps a new download link is available?
I will do my own investigation and make a pull request which will link to this issue if I find a solution.

`URLDownloader
{'Input': {'filename': 'MEGAXstandalone-osx-installer.pkg',
'url': 'https://www.megasoftware.net/do_force_download/MEGAX_11.0.4_installer.pkg'}}
URLDownloader: No value supplied for prefetch_filename, setting default value of: False
URLDownloader: No value supplied for CHECK_FILESIZE_ONLY, setting default value of: False
URLDownloader: File size returned by webserver matches that of the cached file: 78 bytes
URLDownloader: WARNING: Matching a download by filesize is a fallback mechanism that does not guarantee that a build is unchanged.
URLDownloader: Using existing /Users/setup/Library/AutoPkg/Cache/com.github.n8felton.munki.MEGA/downloads/MEGAXstandalone-osx-installer.pkg
{'Output': {'pathname': '/Users/setup/Library/AutoPkg/Cache/com.github.n8felton.munki.MEGA/downloads/MEGAXstandalone-osx-installer.pkg'}}
EndOfCheckPhase
{'Input': {}}
{'Output': {}}
FlatPkgUnpacker
{'Input': {'destination_path': '/Users/setup/Library/AutoPkg/Cache/com.github.n8felton.munki.MEGA/expanded',
'flat_pkg_path': '/Users/setup/Library/AutoPkg/Cache/com.github.n8felton.munki.MEGA/downloads/MEGAXstandalone-osx-installer.pkg',
'purge_destination': True}}
Traceback (most recent call last):
File "/Library/AutoPkg/autopkglib/init.py", line 840, in process
self.env = processor.process()
File "/Library/AutoPkg/autopkglib/init.py", line 626, in process
self.main()
File "/Library/AutoPkg/autopkglib/FlatPkgUnpacker.py", line 184, in main
self.unpack_flat_pkg()
File "/Library/AutoPkg/autopkglib/FlatPkgUnpacker.py", line 99, in unpack_flat_pkg
self.pkgutil_expand()
File "/Library/AutoPkg/autopkglib/FlatPkgUnpacker.py", line 155, in pkgutil_expand
f"extraction of {self.env['flat_pkg_path']} with pkgutil failed: "
autopkglib.ProcessorError: extraction of /Users/setup/Library/AutoPkg/Cache/com.github.n8felton.munki.MEGA/downloads/MEGAXstandalone-osx-installer.pkg with pkgutil failed: Could not open package for expansion: /Users/setup/Library/AutoPkg/Cache/com.github.n8felton.munki.MEGA/downloads/MEGAXstandalone-osx-installer.pkg

File "/Library/AutoPkg/autopkglib/init.py", line 840, in process
self.env = processor.process()
extraction of /Users/setup/Library/AutoPkg/Cache/com.github.n8felton.munki.MEGA/downloads/MEGAXstandalone-osx-installer.pkg with pkgutil failed: Could not open package for expansion: /Users/setup/Library/AutoPkg/Cache/com.github.n8felton.munki.MEGA/downloads/MEGAXstandalone-osx-installer.pkg

Failed.
Receipt written to /Users/setup/Library/AutoPkg/Cache/com.github.n8felton.munki.MEGA/receipts/MEGA.munki-receipt-20210312-090639.plist

The following recipes failed:
./MEGA.munki.recipe
Error in com.github.n8felton.munki.MEGA: Processor: FlatPkgUnpacker: Error: extraction of /Users/setup/Library/AutoPkg/Cache/com.github.n8felton.munki.MEGA/downloads/MEGAXstandalone-osx-installer.pkg with pkgutil failed: Could not open package for expansion: /Users/setup/Library/AutoPkg/Cache/com.github.n8felton.munki.MEGA/downloads/MEGAXstandalone-osx-installer.pkg

Nothing downloaded, packaged or imported.
`

@n8felton
Copy link
Member

I see the issue. The MEGAUrlProvider is scraping https://www.megasoftware.net/history to find a version number.

(March 2021) MEGA11 (ALPHA) version 11.0.4 build 11210303 for Windows and Linux (macOS version coming soon). This is an alpha test version and results obtained using this version should not be used for publication.

Currently, 11.0.4 was only released for Windows and Linux, so https://www.megasoftware.net/do_force_download/MEGAX_11.0.4_installer.pkg doesn't exist yet. As such, the 78 bytes bytes it's pulling is just the ... filesystem path to where the file should be 🤦 /var/www/html/megasoftware.net/public_html/releases/MEGAX_11.0.4_installer.pkg

Unless we can find a more reliable location to get a accurate version information for macOS versions available, we may have to see if we can update MEGAUrlProvider to do a pre-check on the existence of an actual file at the location it builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants