Uograde to 1.8.3 and now cant connect

Thanks for the explanation! That makes sense. So is it fair to assume that OctoPrint is developed/tested in an environment with pip version 19.0.1, and using any other versions of pip would be 'at your own risk'? If so I might downgrade my pip to match so I'm less likely to encounter things like this again. Not sure why I updated pip in the first place honestly (probably just assumed newer == better).

./pip -V
pip 22.2.2 from /home/pi/oprint/lib/python3.7/site-packages/pip (python 3.7)

pi@octopi-p1:~/oprint/bin$ ./pip install -U pip
Looking in indexes: Simple index, piwheels - Simple index
Collecting pip
Downloading pip-22.2.2-py3-none-any.whl (2.0 MB)
|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 2.0 MB 1.6 MB/s
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.2.3
Uninstalling pip-20.2.3:
Successfully uninstalled pip-20.2.3
Successfully installed pip-22.2.2
pi@octopi-p1:~/oprint/bin$ ./pip install typing-extensions==4.3.0
Looking in indexes: Simple index, piwheels - Simple index
Collecting typing-extensions==4.3.0
Downloading https://www.piwheels.org/simple/typing-extensions/typing_extensions-4.3.0-py3-none-any.whl (25 kB)
Installing collected packages: typing-extensions
Attempting uninstall: typing-extensions
Found existing installation: typing-extensions 3.7.4.3
Uninstalling typing-extensions-3.7.4.3:
Successfully uninstalled typing-extensions-3.7.4.3
Successfully installed typing-extensions-4.3.0

1 Like

I can't speak for Charlie or Gina, but personally when I'm developing for OctoPrint core or my plugins I tend to have pip updated. We did have a problem with one of the early 20 something versions when they added the color output support IIRC that actually broke stuff pretty bad and took a couple of versions to get resolved.

Just to chime in here, I personally develop against Python 3.7 (to not accidentally use newer language features sigh), but keep pip updated as well to get an early warning of new breakage. The quoted pip version number is a minimum requirement that matches what is found on stock OctoPi 0.16, and probably should be updated soon because 0.16 can't even be updated to Python 3 anymore, at least not easily. But that doesn't mean OctoPrint is only guaranteed to work against that pip version, that means anything before that isn't tested.

During my release testing, I test updating against various OctoPi versions (currently Python 3 converted 0.17, 0.18 stock, up to date 0.18, 1.0.0 rc) and OctoPrint versions (stock on the OctoPi version + latest on relevant release channels), as well as a fresh install from pypi und Windows (fresh venv too, install from sdist and wheel) and Linux/OctoPi (replacement of stock install in situ prior to running wizard, install from pypi).

As mentioned elsewhere (and what a beautiful unintentional pun, @Charlie_Powell), OctoPrint's updating boils down to running pip install OctoPrint==<target_version> (though it actually uses an download URL for the release package on GitHub to allow for release channels to function, but that is the same code that ends up on PyPi). So, dependency resolving, updates of third party libs and pulling in new deps is all down to pip. And for some reason, for some of you here that is not properly working for the typing-extensions package, which is a dependency of a dependency of OctoPrint and nothing I even had on my radar let alone saw misbehaving.

I could add a version pin for that to OctoPrint's own dependencies, but frankly I'd like to avoid that as it could cause other issues down the road when whatever requires this dependency sees updates. So I'd rather prefer we figure out here why this is misbehaving (pip bug sounds quite likely actually) and rather solve it without a version pin.

Thanks for the information! Would it make sense to have a 'recommended' version (or versions) of pip for use with OctoPrint? For example you could (automatically?) capture the pip versions installed when you do upgrade testing, and then before a user upgrades OctoPrint there could be a check to see if the currently-installed version of pip is one of those known-good versions. If the user's pip version isn't on the list then you could show a warning and a suggestion to use one of the tested versions before upgrading OctoPrint.

I understand you've got to support a lot of different scenarios already, and I'm certainly not an expert in python so I don't know if this is a good idea. Just wondering if there's anything that could reasonably be done to keep stuff like this from happening again in the future - sounds like there have been 'broken' verisons of pip released before this too, so it may happen again and break people who've updated their pip at some point. It seems that if some testing is already being done that confirms that some pip versions are good, that information could be leveraged when deploying updates in the field.

Using Cura 5.1, linked to OctoPrint I seen the same, similar message; I think waiting a bit cleared it;

But Plugins greyed out; So moving back to previous version of OctoPrint that works without these issues

Where's the bug report? Otherwise this cannot be fixed, I cannot reproduce this.

Temporary Glitch; Seems to be OK with Plugins now:

Cura 5.1 shows Server issue for about 45 seconds then clears; log-on time to sever I think

Hello, what to do?

~/.octoprint/logs/octoprint.log

