impredicative / irc-rss-feed-bot

Dockerized IRC bot to post RSS/Atom and scraped HTML/JSON/CSV feeds to channels
https://hub.docker.com/r/ascensive/irc-rss-feed-bot
GNU Affero General Public License v3.0
28 stars 4 forks source link

_multiprocessing.SemLock._rebuild(*state) FileNotFoundError: [Errno 2] No such file or directory #92

Closed tomkap closed 5 months ago

tomkap commented 5 months ago

Here's a example:

Apr 09 08:20:14 bot python3[16914]: 2024-04-09 08:20:14,951 INFO FeedReader-#somechannel-Debian - Security-7ff0137fe6c0:ircrssfeedbot.bot:276:_read_feed: Retrieved in 0.2s the feed Debian - Security of #somechannel with 30 approved entries via 1 URLs read from cache having matching etag.
Apr 09 08:20:15 bot python3[17537]: Traceback (most recent call last):
Apr 09 08:20:15 bot python3[17537]:   File "<string>", line 1, in <module>
Apr 09 08:20:15 bot python3[17537]:   File "/usr/lib/python3.11/multiprocessing/spawn.py", line 120, in spawn_main
Apr 09 08:20:15 bot python3[17537]:     exitcode = _main(fd, parent_sentinel)
Apr 09 08:20:15 bot python3[17537]:                ^^^^^^^^^^^^^^^^^^^^^^^^^^
Apr 09 08:20:15 bot python3[17537]:   File "/usr/lib/python3.11/multiprocessing/spawn.py", line 130, in _main
Apr 09 08:20:15 bot python3[17537]:     self = reduction.pickle.load(from_parent)
Apr 09 08:20:15 bot python3[17537]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Apr 09 08:20:15 bot python3[17537]:   File "/usr/lib/python3.11/multiprocessing/synchronize.py", line 110, in __setstate__
Apr 09 08:20:15 bot python3[17537]:     self._semlock = _multiprocessing.SemLock._rebuild(*state)
Apr 09 08:20:15 bot python3[17537]:                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Apr 09 08:20:15 bot python3[17537]: FileNotFoundError: [Errno 2] No such file or directory

That occurred after a successful feed polling

impredicative commented 5 months ago

Are you running the Docker image?

Do you have free memory on the host and for the container?

tomkap commented 5 months ago

Are you running the Docker image?

It runs inside a lxc container with python3 virtualenv

Do you have free memory on the host and for the container?

# free -m
total        used        free      shared  buff/cache   available
Mem:             954         683          72           0         358         271
Swap:           2399         214        2185
impredicative commented 5 months ago

The logs for the two instances that I'm running don't show any such error.

What is the base OS?

Had this been working fine before? Or did you just start trying the bot?

impredicative commented 5 months ago

@tomkap Also, please accurately test and confirm that the container is writable, but preferably is not persistent across restarts. Only the sqlite database directory should ideally be persistent.

Additionally, GPT says:

  1. Check and adjust the semaphore limits on your system. On Linux, you can view the current limits with cat /proc/sys/kernel/sem and adjust them using sysctl if necessary. Increasing the limits may resolve the issue.
  2. Ensure that the directory used by Python for semaphore files is accessible and writable by the user running the Python process.
  3. Stale semaphore files left over from crashed or improperly terminated processes can cause issues. Cleaning up these stale files can sometimes resolve the problem. However, you should be careful and ensure that these files are not currently used by active processes. Please let me know how these go.
tomkap commented 5 months ago

Freeing some extra memory seems that resolved the issue. The bot is running for 2 days without an issue.