Updating from 1.3.10 to 1.3.11 through web interface broke octoprint

pi@octopi:~ $ sudo service octoprint stop
pi@octopi:~ $ ~/oprint/bin/octoprint serve
Traceback (most recent call last):
  File "/home/pi/oprint/bin/octoprint", line 9, in <module>
    load_entry_point('OctoPrint==1.3.11', 'console_scripts', 'octoprint')()
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/__init__.py", line 605, in main
    from octoprint.util.fixes import patch_sarge_async_on_py2
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/__init__.py", line 34, in <module>
    from past.builtins import basestring, unicode
  File "/home/pi/oprint/local/lib/python2.7/site-packages/past/builtins/__init__.py", line 54, in <module>
    from past.builtins.misc import (apply, chr, cmp, execfile, intern, oct,
ValueError: bad marshal data (unknown type code)

same problem here!!!

@Dani_Diaz That looks like something on your file system got corrupted, possibly due to just yanking power instead of doing a proper shutdown first, or due to an SD card getting too old for service.

@Martin_Polack

1 Like

log files attached

for me the manual running show nothing:

------------------------------------------------------------------------------
OctoPrint version : 1.3.11
OctoPi version    : 0.15.1
------------------------------------------------------------------------------

pi@octopi:~ $ sudo su
[sudo] password for pi:
root@octopi:/home/pi# mc

root@octopi:/home/pi/oprint/bin# ./octoprint serve
root@octopi:/home/pi/oprint/bin# ^

octoprint.log (408 KB)

plugin_softwareupdate_console.log (68 KB)

@Akos_Zambori You should not be running that as root. Where did I say to become root? NEVER run OctoPrint as root! Now drop the sudo, do that again please and share the output. And if you've been doing stuff as root that you shouldn't have been doing as root before you might have to fix your permissions.

2 Likes

thanks but nothing changes, even the log files untouched after trying this:

------------------------------------------------------------------------------
OctoPrint version : 1.3.11
OctoPi version    : 0.15.1
------------------------------------------------------------------------------

pi@octopi:~ $ mc

pi@octopi:~/oprint/bin $ ./octoprint serve
pi@octopi:~/oprint/bin $ service octoprint status
Γ’ octoprint.service - LSB: OctoPrint daemon
   Loaded: loaded (/etc/init.d/octoprint; generated; vendor preset: enabled)
   Active: inactive (dead) since Wed 2019-05-15 08:23:35 UTC; 27min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 4482 ExecStop=/etc/init.d/octoprint stop (code=exited, status=0/SUCCESS)
  Process: 4422 ExecStart=/etc/init.d/octoprint start (code=exited, status=0/SUCCESS)

May 15 08:21:26 octopi systemd[1]: Starting LSB: OctoPrint daemon...
May 15 08:21:26 octopi systemd[1]: Started LSB: OctoPrint daemon.
May 15 08:23:35 octopi systemd[1]: Stopping LSB: OctoPrint daemon...
May 15 08:23:35 octopi systemd[1]: Stopped LSB: OctoPrint daemon.
pi@octopi:~/oprint/bin $ service octoprint stop
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to stop 'octoprint.service'.
Authenticating as: root
Password:
==== AUTHENTICATION COMPLETE ===
pi@octopi:~/oprint/bin $ service octoprint status
Γ’ octoprint.service - LSB: OctoPrint daemon
   Loaded: loaded (/etc/init.d/octoprint; generated; vendor preset: enabled)
   Active: inactive (dead) since Wed 2019-05-15 08:23:35 UTC; 28min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 4482 ExecStop=/etc/init.d/octoprint stop (code=exited, status=0/SUCCESS)
  Process: 4422 ExecStart=/etc/init.d/octoprint start (code=exited, status=0/SUCCESS)

May 15 08:21:26 octopi systemd[1]: Starting LSB: OctoPrint daemon...
May 15 08:21:26 octopi systemd[1]: Started LSB: OctoPrint daemon.
May 15 08:23:35 octopi systemd[1]: Stopping LSB: OctoPrint daemon...
May 15 08:23:35 octopi systemd[1]: Stopped LSB: OctoPrint daemon.
pi@octopi:~/oprint/bin $ ./octoprint serve
pi@octopi:~/oprint/bin $ service octoprint status
Γ’ octoprint.service - LSB: OctoPrint daemon
   Loaded: loaded (/etc/init.d/octoprint; generated; vendor preset: enabled)
   Active: inactive (dead) since Wed 2019-05-15 08:23:35 UTC; 28min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 4482 ExecStop=/etc/init.d/octoprint stop (code=exited, status=0/SUCCESS)
  Process: 4422 ExecStart=/etc/init.d/octoprint start (code=exited, status=0/SUCCESS)

May 15 08:21:26 octopi systemd[1]: Starting LSB: OctoPrint daemon...
May 15 08:21:26 octopi systemd[1]: Started LSB: OctoPrint daemon.
May 15 08:23:35 octopi systemd[1]: Stopping LSB: OctoPrint daemon...
May 15 08:23:35 octopi systemd[1]: Stopped LSB: OctoPrint daemon.
pi@octopi:~/oprint/bin $
pi@octopi:~/.octoprint/logs $ OA
bash: OA: command not found

pi@octopi:~ $

but while tried to install from source like you wrote on the download page, at first I got an error about urllib3 version.
I checked the installed version I got this:

pi@octopi:~ $ sudo su
[sudo] password for pi:
root@octopi:/home/pi# pip search urllib3
urllib3-mock (0.3.3)         - A utility library for mocking out the `urllib3` Python library.
urllib3 (1.25.2)             - HTTP library with thread-safe connection pooling, file post, and more.
  INSTALLED: 1.19.1
  LATEST:    1.25.2
opbeat_python_urllib3 (1.1)  - An urllib3 transport for Opbeat
filter-certwarning (1.0)     - Decorators for filtering InsecureRequestWarnings in requests and urllib3 apps
httplib2shim (0.0.3)         - A wrapper over urllib3 that matches httplib2's interface
srv-hijacker (0.0.5)         - Patch urllib3 to query a certain DNS server for SRV records
apiclient (1.0.4)            - Framework for making good API client libraries using urllib3.
root@octopi:/home/pi#

Do the following please (and don't use sudo or su anywhere where it doesn't say so)

sudo service octoprint stop
source ~/oprint/bin/activate
pip install --force-reinstall https://get.octoprint.org/latest
octoprint serve --safe

If that doesn't produce any output then something about the underlying OS is seriously shot to bits and I have no idea what.

edit Also please for the love of all that is holy stop this sudo su nonsense in front of every command you run to test something. You really don't need root rights for most tasks you ever need to do on your during debugging...

ok:

------------------------------------------------------------------------------
OctoPrint version : 1.3.11
OctoPi version    : 0.15.1
------------------------------------------------------------------------------

pi@octopi:~ $ sudo service octoprint stop
pi@octopi:~ $ service octoprint status
● octoprint.service - LSB: OctoPrint daemon
   Loaded: loaded (/etc/init.d/octoprint; generated; vendor preset: enabled)
   Active: inactive (dead) since Wed 2019-05-15 08:23:35 UTC; 46min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 4482 ExecStop=/etc/init.d/octoprint stop (code=exited, status=0/SUCCESS)
  Process: 4422 ExecStart=/etc/init.d/octoprint start (code=exited, status=0/SUCCESS)

May 15 08:21:26 octopi systemd[1]: Starting LSB: OctoPrint daemon...
May 15 08:21:26 octopi systemd[1]: Started LSB: OctoPrint daemon.
May 15 08:23:35 octopi systemd[1]: Stopping LSB: OctoPrint daemon...
May 15 08:23:35 octopi systemd[1]: Stopped LSB: OctoPrint daemon.
pi@octopi:~ $ 

`(oprint) pi@octopi:~ $ pip install --force-reinstall https://get.octoprint.org/latest
Collecting https://get.octoprint.org/latest
  Downloading https://get.octoprint.org/latest (5.4MB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5.4MB 47kB/s 
  Requirement already satisfied (use --upgrade to upgrade): OctoPrint==1.3.11 from https://get.octoprint.org/latest in ./oprint/lib/python2.7/site-packages
Requirement already satisfied: flask<0.11,>=0.10.1 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: Jinja2<2.9,>=2.8.1 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: tornado==4.5.3 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: Flask-Login<0.3,>=0.2.11 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: regex!=2018.11.6 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: Flask-Principal<0.5,>=0.4 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: Flask-Babel<0.13,>=0.12 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: Flask-Assets<0.13,>=0.12 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: werkzeug<0.16,>=0.15.1 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: cachelib<0.2,>=0.1 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: PyYAML<6,>=5.1 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: markdown<3.1,>=3.0 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: pyserial<3.5,>=3.4 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: netaddr<0.8,>=0.7.19 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: watchdog<0.10,>=0.9.0 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: sarge==0.1.5post0 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: netifaces<0.11,>=0.10.9 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: pylru<1.3,>=1.2 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: rsa<5,>=4.0 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: pkginfo<1.6,>=1.5.0.1 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: requests<3,>=2.21.0 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: semantic_version<2.7,>=2.6 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: psutil<5.7,>=5.6.1 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: Click<8,>=7 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: awesome-slugify<1.7,>=1.6.5 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: feedparser<5.3,>=5.2.1 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: chainmap<1.1,>=1.0.3 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: future<0.18,>=0.17.1 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: scandir<1.11,>=1.10 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: websocket-client<0.57,>=0.56 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: wrapt<1.12,>=1.11.1 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: futures<3.3,>=3.2 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: emoji<0.6,>=0.5.1 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: monotonic<1.6,>=1.5 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: frozendict<1.3,>=1.2 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: sentry-sdk==0.7.7 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: typing<4,>=3.6.6 in ./oprint/lib/python2.7/site-packages (from OctoPrint==1.3.11)
Requirement already satisfied: itsdangerous>=0.21 in ./oprint/lib/python2.7/site-packages (from flask<0.11,>=0.10.1->OctoPrint==1.3.11)
Requirement already satisfied: MarkupSafe in ./oprint/lib/python2.7/site-packages (from Jinja2<2.9,>=2.8.1->OctoPrint==1.3.11)
Requirement already satisfied: singledispatch in ./oprint/lib/python2.7/site-packages (from tornado==4.5.3->OctoPrint==1.3.11)
Requirement already satisfied: certifi in ./oprint/lib/python2.7/site-packages (from tornado==4.5.3->OctoPrint==1.3.11)
Requirement already satisfied: backports-abc>=0.4 in ./oprint/lib/python2.7/site-packages (from tornado==4.5.3->OctoPrint==1.3.11)
Requirement already satisfied: blinker in ./oprint/lib/python2.7/site-packages (from Flask-Principal<0.5,>=0.4->OctoPrint==1.3.11)
Requirement already satisfied: Babel>=2.3 in ./oprint/lib/python2.7/site-packages (from Flask-Babel<0.13,>=0.12->OctoPrint==1.3.11)
Requirement already satisfied: webassets>=0.11.1 in ./oprint/lib/python2.7/site-packages (from Flask-Assets<0.13,>=0.12->OctoPrint==1.3.11)
Requirement already satisfied: argh>=0.24.1 in ./oprint/lib/python2.7/site-packages (from watchdog<0.10,>=0.9.0->OctoPrint==1.3.11)
Requirement already satisfied: pathtools>=0.1.1 in ./oprint/lib/python2.7/site-packages (from watchdog<0.10,>=0.9.0->OctoPrint==1.3.11)
Requirement already satisfied: pyasn1>=0.1.3 in ./oprint/lib/python2.7/site-packages (from rsa<5,>=4.0->OctoPrint==1.3.11)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in ./oprint/lib/python2.7/site-packages (from requests<3,>=2.21.0->OctoPrint==1.3.11)
Requirement already satisfied: idna<2.9,>=2.5 in ./oprint/lib/python2.7/site-packages (from requests<3,>=2.21.0->OctoPrint==1.3.11)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in ./oprint/lib/python2.7/site-packages (from requests<3,>=2.21.0->OctoPrint==1.3.11)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in ./oprint/lib/python2.7/site-packages (from requests<3,>=2.21.0->OctoPrint==1.3.11)
Requirement already satisfied: Unidecode<0.05,>=0.04.14 in ./oprint/lib/python2.7/site-packages (from awesome-slugify<1.7,>=1.6.5->OctoPrint==1.3.11)
Requirement already satisfied: six in ./oprint/lib/python2.7/site-packages (from websocket-client<0.57,>=0.56->OctoPrint==1.3.11)
Requirement already satisfied: pytz>=0a in ./oprint/lib/python2.7/site-packages (from Babel>=2.3->Flask-Babel<0.13,>=0.12->OctoPrint==1.3.11)
You are using pip version 9.0.3, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(oprint) pi@octopi:~ $ 
`
(oprint) pi@octopi:~ $ octoprint serve --safe
(oprint) pi@octopi:~ $ service octoprint status
● octoprint.service - LSB: OctoPrint daemon
   Loaded: loaded (/etc/init.d/octoprint; generated; vendor preset: enabled)
   Active: inactive (dead) since Wed 2019-05-15 08:23:35 UTC; 52min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 4482 ExecStop=/etc/init.d/octoprint stop (code=exited, status=0/SUCCESS)
  Process: 4422 ExecStart=/etc/init.d/octoprint start (code=exited, status=0/SUCCESS)

May 15 08:21:26 octopi systemd[1]: Starting LSB: OctoPrint daemon...
May 15 08:21:26 octopi systemd[1]: Started LSB: OctoPrint daemon.
May 15 08:23:35 octopi systemd[1]: Stopping LSB: OctoPrint daemon...
May 15 08:23:35 octopi systemd[1]: Stopped LSB: OctoPrint daemon.
(oprint) pi@octopi:~ $ 

unfortunately, I am not lucky :wink: Thanks for the help, will be installed from image :wink:

EDITED:
Hi, it is solved for me.
--all octoprint folder removed
--urllib upgraded from 1.19.1 to 1.25.2

pip install urllib3 && pip3 install urllib3 

--reinstall as it is written on the download page:

cd ~
sudo apt update
sudo apt install python-pip python-dev python-setuptools python-virtualenv git libyaml-dev build-essential
mkdir OctoPrint && cd OctoPrint
virtualenv venv
source venv/bin/activate
pip install pip --upgrade
pip install https://get.octoprint.org/latest

--and after the backup has uploaded the service shows exited status again
:wink: :wink:
I think I am going to skip the backup restore process and will work fine again

Thanks Gina, I think you're right, reinstall will be the solution :sleepy:

same problem here but the update failed and now octoprint will not start

------------------------------------------------------------------------------
OctoPrint version : 1.3.10
OctoPi version    : 0.15.1
------------------------------------------------------------------------------

pi@octopi:~ $ ps -ef | grep -i octoprint | grep -i python
pi@octopi:~ $
pi@octopi:~ $ sudo service octoprint restart
pi@octopi:~ $ ps -ef | grep -i octoprint | grep -i python
pi@octopi:~ $ ps -ef | grep -i octoprint | grep -i python
pi@octopi:~ $
pi@octopi:~ $ sudo service octoprint stop
pi@octopi:~ $ ~/oprint/bin/octoprint serve
Traceback (most recent call last):
  File "/home/pi/oprint/bin/octoprint", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/home/pi/oprint/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3019, in <module>
    @_call_aside
  File "/home/pi/oprint/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3003, in _call_aside
    f(*args, **kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3032, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/home/pi/oprint/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 657, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 670, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/home/pi/oprint/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 849, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'watchdog<0.9,>=0.8.3' distribution was not found and is required by OctoPrint
pi@octopi:~ $

power was not removed, i simply tried the update from within octoprint

plugin_softwareupdate_console.log (65.8 KB)
octoprint.log (18.4 KB)

@boelle

Looks like it fell on its face while trying to upgrade a third party dependency (which I cannot reproduce on a stock OctoPi 0.15.1 myself) and then stuff was left in an inconsistent state due to that.

Try if

succeeds now. If it again fails with some build error in netifaces we'll have to dig deeper, maybe some corrupt package is causing trouble.

will do... and just let me know any other file(and their location) that might be interesting

What certainly strikes me as odd is that:

2019-05-15 10:43:36,083 > /usr/include/arm-linux-gnueabihf/bits/sigset.h:21:1: error: invalid suffix "ypudef" on integer constant
2019-05-15 10:43:36,084 > 4ypudef int __sig_atomib_t;
2019-05-15 10:43:36,084 > ^~~~~~~

Looks like garbage in the sigset.h file causing the compilation error. Here the lines reads like this:

typedef int __sig_atomic_t;

Ever removed power in the past, ran into undervoltage issues or might the SD card or its filesystem become a bit old?

nope.... power is hardwired in from 5VSB line on an ATX psu

pi works fine.... i still have access to it and i have 2 samba shares that i can access

also i did a reboot just before i tried the update and octoprint came up fine

the pip install --force-reinstall https://get.octoprint.org/latest gave a lot of output... how do i capture that to a file so its more easy to attach?

(oprint) pi@octopi:~ $ pip install --force-reinstall https://get.octoprint.org/latest > ~/.octoprint/logs/octoprint_install_manual.log
  Failed building wheel for netifaces
  Failed building wheel for psutil
Command "/home/pi/oprint/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1WFcOS/netifaces/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-DK8C0Y-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/oprint/include/site/python2.7/netifaces" failed with error code 1 in /tmp/pip-build-1WFcOS/netifaces/
You are using pip version 9.0.3, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(oprint) pi@octopi:~ $

octoprint_install_manual.log (47.1 KB)

Apparently it doesn't work as fine as you think it does, otherwise a somewhat important header file wouldn't say 4ypudef where it should say typedef. Or at least that's what your update log claims to be the case here. You can check /usr/include/arm-linux-gnueabihf/bits/sigset.h yourself, issue should be visible on line 21.

And a 5VSB line on an ATX psu doesn't automatically mean "it never lost power without prior shutdown before" either.

So, based on your recent log:

    /usr/include/arm-linux-gnueabihf/bits/sigset.h:22:1: error: invalid suffix "ypudef" on integer constant
     4ypudef int"__sig_atomib_t;
     ^~~~~~~

your header files are corrupt. There's even an " now that doesn't belong. That's not an OctoPrint issue, that's an issue with something on your file system being corrupted or slowly dying for whatever reason. One possible reason is a past powerloss, another is the SD card dying, and there are a multitude of others.

I suggest you make a manual backup, get yourself a new SD card and reimage. If random header files contain bits and bytes they shouldn't, god knows what else is corrupt on that card.