No. 115 eng-blog gh-rel-octoprint 72
2.0.0rc1
⚠️ Important note on release candidates This is a Release Candidate of OctoPrint. It is not a stable release: severe bugs can occur, and they can be bad enough that they make a manual downgrade to an earlier version necessary - maybe even from the command line. You should be…
3d-printing diy iot
9 min read open original ↗
⚠️ Important note on release candidates
This is a Release Candidate of OctoPrint. It is not a stable release: severe bugs can occur, and they can be bad enough that they make a manual downgrade to an earlier version necessary - maybe even from the command line.
You should be comfortable with and capable of possibly having to do this before installing an RC.
Note
Should you get stuck due to a plugin that got broken by this RC (due to removing deprecated things), remember that you can always access a recovery page at /recovery/ that allows you to restart in safe mode!
🔁 Feedback on this RC
Please provide general feedback on this RC in this ticket. An "All is working fine" is valuable feedback as well because it tells me people are actually testing this RC and just not finding problems with it.
If you run into any obvious bugs, please follow "How to file a bug report" - I need logs and reproduction steps to fix issues, not just the information that something doesn't work.
Thanks!
Things to take a closer look at
For this RC, these things should get a closer look while testing, if possible:
proper behaviour when using the included web interface as well as any third party clients at your disposal
printing via a serial connection
managing files on your printer's storage via a serial connection
If you have a Klipper/Moonraker based printer available: can you use it through OctoPrint when you install the Moonraker Connector?
If you have a Bambu based printer available: can you use it through OctoPrint when you install the Bambu Connector?
✋ Heads-ups
☝️ OctoPrint 2.0.0 requires Python 3.9+
This release of OctoPrint requires Python 3.9+. Python 3.7 & 3.8, still supported by OctoPrint 1.11.x, are no longer supported. Please also see this FAQ entry on OctoPrint's Python version requirements.
🔐 A new setting is available to configure trusted authentication proxies
So far, if you set accessControl.trustRemoteUser to true in your config.yaml, OctoPrint would trust any incoming X-Remote-User header. That could of course in theory be abused if your OctoPrint instance was reachable directly in addition through your trusted authentication proxy. In OctoPrint 2.0.0, the accessControl.trustedRemoteUser setting has been replaced with a list of trusted authentication proxies. This defaults to empty, but if you had trustedRemoteUser enabled it will get set to your list of configured trusted reverse proxies. OctoPrint will now only accept and evaluate the X-Remote-User header if the request it is seeing came via any of your configured trusted authentication proxies - which must also be among your trusted reverse proxies.
If you are currently using the accessControl.trustedRemoteUser feature in OctoPrint, you will want to check whether your list of trusted reverse proxies is configured correctly & contains your trusted authentication proxy prior to upgrading. And once upgraded, you'll want to limit the list of trusted authentication proxies further to only those of your reverse proxies that actually provide authentication.
🧩 Plugin authors need to check if they are still using any of the now removed deprecated features
OctoPrint has been logging deprecations warnings for some of its APIs, classes and utility methods for years, some of which even for a decade now.
Plenty of plugins have been ignoring these deprecation warnings. With the advent of OctoPrint 2.0.0, most of those long deprecated bits and pieces have however now been removed, and those plugins that have been ignoring deprecations without changes will effectively break.
If you are a plugin author, you NEED to consult this migration guide to check and update your plugin so it continues to work against OctoPrint 2.0.0. You might want to check out this scanner tool by @jacopotediosi that allows you to scan your plugin's source code for any deprecated usages, upcoming issues with 2.0.0 and also packaging related problems.
💥 Breaking changes
This release of OctoPrint requires Python 3.9+. Python 3.7 & 3.8, still supported by OctoPrint 1.11.x, are no longer supported. Please also see this FAQ entry on OctoPrint's Python version requirements.
A ton of long deprecated methods and endpoints have finally been removed in this release. This should mostly affect third party plugins & the odd client. A migration guide is provided containing a full list of the removals and behaviour changes done, and the necessary steps for plugins to stay compatible.
Calling octoprint without a subcommand -- as deprecated for close to a decade now -- is no longer supported. Use octoprint serve to run the server. See octoprint --help for built-in documentation.
✨ Features & improvements
Core
OctoPrint 2.0.0 completely revamps the printer communication layer: Connecting to and communicating with a printer is now done through a connector, and connectors can be added by plugins! What used to be old comm layer has now been migrated into the bundled Serial Connector Plugin that supports connecting to printers through a serial connection. And there are already two alternative connectors in the works to open up OctoPrint to other printer ecosystems: the Moonraker Connector Plugin allows connecting to printers that get shipped with Klipper/Moonraker on board, and the Bambu Connector Plugin supports connecting to the (local!) API of printers from Bambu Lab.
The connection dialog will offer you to select the connector to use, and then allow you to enter (and save!) the necessary connection parameters. OctoPrint then talks to your selected connector to connect to your printer, fetch data from it, send jobs to it and in general control it.
Through connector plugins, everyone can now add support for new (and possibly even proprietary & reverse engineered) printer interfaces and thus take back control from vendors who'd prefer to keep you locked into their own ecosystems.
Together with the changes needed to make connectors possible, printer side storage has been turned into a full blown native storage in OctoPrint's internal file manager, and further storages can also be added through plugins. Together with multi storage support added to the file manager panel and the bundled Upload Manager Plugin, and support for cross storage transfer of files and folders, this makes for new possibilities on how to manage your printables. And the storage support built into the printer connector concept also makes sure all of this works natively with whatever printer connector you use, as long as it has implemented the necessary access methods.
Native thumbnail support was also added. A stand-alone gcode-thumbnail-tool has been developed that is now used internally to perform thumbnail extraction on the local storage. And the printer connector interface defines methods that if implemented also support fetching & displaying the thumbnails from files stored inside the printer's storage. The file manager panel and the bundled Upload Manager Plugin have both been adjusted to display any available thumbnails.
To give printers (and slicers) more control over print time estimation (it's likely they know best how long something will take!), estimations will now also be fetched from the printer connector, if it supports them. In the case of the bundled Serial Connector Plugin, M73 commands contained in the printed GCODE file will now be used to provide print time estimation basically right from your slicer.
As there have been plenty of changes to support the new printer connectors, the first class printer storage, and some other things, OctoPrint now supports API versioning on its HTTP APIs. Clients can specify the API version they require with a custom X-OctoPrint-Api-Version header, specifying the OctoPrint version from which they expect the API behaviour and data model, and OctoPrint will match that accordingly. See also the newly added documentation on API versioning.
#5194: Improve the performance of the quite expensive /api/files// endpoint.
PR#5264: Make OctoPrintClient.setCookie be more robust with regards to input parameters.
PR#5320: Support for creating remote users (created through an authentication proxy) without a password instead of a random generated one.
PR#5321: Add an (optional) configuration setting of trusted authentication proxies, accessControl.trustedAuthProxies. If trusted authentication proxies (address or range, like trusted reverse proxies) are configured, the chain of trusted involved reverse proxies will be checked for any of the authentication proxies. Only if an authentication proxy was involved in the request will the remote user header then be evaluated. This is an additional security measure.
This new setting also replaces the existing accessControl.trustRemoteUser setting. An empty list here (the default) corresponds to the former default value of false for accessControl.trustRemoteUser. If you had accessControl.trustRemoteUser set to true, a default list of trusted authentication proxies will be set that matches your configured trusted reverse proxies, effectively matching the previous behaviour.
See also PR#5334.
PR#5355: Setting a new password for users without a configured password (e.g. remote users created through an authentication proxy) will now be possible through the user settings panel, no longer requiring the manual intervention of an admin.
GCODE Viewer Plugin
#1122: Add M218 tool offset support (via PR#5228)
Virtual Printer Plugin
PR#5137: Implement support for M106, M107 and M123
🐛 Bug fixes
Core
PR#5139: Provide default implementation for PrinterMixin.get_state_id.
PR#5232: Fix settings value preprocessors not getting applied to nested values.
PR#5261: Fix error reporting when entering the wrong current password when attempting to change it via Settings > Access Control (vs User Settings).
PR#5263: Prevent re-authentication prompt when changing your own password (which already requires you to provider your current password).
PR#5271: Fix creation of folders not triggering focus on them.
#5279: Detect changes on the remote user header and invalidate the current session if it changes.
PR#5287: Fix terminal command history not being properly trimmed.
PR#5295: Fix job key used for caching file information in the printer state panel not getting reset on job deselect.
PR#5306: Fix handling of installing a plugin with a mismatching python requirement.
PR#5316: Disallow cyclic sub grouping, leading to crashes. To explain: It was possible before to make a group a subgroup of itself, which would lead to a recursion bug, requiring manual fixes in OctoPrint's config folder. This is no longer possible.
PR#5348: Fix the printer profiles API's behaviour when targetting non-existing printer profile IDs. It now returns 404 Not Found in such a case instead of touching the default printer profile.
PR#5252: Fix logs in sockjs.py being filtered twice.
PR#5256: Fix built-in print time estimator never using the weighted estimate between statistical data and intelligent data, instead always falling back to the dumb linear estimation.
PR#5308: Fix the jog command always being interpreted as relative.
PR#5318: Properly escape the user name in the "Uploaded by" string.
PR#5320: Fix global API key being reset when a new remote user was created through an authentication proxy.
PR#5330: Fix the jsclient function OctoPrintClient.files.upload() not working when the documented userdata parameter was provided.
PR#5335: Fix a variable name shadowing built-ins in octoprint.util.json.JsonEncoding
PR#5351: Make normalization of booleans more consistent across the code base.
PR#5355: Fix the credential check workflow being triggered even for users without a configured password (e.g. remote users created through an authentication proxy).
PR#5114, PR#5160, PR#5166, PR#5167, PR#5238, PR#5241, PR#5286, PR#5315, PR#5328, PR#5332, PR#5333, PR#5336, PR#5346: Various minor bug, code, test, typo, wording & deprecation warning fixes all across the code base.
Achievements Plugin
Remove a logic error in evaluating cancelled vs failed prints & adjusted related achievement wording. See also PR#5256
Announcements Plugin
More sanitizing of incoming feed content to protect against potential XSS attacks through misconfigured feed addresses (see also PR#5338)
Anonymous Usage Plugin
PR#5270: Fix tracking of slicer name on slicing_started tracking event.
Discovery Plugin
#5203: Make sure the mandatory field modelName is always set on uPnP responses
Serial Connector Plugin (former comm layer)
PR#5259: Fix crash on connection when having configured a non existing baudrate option in the baudrate blocklist.
PR#5296: Fix chamber temperature not being provided to GCODE scripts template context.
Virtual Printer Plugin
PR#5268: Fix crash in virtual printer on receiving G28 E.
🎉 Special thanks to all the contributors!
Special thanks to everyone who contributed to this RC, especially to @Ajimaru, @beelsebob, @bradyjoh, @emmanuel-ferdman, @Hillshum, @jacopotediosi, @jneilliii, @kubedzero and @willschlitzer for their PRs!
And an extra shoutout to our 7 first time contributors: @Ajimaru, @beelsebob, @bradyjoh, @emmanuel-ferdman, @Hillshum, @kubedzero and @willschlitzer! 🎉
🔗 More information
Commits