buresdv / Cork

A fast GUI for Homebrew written in SwiftUI
https://corkmac.app
2.33k stars 131 forks source link

Error on launch: Package Cellar prevented loading #381

Closed 0n0mat0p03ia closed 3 months ago

0n0mat0p03ia commented 3 months ago

What were you trying to do?

Launch Cork

What was the problem?

Error modal window displayed, "Package Cellar prevented loading" Screenshot 2024-08-12 at 11 30 15 PM

Error logs

default 23:37:24.297574-0400    Cork    Cached downloads contents: <private>
error   23:37:24.305807-0400    Cork    Could not get proxy host
error   23:37:24.356549-0400    Cork    Couldn't find homebrew/core in local taps
error   23:37:24.356576-0400    Cork    Couldn't find homebrew/cask in local taps
error   23:37:24.376780-0400    Cork    Failed to decode install receipt for package <private> with error <private>
error   23:37:24.379101-0400    Cork    Failed to load contents of install receipt for package <private> with error <private>
error   23:37:24.386383-0400    Cork    Failed to decode install receipt for package <private> with error <private>
error   23:37:24.386569-0400    Cork    Failed to load contents of install receipt for package <private> with error <private>
error   23:37:24.549828-0400    Cork    Failed while accessing folder: Error Domain=Cork.PackageLoadingError Code=1
default 23:37:24.703088-0400    Cork    Will attempt to place package name

App Version

1.4.4

App Acquisition

Bought

Final checklist

0n0mat0p03ia commented 3 months ago

Clicking on homebrew/core or homebrew/cask in the Cork UI generates an error: "Couldn't decipher Homebrew response" Screenshot 2024-08-12 at 11 42 23 PM

buresdv commented 3 months ago

Can you try compiling the current state of the main branch, or trying this new executable? There's some fixes for logging and hopefully they work (it won't solve the problem, but will at least give us better logs) Cork.zip

0n0mat0p03ia commented 3 months ago

Ran the compiled binary, here's the console output (filtering on s:com.davidbures.cork):

error 17:32:46.304975-0400 Cork Could not get proxy host default 17:32:46.306179-0400 Cork Cached downloads contents: error 17:32:46.365994-0400 Cork Couldn't find homebrew/core in local taps error 17:32:46.366033-0400 Cork Couldn't find homebrew/cask in local taps error 17:32:46.390208-0400 Cork Failed to decode install receipt for package Cellar with error The data couldn’t be read because it isn’t in the correct format. error 17:32:46.392894-0400 Cork Failed to load contents of install receipt for package Cellar with error error.package-loading.could-not-load-Cellar-at-file:///usr/local/Cellar-because-Couldn't read installation info: %@ error 17:32:46.400456-0400 Cork Failed to decode install receipt for package Cellar with error The data couldn’t be read because it isn’t in the correct format. error 17:32:46.401231-0400 Cork Failed to load contents of install receipt for package Cellar with error error.package-loading.could-not-load-Cellar-at-file:///usr/local/Cellar-because-Couldn't read installation info: %@ error 17:32:46.594623-0400 Cork Failed while accessing folder: Error Domain=Cork.PackageLoadingError Code=1 default 17:32:46.843456-0400 Cork Will attempt to place package name

buresdv commented 3 months ago

Looking at the output, it's REALLY weird. The logs are saying it's trying to load the container folder for Formulae (Cellar) as a version of a package, but I see no situation when that would happen.

Can you try running this binary to see if you get any new messages? We're looking for The last path component of the requested URL is the package container folder itself - perhaps a misconfigured package folder?. Cork.zip

0n0mat0p03ia commented 3 months ago

Console output running the more recently provided binary:

default 21:40:20.243189-0400 Cork Scheduled event fired at error 21:40:20.288625-0400 Cork Could not get proxy host default 21:40:20.288952-0400 Cork Cached downloads contents: error 21:40:20.350940-0400 Cork Couldn't find homebrew/core in local taps error 21:40:20.350955-0400 Cork Couldn't find homebrew/cask in local taps error 21:40:20.380563-0400 Cork Failed to decode install receipt for package Cellar with error The data couldn’t be read because it isn’t in the correct format. error 21:40:20.381033-0400 Cork Failed to load contents of install receipt for package Cellar with error error.package-loading.could-not-load-Cellar-at-file:///usr/local/Cellar-because-Couldn't read installation info: The data couldn’t be read because it isn’t in the correct format. error 21:40:20.395231-0400 Cork Failed to decode install receipt for package Cellar with error The data couldn’t be read because it isn’t in the correct format. error 21:40:20.395607-0400 Cork Failed to load contents of install receipt for package Cellar with error error.package-loading.could-not-load-Cellar-at-file:///usr/local/Cellar-because-Couldn't read installation info: The data couldn’t be read because it isn’t in the correct format. error 21:40:20.712152-0400 Cork Failed while accessing folder: Error Domain=Cork.PackageLoadingError Code=1 default 21:40:20.876133-0400 Cork Will attempt to place package name default 21:40:30.910006-0400 Cork New updates found default 21:40:30.910305-0400 Cork Will purge temporary update trackers

buresdv commented 3 months ago

Can you please run the command brew --cellar in your terminal?

0n0mat0p03ia commented 3 months ago

/usr/local/Cellar

Homebrew originally installed on an Intel Mac. Replaced Intel Mac w/ M1 and restored via TimeMachine years ago.

buresdv commented 3 months ago

Alright, in that case, can you check if the folder /opt/homebrew/Cellar exists on your system?

0n0mat0p03ia commented 3 months ago

Alright, in that case, can you check if the folder /opt/homebrew/Cellar exists on your system?

It doesn't.

buresdv commented 3 months ago

Then I'm running out of ideas. The last thing I can think of: Look into /usr/local/Cellar. What do you see there?

0n0mat0p03ia commented 3 months ago

I see folders for all my packages in/usr/local/Cellar. Symlinks to them are in /urs/local/bin and /usr/local/opt. Homebrew runs as expected and is up to date. brew doctor doesn't report any major issues.

buresdv commented 3 months ago

I'm sorry, I really have absolutely no idea why this is happening.

The last resort could perhaps be making a backup (section Migrate a Homebrew installation to a new location), uninstalling Homebrew along with all its folders, then reinstalling it again and restoring from the backup.

I'm leaning that this is a Homebrew problem though, caused by the migration from an Intel machine. I don’t know how Homebrew would behave in this situation because it's such a rare situation to be in.

0n0mat0p03ia commented 3 months ago

No worries, thanks for the help. I'll research the backup/delete/restore process. I'm not sure I'll do it or not. For now I can just update Homebrew from the command line as I've done in the past.