2022-09-27 17:33:45,974 - octoprint.plugin.core - INFO - Plugin GCode Viewer is disabled.
2022-09-27 17:33:55,166 - octoprint.plugin.core - INFO - Plugin Anonymous Usage Tracking is disabled.
2022-09-27 17:34:01,402 - octoprint.plugin.core - INFO - Found 18 plugin(s) providing 16 mixin implementations, 38 hook handlers
2022-09-27 17:34:03,096 - octoprint.server.heartbeat - INFO - Starting server heartbeat, 900.0s interval
2022-09-27 17:34:03,497 - octoprint.cli.server - ERROR - Uncaught exception
Traceback (most recent call last):
  File "/home/pi/oprint/bin/octoprint", line 8, in <module>
    sys.exit(main())
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/__init__.py", line 936, in main
    octo(args=args, prog_name="octoprint", auto_envvar_prefix="OCTOPRINT")
  File "/home/pi/oprint/lib/python3.7/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/pi/oprint/lib/python3.7/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/pi/oprint/lib/python3.7/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/pi/oprint/lib/python3.7/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/cli/server.py", line 330, in serve_command
    disable_color=no_color,
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/cli/server.py", line 163, in run_server
    octoprint_server.run()
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/server/__init__.py", line 371, in run
    self._setup_app(app)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/server/__init__.py", line 1466, in _setup_app
    from flask_limiter import Limiter
  File "/home/pi/oprint/lib/python3.7/site-packages/flask_limiter/__init__.py", line 4, in <module>
    from .errors import RateLimitExceeded
  File "/home/pi/oprint/lib/python3.7/site-packages/flask_limiter/errors.py", line 7, in <module>
    from .wrappers import Limit
  File "/home/pi/oprint/lib/python3.7/site-packages/flask_limiter/wrappers.py", line 9, in <module>
    from limits import RateLimitItem, parse_many
  File "/home/pi/oprint/lib/python3.7/site-packages/limits/__init__.py", line 5, in <module>
    from . import _version, aio, storage, strategies
  File "/home/pi/oprint/lib/python3.7/site-packages/limits/aio/__init__.py", line 1, in <module>
    from . import storage, strategies
  File "/home/pi/oprint/lib/python3.7/site-packages/limits/aio/storage/__init__.py", line 6, in <module>
    from .base import MovingWindowSupport, Storage
  File "/home/pi/oprint/lib/python3.7/site-packages/limits/aio/storage/base.py", line 5, in <module>
    from limits.storage.registry import StorageRegistry
  File "/home/pi/oprint/lib/python3.7/site-packages/limits/storage/__init__.py", line 12, in <module>
    from .base import MovingWindowSupport, Storage
  File "/home/pi/oprint/lib/python3.7/site-packages/limits/storage/base.py", line 6, in <module>
    from limits.util import LazyDependency
  File "/home/pi/oprint/lib/python3.7/site-packages/limits/util.py", line 12, in <module>
    from packaging.version import Version
ValueError: source code string cannot contain null bytes
2022-09-27 17:47:52,244 - octoprint.startup - INFO - ******************************************************************************
2022-09-27 17:47:52,261 - octoprint.startup - INFO - Starting OctoPrint 1.8.3
2022-09-27 17:47:52,262 - octoprint.startup - INFO - Starting in SAFE MODE. Third party plugins will be disabled!
2022-09-27 17:47:52,263 - octoprint.startup - INFO - Reason for safe mode: problem during last startup
2022-09-27 17:47:52,264 - octoprint.startup - INFO - ******************************************************************************
2022-09-27 17:47:54,849 - octoprint.util.connectivity.connectivity_checker - INFO - Connectivity state is currently: online
2022-09-27 17:47:54,851 - octoprint.util.connectivity.connectivity_checker - INFO - Connecting to 1.1.1.1:53 is working
2022-09-27 17:47:54,852 - octoprint.util.connectivity.connectivity_checker - INFO - Resolving octoprint.org is working
2022-09-27 17:47:54,919 - octoprint.plugin.core - INFO - Loading plugins from /home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins, /home/pi/.octoprint/plugins and $
2022-09-27 17:48:02,136 - octoprint.plugin.core - INFO - Plugin GCode Viewer is disabled.
2022-09-27 17:48:03,580 - octoprint.plugin.core - INFO - Plugin Anonymous Usage Tracking is disabled.
2022-09-27 17:48:05,053 - octoprint.plugin.core - INFO - Found 18 plugin(s) providing 16 mixin implementations, 38 hook handlers
2022-09-27 17:48:05,304 - octoprint.server.heartbeat - INFO - Starting server heartbeat, 900.0s interval
2022-09-27 17:48:05,463 - octoprint.cli.server - ERROR - Uncaught exception
Traceback (most recent call last):
  File "/home/pi/oprint/bin/octoprint", line 8, in <module>
    sys.exit(main())
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/__init__.py", line 936, in main
    octo(args=args, prog_name="octoprint", auto_envvar_prefix="OCTOPRINT")
  File "/home/pi/oprint/lib/python3.7/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/pi/oprint/lib/python3.7/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/pi/oprint/lib/python3.7/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/pi/oprint/lib/python3.7/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)