reddit / emacs

Help with startup messages

fouraivi · 2022-04-26 17:05
Hi, I'm getting two messages on startup and I can't figure out where they are coming from. First, I use auto package update and it opens a buffer called package update results that just says every package I use fails to update. A snippet of the buffer: Error installing better-shell Error installing auto-package-update Error installing ansible Error installing all-the-icons-dired It is triggered by these two lines in my settings file: (package-refresh-contents) (auto-package-update-now) I can run package-reinstall successfully for the packages. Some time ago, I did try set it to straight.el and switched back, I think that's when I started seeing this. I triple checked there's no straight.el references. My second issue is I get this in the warning buffer: Error (use-package): Failed to install image: Package ‘image-’ is unavailable I can't find anything for image- in my emacs directory: ~/.emacs.d master* 1m 15s ❯ ag use-package | grep image- ~/.emacs.d master* Any ideas are greatly appreciated, thanks.
folcred · 2022-04-26 23:15
My knowledge of elisp is very limited, but I wonder if you're not having some type of race condition. When Emacs evaluates `package-refresh-contents`, it has to go out on the network, contact the repository, and wait for the results, which can take a few seconds at the least. Right after that line it's told to update packages, but hasn't gotten the updated list yet, so fails. I'm not familiar with auto-package, but you might want to set a timer if possible instead of trying to do it "now". If the problem is a race condition, delaying it should help. The error about "image" might be caused by a package you're using that requires it. Some packages require other packages to work properly or at all, and are installed at the same time as the original package. That's possibly why it's not in your config file, it's required by another package. It's failing for the same reason your auto update is.
L-Szos · 2022-04-27 14:26
If i remember right, package refresh contents blocks until it completes, so a race condition is unlikely. That being said, i havent had a call to package refresh contents in my init file since i was on emacs 26, so perhaps thats changed.
folcred · 2022-04-27 16:33
Yeah, I don't know either, I've always just manually updated. From what the OP describes, it seems like the update isn't finishing, or perhaps not happening at all, before the auto-update is run. Then again it might be something with the auto-update package, I've never used it an know nothing about how it works.
L-Szos · 2022-04-27 17:48
Ive also never used auto update; im unsure what exactly is going wrong for op.
trs_80 · 2022-04-27 21:15
Like others, I also only manually update. Every once in a while, you will get some TLS error, or some repo will not be available for some reason, etc. Maybe something like that happened? Although I would think you should get some error message. Speaking more broadly, I guess that's why I only manually update. Also to make sure it's at a time I can afford to fix any breakage (even though it's usually rare, it happens).