What is the problem?
I turned on my printer for the first time in 3.5 years and my OctoPrint 1.4.0 using an RPi 3 booted just fine. It's (obviously) just incredibly out of date. I tried updating through the update function in OctoPrint, and it was failing. I decided to make a backup, replace the board with a RPi 4 and started with a fresh image from the Raspberry Pi Imager (as suggested) and then tried to restore the 250MB backup I made and it keeps failing with the below errors:
Error while running restore
Traceback (most recent call last):
File "/home/pi/oprint/lib/python3.9/site-packages/octoprint/plugins/backup/__init__.py", line 1224, in _restore_backup
zip.extract(member, temp)
File "/usr/lib/python3.9/zipfile.py", line 1616, in extract
return self._extract_member(member, path, pwd)
File "/usr/lib/python3.9/zipfile.py", line 1688, in _extract_member
shutil.copyfileobj(source, target)
File "/usr/lib/python3.9/shutil.py", line 205, in copyfileobj
buf = fsrc_read(length)
File "/usr/lib/python3.9/zipfile.py", line 922, in read
data = self._read1(n)
File "/usr/lib/python3.9/zipfile.py", line 998, in _read1
data = self._decompressor.decompress(data, n)
zlib.error: Error -3 while decompressing data: invalid stored block lengths
Restore failed! Check the above output and octoprint.log for reasons as to why.
What did you already try to solve it?
I have researched and it looks like someone in another thread suggested upgrading to 1.7 and creating a new backup and starting from there. I found instructions and used the following command:
~/oprint/bin/pip install --force-reinstall OctoPrint==1.7.0 --no-cache-dir
but after a little bit, I get the following error:
Collecting PyYAML<6,>=5.4.1
Downloading https://files.pythonhosted.org/packages/a0/a4/d63f2d7597e1a4b55aa3b4d6c5b029991d3b824b5bd331af8d4ab1ed687d/PyYAML-5.4.1.tar.gz (175kB)
|ββββββββββββββββββββββββββββββββ| 184kB 4.6MB/s
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: /home/pi/oprint/bin/python2 /home/pi/oprint/local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpU8o786
cwd: /tmp/pip-install-SI6vXe/PyYAML
Complete output (46 lines):
running egg_info
creating lib/PyYAML.egg-info
writing lib/PyYAML.egg-info/PKG-INFO
writing top-level names to lib/PyYAML.egg-info/top_level.txt
writing dependency_links to lib/PyYAML.egg-info/dependency_links.txt
writing manifest file 'lib/PyYAML.egg-info/SOURCES.txt'
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 257, in <module>
main()
File "/home/pi/oprint/local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 240, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/pi/oprint/local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 91, in get_requires_for_build_wheel
return hook(config_settings)
File "/home/pi/oprint/local/lib/python2.7/site-packages/setuptools/build_meta.py", line 146, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/home/pi/oprint/local/lib/python2.7/site-packages/setuptools/build_meta.py", line 127, in _get_build_requires
self.run_setup()
File "/home/pi/oprint/local/lib/python2.7/site-packages/setuptools/build_meta.py", line 142, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 295, in <module>
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*',
File "/home/pi/oprint/local/lib/python2.7/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/pi/oprint/local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 296, in run
self.find_sources()
File "/home/pi/oprint/local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 303, in find_sources
mm.run()
File "/home/pi/oprint/local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 534, in run
self.add_defaults()
File "/home/pi/oprint/local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 570, in add_defaults
sdist.add_defaults(self)
File "/home/pi/oprint/local/lib/python2.7/site-packages/setuptools/command/py36compat.py", line 36, in add_defaults
self._add_defaults_ext()
File "/home/pi/oprint/local/lib/python2.7/site-packages/setuptools/command/py36compat.py", line 120, in _add_defaults_ext
self.filelist.extend(build_ext.get_source_files())
File "setup.py", line 201, in get_source_files
self.cython_sources(ext.sources, ext)
File "/usr/lib/python2.7/distutils/cmd.py", line 105, in __getattr__
raise AttributeError, attr
AttributeError: cython_sources
----------------------------------------
ERROR: Command errored out with exit status 1: /home/pi/oprint/bin/python2 /home/pi/oprint/local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpU8o786 Check the logs for full command output.
WARNING: You are using pip version 19.3.1; however, version 20.3.4 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Have you tried running in safe mode?
No
Did running in safe mode solve the problem?
n/a
Systeminfo Bundle
You can download this in OctoPrint's System Information dialog ... no bundle, no support!)
I'm Sorry but it looks like this started in 1.6.0 and I'm trying to get there.
Additional information about your setup
OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible
Working version:
Raspberry Pi 3B running Buster
Octoprint: 1.4.0
OctoPi: 0.17.0
Trying to install the image from Raspberry Pi Imager (1.9.3) on a Raspberry Pi 4 and then restore the backup from the above