All plugins gone

I have already posted in a different thread with the same issue:

But as suggested by another member, I am posting it in a new thread.

I had finished a successful print. Turned off my printer, octoprint stayed on (this is different for me).
Today I wanted to check something with the Tuya plugin as I have not been able to correctly shutdown the printer automatically. To my surprise, the plugin was gone. Later on I discovered that in fact all plugins I installed are gone.
I tried installing from Plugin manager, but it did not work. In the logs I was able to find this:

...
  File "/home/pi/oprint/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2815, in __getattr__
    raise AttributeError(attr)
AttributeError: _ep_map

During handling of the above exception, another exception occurred:

...
...
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbb in position 0: invalid start byte in entry_points.txt file at path: /home/pi/oprint/lib/python3.9/site-packages/OctoPrint_PrintTimeGenius-2.4.0.dist-info/entry_points.txt

I went ahead and checked whats in that file, and it seems to be corrupted:

pi@octopi:~ $ cat /home/pi/oprint/lib/python3.9/site-packages/OctoPrint_PrintTimeGenius-2.4.0.dist-info/entry_points.txt
�Ms��O�ΐ�=:"N��=&��B:��h[��OY�6mӹ��]i1ڐN��dz�L&��0

I now tried to get the System Bundle, but the webUI also seems not to be working and so I cannot do it. There is another error when trying to access the webUI:

2025-03-20 21:03:48,040 - octoprint.server.util.flask.PreemptiveCache - ERROR - Error while writing /home/pi/.octoprint/data/preemptive_cache_config.yaml
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.9/site-packages/octoprint/server/util/flask.py", line 1118, in set_all_data
    with atomic_write(self.cachefile, "wt", max_permissions=0o666) as handle:
  File "/usr/lib/python3.9/contextlib.py", line 117, in __enter__
    return next(self.gen)
  File "/home/pi/oprint/lib/python3.9/site-packages/octoprint/util/__init__.py", line 1001, in atomic_write
    fd = tempfile.NamedTemporaryFile(**kwargs)
  File "/usr/lib/python3.9/tempfile.py", line 680, in NamedTemporaryFile
    (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
  File "/usr/lib/python3.9/tempfile.py", line 390, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
OSError: [Errno 30] Read-only file system: '/home/pi/.octoprint/data/tmp29ezac93'

2025-03-20 21:03:48,866 - octoprint - ERROR - Exception on /api/settings [GET]
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.9/site-packages/flask/app.py", line 2529, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/pi/oprint/lib/python3.9/site-packages/flask/app.py", line 1825, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/pi/oprint/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/pi/oprint/lib/python3.9/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/home/pi/oprint/lib/python3.9/site-packages/octoprint/server/util/flask.py", line 1370, in decorated_function
    response = f(*args, **kwargs)
  File "/home/pi/oprint/lib/python3.9/site-packages/octoprint/server/api/settings.py", line 282, in getSettings
    "uploads": s.getBaseFolder("uploads"),
  File "/home/pi/oprint/lib/python3.9/site-packages/octoprint/settings/__init__.py", line 2027, in getBaseFolder
    _validate_folder(
  File "/home/pi/oprint/lib/python3.9/site-packages/octoprint/settings/__init__.py", line 2336, in _validate_folder
    raise OSError(error)
OSError: Folder at /home/pi/.octoprint/uploads doesn't appear to be writable, please fix its permissions

P.S. After rebooting, I was able to access the webUI again, so here is the System Bundle:
octoprint-systeminfo-20250320215559.zip (20.6 KB)

So, what should I do here? Is a reinstall the only solution? Thanks :slight_smile:

Sounds like a dying SD card and/or power related issues

Make sure the pi isn't backpowring the printer and the PSU is sufficient

I agree the errors definitely appear to be a failing/corrupted SD card.

This is also what it looked like to me.
The strange thing is that a couple months ago, we came back from holidays and I found the device in a similar state. After damaging a couple of SD cards I realised the issues was that the SD card slot turned bad, and was damaging the cards. So I installed the OctoPi on a flash drive, and this is where it is booted from atm.
This was not even 5-6 months ago. What could be the reason for this happening? Is there some process that is constantly writing in the SD card? E.g. some of the loggers? I don't know what other reason there could be...

I have covered the USB power pin with electrical tape from the start. The PSU is the one that came with the Raspberry Pi kit, with 3A output. So I guess that should be fine too.
Only thing left is the failing flash drive...

Did you enable serial logging for by chance?

I dont think I have enabled anything like this. Where would this option be?
After spending some more time today, it seems that I can no longer use the RPi board. I have flashed a new image on a new drive, but it cannot boot from it either. I think I will have to retire it and go for Octo4A, as I have a few smart phones just collecting dust...

It's in Settings > Serial Connection

Meh. Poor pi :confused:

Okay so I managed to revive the Pi. I got the USB drive back to live and somehow the SD card reader worked too. So now it is all fine.
BUT, I want to still find out what made it die.
I am now checking where log files are stored, and the seem to be in ~/.octoprint. When I checked where it is mounted, looks like it is on the SD card:

pi@octopi:~ $ findmnt -n -o SOURCE --target ~/.octoprint
/dev/mmcblk0p2

How can that be? Of course if log files are written to the SD card eventually it will give up. Why are they not written to the RAM and only copied to the SD card for backup every now and then?
I tried looking for a logging.conf file or something of the kind, but I cannot find one. Also, the logging.yaml file suggested here:
https://docs.octoprint.org/en/master/configuration/logging_yaml.html

Does not exist on my device. Has it been moved elsewhere?

On the OctoPrint web page go to Settings, Logging, Logging Levels and change the logging level of any logger to DEBUG and then check for the existence of the file.

Mine is at ~/.octoprint/logging.yaml.

If you remove the setting you made above, I believe the file will still exist but will contain `loggers: {}'.

I cloned the SD card on my RPi4 to a USB flash drive, removed the SD card and booted from the USB drive. This is the output from my system:

pi@rpi4b:~ $ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    1 28.7G  0 disk
├─sda1   8:1    1  256M  0 part /boot
└─sda2   8:2    1 28.4G  0 part /
pi@rpi4b:~ $ findmnt -n -o SOURCE --target ~/.octoprint
/dev/sda2
pi@rpi4b:~ $

Not sure why your's is different.

It doesn't exist by default, you have to create it.

Thanks for the clarification.

On the memory topic again.
I spent some time and made a couple of scirpts and services, which mount the default logs directory to the ram. This way, I expect that the system would be a lot more stable, and I would not need to change SD cards a couple of times per year.
Is there a place where I can share such scripts, so that other people can benefit from those? Should I make a plugin instead?

Best place for that would be the "Guides" category. I have to say though that from a support and debugging point of view, this worries me a bit, as keeping the logs only in RAM means they'll be gone after a reboot. Which is kinda a bad situation when the system rebooted for unknown reasons and you are trying to figure out what happened.

I currently have a timer set to make a backup every week to the SD card. This assumes that the device stays on. I also though that maybe another way of backup would be before shutting down/rebooting. Of course, if the device randomly reboots, then you cannot anticipate when this would happen to make the backup prior to it.