Update Script Fails

What is the problem?

I am trying to update OctoPi / OctoPrint because of the Python 2 eol notice. I am currently running OctoPi 0.17 so I am trying to use the update script. When I do, it tells me that it has failed due to a hash mismatch. Can someone tell me how to fix this without having to completely start fresh with a new SD image? I have already reverted back to the curent version for now until I hear back. Thanks.

Additional information about your setup

$ python3 upgrade.py
OctoPrint Upgrade to Py 3 (v2.2.2)

This script will move your existing OctoPrint configuration from Python 2 to Python 3
This script requires an internet connection and it will disrupt any ongoing print jobs.

It will install the latest version of OctoPrint and all plugins.
No configuration or other files will be overwritten

Press [enter] to continue or ctrl-c to quit

Checking system info...
Detected OctoPi version 0.17.0
Found version: Python 2.7.16
Checking OctoPrint version...
OctoPrint version: 1.7.0
Reading installed plugins...
2022-01-23 00:01:34,556 - octolapse.init - INFO - Release mode detected.
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/usr/lib/python2.7/logging/init.py", line 1676, in shutdown
h.close()
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/logging/handlers.py", line 31, in close
self._executor.shutdown(wait=True)
AttributeError: 'OctolapseConsoleHandler' object has no attribute '_executor'
Error in sys.exitfunc:
Traceback (most recent call last):
File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/usr/lib/python2.7/logging/init.py", line 1676, in shutdown
h.close()
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/logging/handlers.py", line 31, in close
self._executor.shutdown(wait=True)
AttributeError: 'OctolapseConsoleHandler' object has no attribute '_executor'

Plugins installed

  • Tempsgraph Plugin
  • Bed Visualizer
  • Automatic Shutdown
  • PrettyGCode
  • M300 Player
  • Simple Emergency Stop
  • DeleteAfterPrint Plugin
  • Themeify
  • FileManager
  • M117 Speech Synthesis
  • EEPROM Marlin Editor Plugin
  • PrintTimeGenius Plugin
  • Octolapse
    If there is an error above related to OctoLapse, please ignore, it makes no difference to operation :slight_smile:
  • UI Customizer
    If you think there is something missing from here, please check the list of plugins in OctoPrint
    Press [enter] to continue or ctrl-c to quit

Updating package list...
Checking package list for python3-dev
Installing python3-dev...
Successfully installed python3-dev
Checking package list for python3-venv
Installing python3-venv...
Successfully installed python3-venv
Creating new Python 3 environment...
Successfully created Python 3 environment at /home/pi/oprint
Installing build dependencies...
Cache entry deserialization failed, entry ignored
Cache entry deserialization failed, entry ignored
Updating pip...
Cache entry deserialization failed, entry ignored
Cache entry deserialization failed, entry ignored

Installing OctoPrint... (This may take a while - Do not cancel!)
Collecting required packages
ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
netaddr<0.9,>=0.8 from https://www.piwheels.org/simple/netaddr/netaddr-0.8.0-py3-none-any.whl#sha256=c3927d35504d7603e38b95ec164e53ce8baa46915681e4ccf2f277553c1fe284 (from OctoPrint):
Expected sha256 c3927d35504d7603e38b95ec164e53ce8baa46915681e4ccf2f277553c1fe284
Got a85a1d49d7df8f3ab464987c735e375bc024d50dcf7ef7fad63953a4cd8e40e5

ERROR: OctoPrint failed to install
To restore your previous install, download the file at:
https://raw.githubusercontent.com/cp2004/Octoprint-Upgrade-To-Py3/master/go_back.py

Cleaning up...
Error installing OctoPrint, cannot proceed

Hello,

the error points to octolapse - did you try disabling/removing the plugin ?

Another aspect is how much time you are willing to invest into hunting the source of that issue you have. Chances are you'll be much faster creating/saving a backup, flash a current image and restore from the backup.

not sure about that

the script also says

If there is an error above related to OctoLapse, please ignore, it makes no difference to operation

That was what I thought so I didn't think/bother to disable/remove it.

This was the part that bothered me:

Collecting required packages
ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
netaddr<0.9,>=0.8 from https://www.piwheels.org/simple/netaddr/netaddr-0.8.0-py3-none-any.whl#sha256=c3927d35504d7603e38b95ec164e53ce8baa46915681e4ccf2f277553c1fe284 (from OctoPrint):
Expected sha256 c3927d35504d7603e38b95ec164e53ce8baa46915681e4ccf2f277553c1fe284
Got a85a1d49d7df8f3ab464987c735e375bc024d50dcf7ef7fad63953a4cd8e40e5

And that didn't seem to be related to OctoLapse, unless I'm mistaken. I can try to remove that, though, since I din't use it anyway...

Yeah I guess netaddr should be the issue

tagging @Charlie_Powell

Anything on this?

Sorry, I missed this one! Not an error I think I've seen before, but I do have an idea. It looks like something might have gone wrong with pip's caching, or something is wrong with the downloading as it can't verify it.

You could try deleting any cached files, by running rm -rf ~/.cache/pip and trying to run the script again?

Not a problem! When I have issues, it's almost always one-off unique situations :slight_smile:

I will try that tonight and see how it goes and report back. Thanks!

oops... can't In the middle of a 24 hour print. D'oh! I'll try it after the print, though... lol

In addition to this, I also went ahead and removed OctoLapse, too, since I wasn't using it anyway. Whichever one did it, it was able to install, so thank you both very much!

2 Likes

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