Error from CacheControl when permissions fail on cache directory
Closed this issue · 5 comments
Heloo, after installing informant via yay
and running informant check
the following output was presented to me:
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/lockfile/linklockfile.py", line 19, in acquire
open(self.unique_name, "wb").close()
FileNotFoundError: [Errno 2] No such file or directory: '/var/cache/informant/a/3/a/4/1/peterbabic-b8ddc740.52293122153530957582761'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/informant", line 33, in <module>
sys.exit(load_entry_point('informant==0.4.1', 'console_scripts', 'informant')())
File "/usr/lib/python3.9/site-packages/informant/informant.py", line 176, in main
run()
File "/usr/lib/python3.9/site-packages/informant/informant.py", line 160, in run
feed = Feed().entries
File "/usr/lib/python3.9/site-packages/informant/feed.py", line 47, in __init__
self.feed = self.fetch() # the complete feed as returned by feedparser
File "/usr/lib/python3.9/site-packages/informant/feed.py", line 69, in fetch
return feedparser.parse(session.get(self.url).content)
File "/usr/lib/python3.9/site-packages/requests/sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3.9/site-packages/cachecontrol/adapter.py", line 53, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/lib/python3.9/site-packages/requests/adapters.py", line 533, in send
return self.build_response(request, resp)
File "/usr/lib/python3.9/site-packages/cachecontrol/adapter.py", line 97, in build_response
self.controller.cache_response(request, response)
File "/usr/lib/python3.9/site-packages/cachecontrol/controller.py", line 316, in cache_response
self.cache.set(cache_url, self.serializer.dumps(request, response))
File "/usr/lib/python3.9/site-packages/cachecontrol/caches/file_cache.py", line 126, in set
with self.lock_class(name) as lock:
File "/usr/lib/python3.9/site-packages/lockfile/__init__.py", line 197, in __enter__
self.acquire()
File "/usr/lib/python3.9/site-packages/lockfile/linklockfile.py", line 21, in acquire
raise LockFailed("failed to create %s" % self.unique_name)
lockfile.LockFailed: failed to create /var/cache/informant/a/3/a/4/1/peterbabic-b8ddc740.52293122153530957582761
Is your user in the informant
group? If not can you add it to your user and see if that fixes the issue?
Also, can you double check the permissions of /var/cache/informant
(ls -ld /var/cache/informant
)? They should be drwxrwsr-x
with group set to informant
.
After adding myself into the informant
group, the tool looks like working as expected (does not throw any errors, can check list and read the news). I could not see any behavior related to hooks during pacman -Syu
- the update was performed the standard way, but there was no unread news, since I have just read them all.
Did I miss the information about adding myself to the informant
group somewhere?
How to check the hook functionality (I presume it should prevent updating packages when there are unread news) ?
If you do pacman -Ql informant
you can get a list of the files installed by the package, that should include /usr/share/libalpm/hooks/00-informant.hook
(which is the pacman hook itself).
When doing a pacman -Syu
there should be a :: Running pre-transaction hooks
section in the output that runs some hooks, among them you should see Checking Arch News with Informant ...
(ideally first). If there is no unread news then the update will proceed as normal, but if there is unread news Informant will stop the pacman transaction and print messages.
The note about adding yourself to the informant
group should have appeared when installing, there should be a line in the output that says NOTE: Add yourself to group "informant" to avoid the need for sudo
. It should probably be mentioned in the Readme and other documentation though, especially that now it throws this error without it.
Ok now the arch news has been released, I have got this output when installing a package:
:: Running pre-transaction hooks...
(1/1) Checking Arch News with Informant ...
:: informant: Stopping upgrade to print news
Moving to Zstandard images by default on mkinitcpio
Fri, 19 Feb 2021 13:37:39 +0000
As linux-lts moved to the 5.10 version, all official kernels of Arch Linux now
support zstd compressed initramfs images, so mkinitcpio is switching to zstd
compressed images by default with version 30, which is currently on [testing].
If, for any reason, you are using a kernel version prior to 5.9, make sure to change
mkinitcpio.conf COMPRESSION to use one of the compressors supported, like gzip,
otherwise you **will not** be able to boot images generated by mkinitcpio.
:: informant: You can re-run your pacman command to complete the upgrade
error: command failed to execute correctly
error: failed to commit transaction (failed to run transaction hooks)
Errors occurred, no packages were upgraded.
error installing repo packages
I can confirm now, that the informant does exactly what advertised (and what I was expecting it to do). As a side note, it does not appear to print any additional output, when there are no unread news, which may or may not be desired (it would be desired by me, but other users may see it differently).