Octoprint.service: Failed to execute command: Exec format error

What is the problem?

OctoPrint won't start. I had it running fine a couple months ago, haven't turned it on in a while.
I think I recently updated via web interface to 1.7.3 but it was working after upgrade iirc.

But now it seems the executable is messed up at /home/pi/oprint/bin/octoprint
I can't run any commands from it, I just get:

pi@octopi:~/oprint/bin $ ./octoprint serve
./octoprint: line 1: $'\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377': command not found

Systemctl says:

pi@octopi:~/oprint/bin $ sudo systemctl status octoprint
● octoprint.service - The snappy web interface for your 3D printer
   Loaded: loaded (/etc/systemd/system/octoprint.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2022-05-05 10:38:58 EDT; 11min ago
  Process: 751 ExecStart=/home/pi/oprint/bin/octoprint serve --host=${HOST} --port=${PORT} (code=exited, status=203/EXEC)
 Main PID: 751 (code=exited, status=203/EXEC)

May 05 10:38:58 octopi systemd[1]: Started The snappy web interface for your 3D printer.
May 05 10:38:58 octopi systemd[751]: octoprint.service: Failed to execute command: Exec format error
May 05 10:38:58 octopi systemd[751]: octoprint.service: Failed at step EXEC spawning /home/pi/oprint/bin/octoprint: Exec format error
May 05 10:38:58 octopi systemd[1]: octoprint.service: Main process exited, code=exited, status=203/EXEC
May 05 10:38:58 octopi systemd[1]: octoprint.service: Failed with result 'exit-code'.

What did you already try to solve it?

Tried running the update command from CLI ~/oprint/bin/pip install -U octoprint didn't help.
Tried restarting with systemctl.
Tried reboot of system.

Have you tried running in safe mode?

yes

Did running in safe mode solve the problem?

no

Systeminfo Bundle

Can't get systeminfo bundle since octoprint isn't able to run any commands.

Additional information about your setup

  • Linux octopi 5.4.79-v7+ #1373 SMP Mon Nov 23 13:22:33 GMT 2020 armv7l GNU/Linux
  • OctoPrint 1.7.3
  • Raspberry Pi 3 Model B Rev 1.2
  • PowerSpec i3 Plus w/ advi3++

octoprint.log (5.1 KB)

It seems to be corrupted would be my guess, I can't think of any reason it would output such a weird string of stuff when called.

You can try a force-reinstall:

~/oprint/bin/pip install --force-reinstall --no-cache-dir octoprint

If that does not work, you may have to reinstall OctoPi.

So when I first ran that, I eventually came to an error:

  Attempting uninstall: psutil
    Found existing installation: psutil 5.8.0
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/home/pi/oprint/lib/python3.7/site-packages/psutil-5.8.0.dist-info/RECORD'

I had to forcibly remove psutil

pi@octopi:~/oprint/lib/python3.7/site-packages $ rm -rf psutil*

Then afterward I could force install, start the service and it worked!

~/oprint/bin/pip install --force-reinstall --no-cache-dir octoprint

sudo systemctl start octoprint

Thanks!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.