From 1dc0f1fb313d7e77f0252c231ae38227e85750f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Thu, 4 Apr 2019 18:55:24 +0200
Subject: [PATCH 01/27] =?UTF-8?q?=E2=98=94=20Define=20empty=20UI=5FAPI=5FK?=
=?UTF-8?q?EY=20to=20be=20backwards=20compatible?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Some plugins rely on this to be defined, let's give them some more time
to update.
---
src/octoprint/templates/initscript.jinja2 | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/octoprint/templates/initscript.jinja2 b/src/octoprint/templates/initscript.jinja2
index 71ee636b1..9312de02e 100644
--- a/src/octoprint/templates/initscript.jinja2
+++ b/src/octoprint/templates/initscript.jinja2
@@ -25,6 +25,7 @@
// sockjs should define CLOSE_NORMAL for us, but they don't (from ws spec)
var SOCKJS_CLOSE_NORMAL = 1000;
+ var UI_API_KEY = ""; // deprecated, only left for compatibility reasons
var VERSION = "{{ version.number|e }}";
var DISPLAY_VERSION = "{{ version.display|e }}";
var BRANCH = "{{ version.branch|e }}";
From 3574c2ddf9d3a5318bb15232f4f1bb5ea1a4974c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Thu, 4 Apr 2019 19:05:17 +0200
Subject: [PATCH 02/27] =?UTF-8?q?=F0=9F=90=9B=20virtual=20printer:=20Fix?=
=?UTF-8?q?=20yet=20another=20unicode=20issue?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Closes #3105
---
src/octoprint/plugins/virtual_printer/virtual.py | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/octoprint/plugins/virtual_printer/virtual.py b/src/octoprint/plugins/virtual_printer/virtual.py
index 4396fb8d6..9dc809735 100644
--- a/src/octoprint/plugins/virtual_printer/virtual.py
+++ b/src/octoprint/plugins/virtual_printer/virtual.py
@@ -18,7 +18,7 @@ from serial import SerialTimeoutException
from octoprint.settings import settings
from octoprint.plugin import plugin_manager
-from octoprint.util import RepeatedTimer, monotonic_time, to_bytes
+from octoprint.util import RepeatedTimer, monotonic_time, to_bytes, to_unicode
class VirtualPrinter(object):
command_regex = re.compile("^([GMTF])(\d+)")
@@ -300,7 +300,7 @@ class VirtualPrinter(object):
self._dont_answer = False
continue
- data = data.strip()
+ data = to_unicode(data.strip(), errors="replace")
# strip checksum
if "*" in data:
@@ -1367,6 +1367,9 @@ class VirtualPrinter(object):
pass
def write(self, data):
+ data = to_bytes(data, errors="replace")
+ u_data = to_unicode(data, errors="replace")
+
if self._debug_awol:
return len(data)
@@ -1379,13 +1382,13 @@ class VirtualPrinter(object):
return 0
if "M112" in data and self._supportM112:
- self._seriallog.info(u"<<< {}".format(data.strip()))
+ self._seriallog.info(u"<<< {}".format(u_data))
self._kill()
return len(data)
try:
written = self.incoming.put(data, timeout=self._write_timeout, partial=True)
- self._seriallog.info(u"<<< {}".format(data.strip()))
+ self._seriallog.info(u"<<< {}".format(u_data))
return written
except queue.Full:
self._logger.info("Incoming queue is full, raising SerialTimeoutException")
@@ -1420,7 +1423,7 @@ class VirtualPrinter(object):
try:
# fetch a line from the queue, wait no longer than timeout
- line = self.outgoing.get(timeout=timeout)
+ line = to_unicode(self.outgoing.get(timeout=timeout), errors="replace")
self._seriallog.info(u">>> {}".format(line.strip()))
self.outgoing.task_done()
return to_bytes(line, errors="replace")
From 65fe048adebecdefd761ef23c3723b087c4688e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Fri, 5 Apr 2019 10:17:12 +0200
Subject: [PATCH 03/27] =?UTF-8?q?=E2=98=94=20error=20tracking:=20ignore=20?=
=?UTF-8?q?RequestExceptions?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
We don't want to get error events every time someone's net connection
goes down or the webcam is misconfigured.
---
src/octoprint/plugins/errortracking/__init__.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/octoprint/plugins/errortracking/__init__.py b/src/octoprint/plugins/errortracking/__init__.py
index bde73d442..98a800df2 100644
--- a/src/octoprint/plugins/errortracking/__init__.py
+++ b/src/octoprint/plugins/errortracking/__init__.py
@@ -13,6 +13,7 @@ from flask import jsonify
from flask_babel import gettext
from serial import SerialException
+from requests.exceptions import RequestException
SENTRY_URL_SERVER = "https://4273b441bb654c4398de42ba86350963@sentry.io/1373987"
SENTRY_URL_COREUI = "https://f9bcd7185f73430bbe7c09ff69586b0f@sentry.io/1374096"
@@ -25,6 +26,7 @@ SETTINGS_DEFAULTS = dict(enabled=False,
IGNORED_EXCEPTIONS = [
(SerialException, "octoprint.util.comm"),
+ RequestException
]
From 8da5bb2d428c64ffb051cc658a41dcefe9009563 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Fri, 5 Apr 2019 15:19:58 +0200
Subject: [PATCH 04/27] =?UTF-8?q?=F0=9F=90=9B=20Fix=20bug=20in=20port=20de?=
=?UTF-8?q?tection?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Closes #3108
---
src/octoprint/util/comm.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py
index 296f874a7..ac5591494 100644
--- a/src/octoprint/util/comm.py
+++ b/src/octoprint/util/comm.py
@@ -2553,7 +2553,7 @@ class MachineCom(object):
self._log("Trying {}".format(p))
programmer.connect(p)
serial_obj = programmer.leaveISP()
- except:
+ except Exception as e:
self._log("Could not connect to or enter programming mode on {}, might not be a printer or just not allow programming mode".format(p))
self._logger.info("Could not enter programming mode on {}: {}".format(p, e))
From 34c30ed73f447b558017672d05696641ea9bcc7c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Fri, 5 Apr 2019 16:08:15 +0200
Subject: [PATCH 05/27] =?UTF-8?q?=F0=9F=90=9B=20Fix=20wrong=20textual=20re?=
=?UTF-8?q?presentation=20of=20STARTING=20state?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
See comment/log files in #3104
---
src/octoprint/util/comm.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py
index ac5591494..c64f13319 100644
--- a/src/octoprint/util/comm.py
+++ b/src/octoprint/util/comm.py
@@ -687,9 +687,9 @@ class MachineCom(object):
if self.isSdFileSelected():
return "Starting print from SD"
elif self.isStreaming():
- return "Sending file to SD"
+ return "Starting to send file to SD"
else:
- return "Printing"
+ return "Starting"
elif state == self.STATE_PRINTING:
if self.isSdFileSelected():
return "Printing from SD"
From b353c4eee2bd0dbc559dd65a270bea5e2eaf30a3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Fri, 5 Apr 2019 17:47:36 +0200
Subject: [PATCH 06/27] =?UTF-8?q?=E2=9C=A8=20extra=20logging=20parameter?=
=?UTF-8?q?=20to=20add=20plugin=20identifier?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Will allow to identify logged exceptions originating from calling
plugins, but also log plugin identifiers directly in the log message
if so desired.
---
src/octoprint/cli/plugins.py | 3 +-
src/octoprint/environment.py | 3 +-
src/octoprint/events.py | 3 +-
src/octoprint/filemanager/__init__.py | 15 +++--
src/octoprint/plugin/__init__.py | 7 +--
src/octoprint/plugins/forcelogin/__init__.py | 3 +-
.../plugins/pluginmanager/__init__.py | 3 +-
.../plugins/softwareupdate/__init__.py | 4 +-
src/octoprint/printer/standard.py | 10 +++-
src/octoprint/server/__init__.py | 41 ++++++++++----
src/octoprint/server/api/__init__.py | 56 ++++++++++++-------
src/octoprint/server/api/settings.py | 7 ++-
src/octoprint/server/apps/__init__.py | 4 +-
src/octoprint/server/util/__init__.py | 4 +-
src/octoprint/server/util/flask.py | 3 +-
src/octoprint/server/util/sockjs.py | 12 ++--
src/octoprint/server/views.py | 53 +++++++++++-------
src/octoprint/slicing/__init__.py | 3 +-
src/octoprint/timelapse.py | 4 +-
src/octoprint/util/comm.py | 34 +++++++----
20 files changed, 177 insertions(+), 95 deletions(-)
diff --git a/src/octoprint/cli/plugins.py b/src/octoprint/cli/plugins.py
index facfc80cb..c1a7938f9 100644
--- a/src/octoprint/cli/plugins.py
+++ b/src/octoprint/cli/plugins.py
@@ -92,7 +92,8 @@ class OctoPrintPluginCommands(click.MultiCommand):
continue
result[name + self.sep + command.name] = command
except:
- self._logger.exception("Error while retrieving cli commands for plugin {}".format(name))
+ self._logger.exception("Error while retrieving cli commands for plugin {}".format(name),
+ extra=dict(plugin=name))
return result
diff --git a/src/octoprint/environment.py b/src/octoprint/environment.py
index 6b22a22ac..86e673121 100644
--- a/src/octoprint/environment.py
+++ b/src/octoprint/environment.py
@@ -125,7 +125,8 @@ class EnvironmentDetector(object):
result[implementation._identifier] = additional
except:
self._logger.exception("Error while fetching additional "
- "environment data from plugin {}".format(implementation._identifier))
+ "environment data from plugin {}".format(implementation._identifier),
+ extra=dict(plugin=implementation._identifier))
return result
diff --git a/src/octoprint/events.py b/src/octoprint/events.py
index a5fe562ba..74374f7ec 100644
--- a/src/octoprint/events.py
+++ b/src/octoprint/events.py
@@ -186,8 +186,7 @@ class EventManager(object):
octoprint.plugin.call_plugin(octoprint.plugin.types.EventHandlerPlugin,
"on_event",
- args=(event, payload),
- initialized=True)
+ args=(event, payload))
self._logger.info("Event loop shut down")
except:
self._logger.exception("Ooops, the event bus worker loop crashed")
diff --git a/src/octoprint/filemanager/__init__.py b/src/octoprint/filemanager/__init__.py
index 8521e814e..8124c06ce 100644
--- a/src/octoprint/filemanager/__init__.py
+++ b/src/octoprint/filemanager/__init__.py
@@ -78,7 +78,9 @@ def full_extension_tree():
continue
result = octoprint.util.dict_merge(result, plugin_result, leaf_merger=leaf_merger)
except:
- logging.getLogger(__name__).exception("Exception while retrieving additional extension tree entries from SlicerPlugin {name}".format(name=plugin.key))
+ logging.getLogger(__name__).exception("Exception while retrieving additional extension "
+ "tree entries from SlicerPlugin {name}".format(name=plugin._identifier),
+ extra=dict(plugin=plugin._identifier))
extension_tree_hooks = octoprint.plugin.plugin_manager().get_hooks("octoprint.filemanager.extension_tree")
for name, hook in extension_tree_hooks.items():
@@ -88,7 +90,9 @@ def full_extension_tree():
continue
result = octoprint.util.dict_merge(result, hook_result, leaf_merger=leaf_merger)
except:
- logging.getLogger(__name__).exception("Exception while retrieving additional extension tree entries from hook {name}".format(name=name))
+ logging.getLogger(__name__).exception("Exception while retrieving additional extension "
+ "tree entries from hook {name}".format(name=name),
+ extra=dict(plugin=name))
return result
@@ -429,7 +433,8 @@ class FileManager(object):
try:
plugin.on_slicing_progress(slicer, source_location, source_path, dest_location, dest_path, progress)
except:
- self._logger.exception("Exception while sending slicing progress to plugin %s" % plugin._identifier)
+ self._logger.exception("Exception while sending slicing progress to plugin %s" % plugin._identifier,
+ extra=dict(plugin=plugin._identifier))
import threading
thread = threading.Thread(target=call_plugins, args=(slicer, source_location, source_path, dest_location, dest_path, progress_int))
@@ -464,11 +469,11 @@ class FileManager(object):
if printer_profile is None:
printer_profile = self._printer_profile_manager.get_current_or_default()
- for hook in self._preprocessor_hooks.values():
+ for name, hook in self._preprocessor_hooks.items():
try:
hook_file_object = hook(path, file_object, links=links, printer_profile=printer_profile, allow_overwrite=allow_overwrite)
except:
- self._logger.exception("Error when calling preprocessor hook {}, ignoring".format(hook))
+ self._logger.exception("Error when calling preprocessor hook for plugin {}, ignoring".format(name), extra=dict(plugin=name))
continue
if hook_file_object is not None:
diff --git a/src/octoprint/plugin/__init__.py b/src/octoprint/plugin/__init__.py
index fceee2de2..500e1090a 100644
--- a/src/octoprint/plugin/__init__.py
+++ b/src/octoprint/plugin/__init__.py
@@ -196,8 +196,7 @@ def call_plugin(types, method, args=None, kwargs=None, callback=None, error_call
error_callback (function): A callback to invoke after the call of an implementation resulted in an exception.
Will be called with the three arguments ``name``, ``plugin`` and ``exc``. ``name`` will be the plugin
identifier, ``plugin`` the plugin implementation instance itself and ``exc`` the caught exception.
- initialized (boolean): Whether the plugin needs to be initialized (True) or not (False). Initialization status
- is determined be presence of injected ``_identifier`` property.
+ initialized (boolean): Ignored.
"""
if not isinstance(types, (list, tuple)):
@@ -211,7 +210,7 @@ def call_plugin(types, method, args=None, kwargs=None, callback=None, error_call
plugins = plugin_manager().get_implementations(*types, sorting_context=sorting_context)
for plugin in plugins:
- if initialized and not hasattr(plugin, "_identifier"):
+ if not hasattr(plugin, "_identifier"):
continue
if hasattr(plugin, method):
@@ -221,7 +220,7 @@ def call_plugin(types, method, args=None, kwargs=None, callback=None, error_call
if callback:
callback(plugin._identifier, plugin, result)
except Exception as exc:
- logger.exception("Error while calling plugin %s" % plugin._identifier)
+ logger.exception("Error while calling plugin %s" % plugin._identifier, extra=dict(plugin=plugin._identifier))
if error_callback:
error_callback(plugin._identifier, plugin, exc)
diff --git a/src/octoprint/plugins/forcelogin/__init__.py b/src/octoprint/plugins/forcelogin/__init__.py
index a9f510cca..03b0083ac 100644
--- a/src/octoprint/plugins/forcelogin/__init__.py
+++ b/src/octoprint/plugins/forcelogin/__init__.py
@@ -87,7 +87,8 @@ class ForceLoginPlugin(octoprint.plugin.UiPlugin,
if isinstance(assets, (tuple, list)):
additional_assets += assets
except:
- self._logger.exception("Error fetching theming CSS to include from plugin {}".format(name))
+ self._logger.exception("Error fetching theming CSS to include from plugin {}".format(name),
+ extra=dict(plugin=name))
render_kwargs.update(dict(forcelogin_theming=additional_assets))
return make_response(render_template("forcelogin_index.jinja2", **render_kwargs))
diff --git a/src/octoprint/plugins/pluginmanager/__init__.py b/src/octoprint/plugins/pluginmanager/__init__.py
index 8bdedc49a..5caa980b6 100644
--- a/src/octoprint/plugins/pluginmanager/__init__.py
+++ b/src/octoprint/plugins/pluginmanager/__init__.py
@@ -902,7 +902,8 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin,
reconnect_hooks.extend(filter(lambda x: isinstance(x, basestring), result))
except:
self._logger.exception("Error while retrieving additional hooks for which a "
- "reconnect is required from plugin {name}".format(**locals()))
+ "reconnect is required from plugin {name}".format(**locals()),
+ extra=dict(plugin=name))
return reconnect_hooks
diff --git a/src/octoprint/plugins/softwareupdate/__init__.py b/src/octoprint/plugins/softwareupdate/__init__.py
index 289910127..199b8a965 100644
--- a/src/octoprint/plugins/softwareupdate/__init__.py
+++ b/src/octoprint/plugins/softwareupdate/__init__.py
@@ -119,7 +119,9 @@ class SoftwareUpdatePlugin(octoprint.plugin.BlueprintPlugin,
try:
hook_checks = hook()
except:
- self._logger.exception("Error while retrieving update information from plugin {name}".format(**locals()))
+ self._logger.exception("Error while retrieving update information "
+ "from plugin {name}".format(**locals()),
+ extra=dict(plugin=name))
else:
for key, default_config in hook_checks.items():
if key in effective_configs or key == "octoprint":
diff --git a/src/octoprint/printer/standard.py b/src/octoprint/printer/standard.py
index 7d2ebcdf8..5beac173e 100644
--- a/src/octoprint/printer/standard.py
+++ b/src/octoprint/printer/standard.py
@@ -95,7 +95,8 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
self._logger.info("Using print time estimator provided by {}".format(name))
self._estimator_factory = estimator
except:
- self._logger.exception("Error while processing analysis queues from {}".format(name))
+ self._logger.exception("Error while processing analysis queues from {}".format(name),
+ extra=dict(plugin=name))
#hook card upload
self.sd_card_upload_hooks = plugin_manager().get_hooks("octoprint.printer.sdcardupload")
@@ -229,7 +230,8 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
try:
plugin.on_print_progress(storage, filename, progress)
except:
- self._logger.exception("Exception while sending print progress to plugin %s" % plugin._identifier)
+ self._logger.exception("Exception while sending print progress to plugin %s" % plugin._identifier,
+ extra=dict(plugin=plugin._identifier))
thread = threading.Thread(target=call_plugins, args=(storage, filename, progress))
thread.daemon = False
@@ -721,7 +723,9 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
if result is not None:
return result
except:
- self._logger.exception("There was an error running the sd upload hook provided by plugin {}".format(name))
+ self._logger.exception("There was an error running the sd upload "
+ "hook provided by plugin {}".format(name),
+ extra=dict(plugin=name))
else:
# no plugin feels responsible, use the default implementation
diff --git a/src/octoprint/server/__init__.py b/src/octoprint/server/__init__.py
index 6b90ca4af..4899a94d5 100644
--- a/src/octoprint/server/__init__.py
+++ b/src/octoprint/server/__init__.py
@@ -288,7 +288,8 @@ class Server(object):
additional_factories = hook()
analysis_queue_factories.update(**additional_factories)
except:
- self._logger.exception("Error while processing analysis queues from {}".format(name))
+ self._logger.exception("Error while processing analysis queues from {}".format(name),
+ extra=dict(plugin=name))
analysisQueue = octoprint.filemanager.analysis.AnalysisQueue(analysis_queue_factories)
slicingManager = octoprint.slicing.SlicingManager(self._settings.getBaseFolder("slicingProfiles"), printerProfileManager)
@@ -345,7 +346,8 @@ class Server(object):
self._logger.debug("Created user manager instance from factory {}".format(name))
break
except:
- self._logger.exception("Error while creating user manager instance from factory {}".format(name))
+ self._logger.exception("Error while creating user manager instance from factory {}".format(name),
+ extra=dict(plugin=name))
else:
name = self._settings.get(["accessControl", "userManager"])
try:
@@ -368,7 +370,8 @@ class Server(object):
self._logger.debug("Created printer instance from factory {}".format(name))
break
except:
- self._logger.exception("Error while creating printer instance from factory {}".format(name))
+ self._logger.exception("Error while creating printer instance from factory {}".format(name),
+ extra=dict(plugin=name))
else:
printer = Printer(fileManager, analysisQueue, printerProfileManager)
components.update(dict(printer=printer))
@@ -457,7 +460,8 @@ class Server(object):
constant, value = octoprint.events.Events.register_event(event, prefix="plugin_{}_".format(name))
self._logger.debug("Registered event {} of plugin {} as Events.{} = \"{}\"".format(event, name, constant, value))
except:
- self._logger.exception("Error while retrieving custom event list from plugin {}".format(name))
+ self._logger.exception("Error while retrieving custom event list from plugin {}".format(name),
+ extra=dict(plugin=name))
pluginManager.implementation_inject_factories=[octoprint_plugin_inject_factory,
settings_plugin_inject_factory]
@@ -468,7 +472,9 @@ class Server(object):
try:
settings_plugin_config_migration_and_cleanup(implementation._identifier, implementation)
except:
- self._logger.exception("Error while trying to migrate settings for plugin {}, ignoring it".format(implementation._identifier))
+ self._logger.exception("Error while trying to migrate settings for "
+ "plugin {}, ignoring it".format(implementation._identifier),
+ extra=dict(plugin=plugin._identifier))
pluginManager.implementation_post_inits=[settings_plugin_config_migration_and_cleanup]
@@ -540,7 +546,8 @@ class Server(object):
try:
access_validators_from_plugins.append(util.tornado.access_validation_factory(app, hook))
except:
- self._logger.exception("Error while adding tornado access validator from plugin {}".format(plugin))
+ self._logger.exception("Error while adding tornado access validator from plugin {}".format(plugin),
+ extra=dict(plugin=plugin))
admin_validators = [util.tornado.access_validation_factory(app, util.flask.admin_validator),] + access_validators_from_plugins
user_validators = [util.tornado.access_validation_factory(app, util.flask.user_validator),] + access_validators_from_plugins
@@ -606,7 +613,9 @@ class Server(object):
try:
result = hook(list(server_routes))
except:
- self._logger.exception("There was an error while retrieving additional server routes from plugin hook {name}".format(**locals()))
+ self._logger.exception("There was an error while retrieving additional "
+ "server routes from plugin hook {name}".format(**locals()),
+ extra=dict(plugin=name))
else:
if isinstance(result, (list, tuple)):
for entry in result:
@@ -649,7 +658,9 @@ class Server(object):
try:
result = hook(list(max_body_sizes))
except:
- self._logger.exception("There was an error while retrieving additional upload sizes from plugin hook {name}".format(**locals()))
+ self._logger.exception("There was an error while retrieving additional "
+ "upload sizes from plugin hook {name}".format(**locals()),
+ extra=dict(plugin=name))
else:
if isinstance(result, (list, tuple)):
for entry in result:
@@ -1179,7 +1190,9 @@ class Server(object):
blueprint, prefix = self._prepare_blueprint_plugin(plugin)
blueprints[prefix] = blueprint
except:
- self._logger.exception("Error while registering blueprint of plugin {}, ignoring it".format(plugin._identifier))
+ self._logger.exception("Error while registering blueprint of "
+ "plugin {}, ignoring it".format(plugin._identifier),
+ extra=dict(plugin=plugin._identifier))
continue
return blueprints
@@ -1195,7 +1208,9 @@ class Server(object):
blueprint, prefix = self._prepare_asset_plugin(plugin)
blueprints[prefix] = blueprint
except:
- self._logger.exception("Error while registering assets of plugin {}, ignoring it".format(plugin._identifier))
+ self._logger.exception("Error while registering assets of plugin "
+ "{}, ignoring it".format(plugin._identifier),
+ extra=dict(plugin=plugin._identifier))
continue
return blueprints
@@ -1243,7 +1258,8 @@ class Server(object):
for h in result:
blueprint.before_request(h)
except:
- self._logger.exception("Error processing before_request hooks from plugin {}".format(name))
+ self._logger.exception("Error processing before_request hooks from plugin {}".format(name),
+ extra=dict(plugin=name))
for name, hook in after_hooks.items():
try:
@@ -1252,7 +1268,8 @@ class Server(object):
for h in result:
blueprint.after_request(h)
except:
- self._logger.exception("Error processing after_request hooks from plugin {}".format(name))
+ self._logger.exception("Error processing after_request hooks from plugin {}".format(name),
+ extra=dict(plugin=name))
def _setup_assets(self):
global app
diff --git a/src/octoprint/server/api/__init__.py b/src/octoprint/server/api/__init__.py
index e67529d8b..dbcdaa6ef 100644
--- a/src/octoprint/server/api/__init__.py
+++ b/src/octoprint/server/api/__init__.py
@@ -60,15 +60,20 @@ def pluginData(name):
if len(api_plugins) > 1:
return make_response("More than one api provider registered for {name}, can't proceed".format(name=name), 500)
- api_plugin = api_plugins[0]
- if api_plugin.is_api_adminonly() and not current_user.is_admin():
- return make_response("Forbidden", 403)
+ try:
+ api_plugin = api_plugins[0]
+ if api_plugin.is_api_adminonly() and not current_user.is_admin():
+ return make_response("Forbidden", 403)
- response = api_plugin.on_api_get(request)
+ response = api_plugin.on_api_get(request)
- if response is not None:
- return response
- return NO_CONTENT
+ if response is not None:
+ return response
+ return NO_CONTENT
+ except Exception:
+ logging.getLogger(__name__).exception("Error calling SimpleApiPlugin {}".format(name),
+ extra=dict(plugin=name))
+ return abort(500)
#~~ commands for plugins
@@ -84,21 +89,26 @@ def pluginCommand(name):
return make_response("More than one api provider registered for {name}, can't proceed".format(name=name), 500)
api_plugin = api_plugins[0]
- valid_commands = api_plugin.get_api_commands()
- if valid_commands is None:
- return make_response("Method not allowed", 405)
+ try:
+ valid_commands = api_plugin.get_api_commands()
+ if valid_commands is None:
+ return make_response("Method not allowed", 405)
- if api_plugin.is_api_adminonly() and not current_user.is_admin():
- return make_response("Forbidden", 403)
+ if api_plugin.is_api_adminonly() and not current_user.is_admin():
+ return make_response("Forbidden", 403)
- command, data, response = get_json_command_from_request(request, valid_commands)
- if response is not None:
- return response
+ command, data, response = get_json_command_from_request(request, valid_commands)
+ if response is not None:
+ return response
- response = api_plugin.on_api_command(command, data)
- if response is not None:
- return response
- return NO_CONTENT
+ response = api_plugin.on_api_command(command, data)
+ if response is not None:
+ return response
+ return NO_CONTENT
+ except Exception:
+ logging.getLogger(__name__).exception("Error while excuting SimpleApiPlugin {}".format(name),
+ extra=dict(plugin=name))
+ return abort(500)
#~~ first run setup
@@ -119,7 +129,9 @@ def wizardState():
version = implementation.get_wizard_version()
ignored = octoprint.plugin.WizardPlugin.is_wizard_ignored(seen_wizards, implementation)
except:
- logging.getLogger(__name__).exception("There was an error fetching wizard details for {}, ignoring".format(name))
+ logging.getLogger(__name__).exception("There was an error fetching wizard "
+ "details for {}, ignoring".format(name),
+ extra=dict(plugin=name))
else:
result[name] = dict(required=required, details=details, version=version, ignored=ignored)
@@ -154,7 +166,9 @@ def wizardFinish():
if name in handled:
seen_wizards[name] = implementation.get_wizard_version()
except:
- logging.getLogger(__name__).exception("There was an error finishing the wizard for {}, ignoring".format(name))
+ logging.getLogger(__name__).exception("There was an error finishing the "
+ "wizard for {}, ignoring".format(name),
+ extra=dict(plugin=name))
s().set(["server", "seenWizards"], seen_wizards)
s().save()
diff --git a/src/octoprint/server/api/settings.py b/src/octoprint/server/api/settings.py
index 70b73ef81..aba8bac41 100644
--- a/src/octoprint/server/api/settings.py
+++ b/src/octoprint/server/api/settings.py
@@ -276,7 +276,8 @@ def _get_plugin_settings():
logger.warn("octoprint.plugin.SettingsPlugin.on_settings_load(self) instead.")
except:
logger.exception("Could not load settings for plugin {name} ({version})".format(version=plugin._plugin_version,
- name=plugin._plugin_name))
+ name=plugin._plugin_name),
+ extra=dict(plugin=plugin._identifier))
return data
@@ -551,6 +552,8 @@ def _saveSettings(data):
logger.warn("Please contact the plugin's author and ask to update the plugin to use a direct call like")
logger.warn("octoprint.plugin.SettingsPlugin.on_settings_save(self, data) instead.")
except:
- logger.exception("Could not save settings for plugin {name} ({version})".format(version=plugin._plugin_version, name=plugin._plugin_name))
+ logger.exception("Could not save settings for plugin {name} ({version})".format(version=plugin._plugin_version,
+ name=plugin._plugin_name),
+ extra=dict(plugin=plugin._identifier))
s.save(trigger_event=True)
diff --git a/src/octoprint/server/apps/__init__.py b/src/octoprint/server/apps/__init__.py
index 6cbe20c72..04d8edf87 100644
--- a/src/octoprint/server/apps/__init__.py
+++ b/src/octoprint/server/apps/__init__.py
@@ -107,7 +107,9 @@ def _get_registered_apps():
logger.warn("Plugin {} is still implementing the appkey hook that is deprecated since 1.3.11 and will be removed in 1.4.0. Switch it over to the Application Keys Plugin workflow.".format(name))
except:
import logging
- logging.getLogger(__name__).exception("Error while retrieving additional appkeys from plugin {name}".format(**locals()))
+ logging.getLogger(__name__).exception("Error while retrieving additional appkeys "
+ "from plugin {name}".format(**locals()),
+ extra=dict(plugin=name))
continue
any_version_enabled = dict()
diff --git a/src/octoprint/server/util/__init__.py b/src/octoprint/server/util/__init__.py
index 970a98731..e2cea3630 100644
--- a/src/octoprint/server/util/__init__.py
+++ b/src/octoprint/server/util/__init__.py
@@ -193,7 +193,9 @@ def get_user_for_apikey(apikey):
if user is not None:
return user
except:
- logging.getLogger(__name__).exception("Error running api key validator for plugin {} and key {}".format(name, apikey))
+ logging.getLogger(__name__).exception("Error running api key validator "
+ "for plugin {} and key {}".format(name, apikey),
+ extra=dict(plugin=name))
return None
diff --git a/src/octoprint/server/util/flask.py b/src/octoprint/server/util/flask.py
index 593d7872e..62f8905bf 100644
--- a/src/octoprint/server/util/flask.py
+++ b/src/octoprint/server/util/flask.py
@@ -1539,7 +1539,8 @@ def collect_plugin_assets(enable_gcodeviewer=True, preferred_stylesheet="css"):
all_assets = implementation.get_assets()
basefolder = implementation.get_asset_folder()
except:
- logger.exception("Got an error while trying to collect assets from {}, ignoring assets from the plugin".format(name))
+ logger.exception("Got an error while trying to collect assets from {}, ignoring assets from the plugin".format(name),
+ extra=dict(plugin=name))
continue
def asset_exists(category, asset):
diff --git a/src/octoprint/server/util/sockjs.py b/src/octoprint/server/util/sockjs.py
index 8423f7ca2..2e6fe9a3b 100644
--- a/src/octoprint/server/util/sockjs.py
+++ b/src/octoprint/server/util/sockjs.py
@@ -268,7 +268,8 @@ class PrinterStateConnection(octoprint.vendor.sockjs.tornado.SockJSConnection, o
try:
proceed = proceed and hook(self, self._user, type, payload)
except:
- self._logger.exception("Error processing emit hook handler from plugin {}".format(name))
+ self._logger.exception("Error processing emit hook handler from plugin {}".format(name),
+ extra=dict(plugin=name))
if not proceed:
return
@@ -290,7 +291,8 @@ class PrinterStateConnection(octoprint.vendor.sockjs.tornado.SockJSConnection, o
try:
proceed = proceed and hook(self, self._user)
except:
- self._logger.exception("Error processing register hook handler for plugin {}".format(name))
+ self._logger.exception("Error processing register hook handler for plugin {}".format(name),
+ extra=dict(plugin=name))
if not proceed:
return
@@ -358,7 +360,8 @@ class PrinterStateConnection(octoprint.vendor.sockjs.tornado.SockJSConnection, o
try:
hook(self, self._user)
except:
- self._logger.exception("Error processing authed hook handler for plugin {}".format(name))
+ self._logger.exception("Error processing authed hook handler for plugin {}".format(name),
+ extra=dict(plugin=name))
def _on_logout(self):
self._user = None
@@ -367,5 +370,6 @@ class PrinterStateConnection(octoprint.vendor.sockjs.tornado.SockJSConnection, o
try:
hook(self, self._user)
except:
- self._logger.exception("Error processing authed hook handler for plugin {}".format(name))
+ self._logger.exception("Error processing authed hook handler for plugin {}".format(name),
+ extra=dict(plugin=name))
diff --git a/src/octoprint/server/views.py b/src/octoprint/server/views.py
index 0791997cf..b220e77ae 100644
--- a/src/octoprint/server/views.py
+++ b/src/octoprint/server/views.py
@@ -123,18 +123,22 @@ def in_cache():
ui_plugins = pluginManager.get_implementations(octoprint.plugin.UiPlugin,
sorting_context="UiPlugin.on_ui_render")
for plugin in ui_plugins:
- if plugin.will_handle_ui(request):
- ui = plugin._identifier
- key = _cache_key(plugin._identifier,
- url=url,
- additional_key_data=plugin.get_ui_additional_key_data_for_cache)
- unless = _preemptive_unless(url, additional_unless=plugin.get_ui_preemptive_caching_additional_unless)
- data = _preemptive_data(plugin._identifier,
- path=path,
- base_url=base_url,
- data=plugin.get_ui_data_for_preemptive_caching,
- additional_request_data=plugin.get_ui_additional_request_data_for_preemptive_caching)
- break
+ try:
+ if plugin.will_handle_ui(request):
+ ui = plugin._identifier
+ key = _cache_key(plugin._identifier,
+ url=url,
+ additional_key_data=plugin.get_ui_additional_key_data_for_cache)
+ unless = _preemptive_unless(url, additional_unless=plugin.get_ui_preemptive_caching_additional_unless)
+ data = _preemptive_data(plugin._identifier,
+ path=path,
+ base_url=base_url,
+ data=plugin.get_ui_data_for_preemptive_caching,
+ additional_request_data=plugin.get_ui_additional_request_data_for_preemptive_caching)
+ break
+ except Exception:
+ _logger.exception("Error while calling plugin {}, skipping it".format(plugin._identifier),
+ extra=dict(plugin=plugin._identifier))
else:
ui = "_default"
key = _cache_key("_default", url=url)
@@ -403,13 +407,17 @@ def index():
# select view from plugins and fall back on default view if no plugin will handle it
ui_plugins = pluginManager.get_implementations(octoprint.plugin.UiPlugin, sorting_context="UiPlugin.on_ui_render")
for plugin in ui_plugins:
- if plugin.will_handle_ui(request):
- # plugin claims responsibility, let it render the UI
- response = plugin_view(plugin)
- if response is not None:
- break
- else:
- _logger.warn("UiPlugin {} returned an empty response".format(plugin._identifier))
+ try:
+ if plugin.will_handle_ui(request):
+ # plugin claims responsibility, let it render the UI
+ response = plugin_view(plugin)
+ if response is not None:
+ break
+ else:
+ _logger.warn("UiPlugin {} returned an empty response".format(plugin._identifier))
+ except Exception:
+ _logger.exception("Error while calling plugin {}, skipping it".format(plugin._identifier),
+ extra=dict(plugin=plugin._identifier))
else:
response = default_view()
@@ -508,7 +516,9 @@ def fetch_template_data(refresh=False):
try:
result = hook(dict(template_sorting), dict(template_rules))
except:
- _logger.exception("Error while retrieving custom template type definitions from plugin {name}".format(**locals()))
+ _logger.exception("Error while retrieving custom template type "
+ "definitions from plugin {name}".format(**locals()),
+ extra=dict(plugin=name))
else:
if not isinstance(result, list):
continue
@@ -649,7 +659,8 @@ def fetch_template_data(refresh=False):
wizard_required = implementation.is_wizard_required()
wizard_ignored = octoprint.plugin.WizardPlugin.is_wizard_ignored(seen_wizards, implementation)
except:
- _logger.exception("Error while retrieving template data for plugin {}, ignoring it".format(name))
+ _logger.exception("Error while retrieving template data for plugin {}, ignoring it".format(name),
+ extra=dict(plugin=name))
continue
if not isinstance(vars, dict):
diff --git a/src/octoprint/slicing/__init__.py b/src/octoprint/slicing/__init__.py
index f9e60b0a2..7f80432bd 100644
--- a/src/octoprint/slicing/__init__.py
+++ b/src/octoprint/slicing/__init__.py
@@ -139,7 +139,8 @@ class SlicingManager(object):
try:
slicers[plugin.get_slicer_properties()["type"]] = plugin
except:
- self._logger.exception("Error while getting properties from slicer {}, ignoring it".format(plugin._identifier))
+ self._logger.exception("Error while getting properties from slicer {}, ignoring it".format(plugin._identifier),
+ extra=dict(plugin=plugin._identifier))
continue
self._slicers = slicers
diff --git a/src/octoprint/timelapse.py b/src/octoprint/timelapse.py
index 9b61a9481..a6dfaf597 100644
--- a/src/octoprint/timelapse.py
+++ b/src/octoprint/timelapse.py
@@ -79,7 +79,9 @@ def valid_timelapse(path):
continue
extensions += result
except:
- logging.getLogger(__name__).exception("Exception while retrieving additional timelapse extensions from hook {name}".format(name=name))
+ logging.getLogger(__name__).exception("Exception while retrieving additional timelapse "
+ "extensions from hook {name}".format(name=name),
+ extra=dict(plugin=name))
_extensions = list(set(extensions))
diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py
index c64f13319..49d5a51fb 100644
--- a/src/octoprint/util/comm.py
+++ b/src/octoprint/util/comm.py
@@ -999,7 +999,8 @@ class MachineCom(object):
try:
retval = hook(self, "gcode", scriptName)
except:
- self._logger.exception("Error while processing hook {name}.".format(**locals()))
+ self._logger.exception("Error while processing hook {name}.".format(**locals()),
+ extra=dict(plugin=name))
else:
if retval is None:
continue
@@ -1520,7 +1521,8 @@ class MachineCom(object):
if parsedTemps is None or not parsedTemps:
return
except:
- self._logger.exception("Error while processing temperatures in {}, skipping".format(name))
+ self._logger.exception("Error while processing temperatures in {}, skipping".format(name),
+ extra=dict(plugin=name))
if current_tool_key in parsedTemps.keys():
shared_nozzle = self._printerProfileManager.get_current_or_default()["extruder"]["sharedNozzle"]
@@ -1660,11 +1662,13 @@ class MachineCom(object):
self._log("Disconnecting on request of the printer...")
self._callback.on_comm_force_disconnect()
else:
- for hook in self._printer_action_hooks:
+ for name, hook in self._printer_action_hooks.items():
try:
- self._printer_action_hooks[hook](self, line, action_command)
+ hook(self, line, action_command)
except:
- self._logger.exception("Error while calling hook {} with action command {}".format(self._printer_action_hooks[hook], action_command))
+ self._logger.exception("Error while calling hook from plugin "
+ "{} with action command {}".format(name, action_command),
+ extra=dict(plugin=name))
continue
if self._state not in (self.STATE_CONNECTING, self.STATE_DETECT_BAUDRATE):
@@ -1908,7 +1912,8 @@ class MachineCom(object):
try:
hook(self, firmware_name, copy.copy(data))
except:
- self._logger.exception("Error processing firmware info hook {}:".format(name))
+ self._logger.exception("Error processing firmware info hook {}:".format(name),
+ extra=dict(plugin=name))
##~~ Firmware capability report triggered by M115
elif lower_line.startswith("cap:"):
@@ -1932,7 +1937,8 @@ class MachineCom(object):
try:
hook(self, capability, enabled, copy.copy(self._firmware_capabilities))
except:
- self._logger.exception("Error processing firmware capability hook {}:".format(name))
+ self._logger.exception("Error processing firmware capability hook {}:".format(name),
+ extra=dict(plugin=name))
##~~ invalid extruder
elif 'invalid extruder' in lower_line:
@@ -2692,7 +2698,8 @@ class MachineCom(object):
try:
ret = hook(self, stripped_error)
except:
- self._logger.exception("Error while processing hook {name}:".format(**locals()))
+ self._logger.exception("Error while processing hook {name}:".format(**locals()),
+ extra=dict(plugin=name))
else:
if ret:
return line
@@ -2750,7 +2757,8 @@ class MachineCom(object):
try:
ret = hook(self, ret)
except Exception:
- self._logger.exception("Error while processing hook {name}:".format(**locals()))
+ self._logger.exception("Error while processing hook {name}:".format(**locals()),
+ extra=dict(plugin=name))
else:
if ret is None:
return ""
@@ -3209,7 +3217,9 @@ class MachineCom(object):
try:
hook_results = hook(self, phase, command, command_type, gcode, subcode=subcode, tags=tags)
except:
- self._logger.exception("Error while processing hook {name} for phase {phase} and command {command}:".format(**locals()))
+ self._logger.exception("Error while processing hook {name} for phase "
+ "{phase} and command {command}:".format(**locals()),
+ extra=dict(plugin=name))
else:
normalized = _normalize_command_handler_result(command, command_type, gcode, subcode, tags,
hook_results,
@@ -3290,7 +3300,9 @@ class MachineCom(object):
try:
hook(self, phase, atcommand, parameters, tags=tags)
except:
- self._logger.exception("Error while processing hook {} for phase {} and command {}:".format(name, phase, atcommand))
+ self._logger.exception("Error while processing hook {} for "
+ "phase {} and command {}:".format(name, phase, atcommand),
+ extra=dict(plugin=name))
# trigger built-in handler if available
handler = getattr(self, "_atcommand_{}_{}".format(atcommand, phase), None)
From f1309dad1db5db3d3efb3a45630c678f4c845235 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Fri, 5 Apr 2019 17:48:52 +0200
Subject: [PATCH 07/27] =?UTF-8?q?=E2=9C=A8=20error=20tracking:=20filter=20?=
=?UTF-8?q?all=20exceptions=20triggered=20in=20plugins?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The new extra parameter passed to exception loggers throughout
OctoPrint allows even more aggressive filtering to reduce the noise
further.
---
src/octoprint/plugins/errortracking/__init__.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/octoprint/plugins/errortracking/__init__.py b/src/octoprint/plugins/errortracking/__init__.py
index 98a800df2..43e623f66 100644
--- a/src/octoprint/plugins/errortracking/__init__.py
+++ b/src/octoprint/plugins/errortracking/__init__.py
@@ -111,6 +111,7 @@ def _enable_errortracking():
handled = True
logger = event.get("logger", "")
+ plugin = event.get("extra", dict()).get("plugin", None)
for ignore in IGNORED_EXCEPTIONS:
if isinstance(ignore, tuple):
@@ -141,6 +142,12 @@ def _enable_errortracking():
# we only want our active bundled plugins
return None
+ if plugin is not None:
+ plugin_info = plugin_manager().get_plugin_info(plugin)
+ if plugin_info is None or not plugin_info.bundled:
+ # we only want our active bundled plugins
+ return None
+
return event
sentry_sdk.init(url_server,
From 0a1cc68a6bf03e0aba22c5f4fb1c1df86e109d47 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Fri, 5 Apr 2019 18:36:50 +0200
Subject: [PATCH 08/27] =?UTF-8?q?=E2=99=BB=20error=20tracking:=20minor=20r?=
=?UTF-8?q?estructuring?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/octoprint/plugins/errortracking/__init__.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/octoprint/plugins/errortracking/__init__.py b/src/octoprint/plugins/errortracking/__init__.py
index 43e623f66..d4b7c9464 100644
--- a/src/octoprint/plugins/errortracking/__init__.py
+++ b/src/octoprint/plugins/errortracking/__init__.py
@@ -12,9 +12,6 @@ from octoprint.util.version import get_octoprint_version_string, is_released_oct
from flask import jsonify
from flask_babel import gettext
-from serial import SerialException
-from requests.exceptions import RequestException
-
SENTRY_URL_SERVER = "https://4273b441bb654c4398de42ba86350963@sentry.io/1373987"
SENTRY_URL_COREUI = "https://f9bcd7185f73430bbe7c09ff69586b0f@sentry.io/1374096"
@@ -24,9 +21,12 @@ SETTINGS_DEFAULTS = dict(enabled=False,
url_server=SENTRY_URL_SERVER,
url_coreui=SENTRY_URL_COREUI)
+import serial
+import requests.exceptions
+
IGNORED_EXCEPTIONS = [
- (SerialException, "octoprint.util.comm"),
- RequestException
+ (serial.SerialException, "octoprint.util.comm"),
+ requests.exceptions.RequestException,
]
From de6d1afdd6792f3860e7dfea932889592d62baaa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Mon, 8 Apr 2019 12:12:00 +0200
Subject: [PATCH 09/27] =?UTF-8?q?=E2=9C=A8=20Add=20flag=20to=20ignore=20in?=
=?UTF-8?q?complete=20startup?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
See https://github.com/foosel/OctoPrint/issues/3103#issuecomment-480612935
---
docs/configuration/config_yaml.rst | 7 +++++++
src/octoprint/__init__.py | 5 ++++-
src/octoprint/server/__init__.py | 5 +++--
src/octoprint/settings.py | 1 +
4 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/docs/configuration/config_yaml.rst b/docs/configuration/config_yaml.rst
index 7ab22da07..83ea5495d 100644
--- a/docs/configuration/config_yaml.rst
+++ b/docs/configuration/config_yaml.rst
@@ -952,6 +952,13 @@ Use the following settings to configure the server:
# reset the setting to false
startOnceInSafeMode: false
+ # Signals to OctoPrint that the last startup was incomplete. OctoPrint will then startup
+ # in safe mode
+ incompleteStartup: false
+
+ # Set this to true to make OctoPrint ignore incomplete startups. Helpful for development.
+ ignoreIncompleteStartup: false
+
# Secret key for encrypting cookies and such, randomly generated on first run
secretKey: someSecretKey
diff --git a/src/octoprint/__init__.py b/src/octoprint/__init__.py
index 0776420b8..fc8c8f1d2 100644
--- a/src/octoprint/__init__.py
+++ b/src/octoprint/__init__.py
@@ -104,7 +104,10 @@ def init_platform(basedir, configfile, use_logging_file=True, logging_file=None,
after_logging(**kwargs)
settings_start_once_in_safemode = "settings" if settings.getBoolean(["server", "startOnceInSafeMode"]) else None
- settings_incomplete_startup_safemode = "incomplete_startup" if settings.getBoolean(["server", "incompleteStartup"]) else None
+ settings_incomplete_startup_safemode = "incomplete_startup" \
+ if settings.getBoolean(["server", "incompleteStartup"]) \
+ and not settings.getBoolean(["server", "ignoreIncompleteStartup"]) \
+ else None
safe_mode = safe_mode or settings_start_once_in_safemode or settings_incomplete_startup_safemode
kwargs["safe_mode"] = safe_mode
if callable(after_safe_mode):
diff --git a/src/octoprint/server/__init__.py b/src/octoprint/server/__init__.py
index 4899a94d5..103873b1c 100644
--- a/src/octoprint/server/__init__.py
+++ b/src/octoprint/server/__init__.py
@@ -191,8 +191,9 @@ class Server(object):
if self._settings is None:
self._settings = settings()
- self._settings.setBoolean(["server", "incompleteStartup"], True)
- self._settings.save()
+ if not self._settings.getBoolean(["server", "ignoreIncompleteStartup"]):
+ self._settings.setBoolean(["server", "incompleteStartup"], True)
+ self._settings.save()
if self._plugin_manager is None:
self._plugin_manager = octoprint.plugin.plugin_manager()
diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py
index 22b6084f4..8f758c02a 100644
--- a/src/octoprint/settings.py
+++ b/src/octoprint/settings.py
@@ -158,6 +158,7 @@ default_settings = {
"port": 5000,
"firstRun": True,
"startOnceInSafeMode": False,
+ "ignoreIncompleteStartup": False,
"incompleteStartup": False,
"seenWizards": {},
"secretKey": None,
From 8970fb42b1f7f5ae712f80e1595bdb7c08665cf1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Mon, 8 Apr 2019 14:08:57 +0200
Subject: [PATCH 10/27] =?UTF-8?q?=E2=9C=A8=20error=20tracking:=20further?=
=?UTF-8?q?=20filtering?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../plugins/errortracking/__init__.py | 33 ++++++++++++++++---
1 file changed, 28 insertions(+), 5 deletions(-)
diff --git a/src/octoprint/plugins/errortracking/__init__.py b/src/octoprint/plugins/errortracking/__init__.py
index d4b7c9464..bb12821e4 100644
--- a/src/octoprint/plugins/errortracking/__init__.py
+++ b/src/octoprint/plugins/errortracking/__init__.py
@@ -23,12 +23,30 @@ SETTINGS_DEFAULTS = dict(enabled=False,
import serial
import requests.exceptions
+import errno
IGNORED_EXCEPTIONS = [
- (serial.SerialException, "octoprint.util.comm"),
+ # serial exceptions in octoprint.util.comm
+ (serial.SerialException, lambda exc, logger, plugin: logger == "octoprint.util.comm"),
+
+ # IOErrors of any kind due to a full file system
+ (IOError, lambda exc, logger, plugin: getattr(exc, "errno") and exc.errno in (getattr(errno, "ENOSPC"),)),
+
+ # RequestExceptions of any kind
requests.exceptions.RequestException,
]
+try:
+ # noinspection PyUnresolvedReferences
+ from octoprint.plugins.backup import InsufficientSpace
+
+ # if the backup plugin is enabled, ignore InsufficienSpace errors from it as well
+ IGNORED_EXCEPTIONS.append(InsufficientSpace)
+
+ del InsufficientSpace
+except ImportError:
+ pass
+
class ErrorTrackingPlugin(octoprint.plugin.SettingsPlugin,
octoprint.plugin.AssetPlugin,
@@ -115,10 +133,15 @@ def _enable_errortracking():
for ignore in IGNORED_EXCEPTIONS:
if isinstance(ignore, tuple):
- ignored_exc, ignored_logger = ignore
- if isinstance(hint["exc_info"][1], ignored_exc) and logger.startswith(ignored_logger):
- # exception ignored for logger
- return None
+ ignored_exc, matcher = ignore
+ else:
+ ignored_exc = ignore
+ matcher = lambda *args: True
+
+ exc = hint["exc_info"][1]
+ if isinstance(exc, ignored_exc) and matcher(exc, logger, plugin):
+ # exception ignored for logger
+ return None
elif isinstance(ignore, type):
if isinstance(hint["exc_info"][1], ignore):
From d6576306b0c3080a84d8a34e7ef338d02d7378b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Tue, 9 Apr 2019 11:06:04 +0200
Subject: [PATCH 11/27] =?UTF-8?q?=F0=9F=90=9B=20Add=20missing=20rstrip?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes #3115
---
src/octoprint/util/comm.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py
index 49d5a51fb..030466f29 100644
--- a/src/octoprint/util/comm.py
+++ b/src/octoprint/util/comm.py
@@ -2747,9 +2747,9 @@ class MachineCom(object):
return None
try:
- ret = ret.decode('utf-8')
+ ret = ret.decode('utf-8').rstrip()
except UnicodeDecodeError:
- ret = ret.decode('latin1')
+ ret = ret.decode('latin1').rstrip()
self._log(u"Recv: {}".format(ret))
From 84fa3b60735deb16fafb46d27abde229bafcb979 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Tue, 9 Apr 2019 11:07:11 +0200
Subject: [PATCH 12/27] =?UTF-8?q?=F0=9F=90=9B=20Don't=20log=20empty=20line?=
=?UTF-8?q?s?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
See also #3115
---
src/octoprint/util/comm.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py
index 030466f29..97e9fb991 100644
--- a/src/octoprint/util/comm.py
+++ b/src/octoprint/util/comm.py
@@ -2751,7 +2751,8 @@ class MachineCom(object):
except UnicodeDecodeError:
ret = ret.decode('latin1').rstrip()
- self._log(u"Recv: {}".format(ret))
+ if ret != u"":
+ self._log(u"Recv: {}".format(ret))
for name, hook in self._received_message_hooks.items():
try:
From 0a040439221676c719e765009ea3327b92ba5091 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Tue, 9 Apr 2019 16:55:35 +0200
Subject: [PATCH 13/27] =?UTF-8?q?=F0=9F=90=9B=20Fix=20potential=20division?=
=?UTF-8?q?=20by=20zero?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes #3116
---
src/octoprint/printer/estimation.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/octoprint/printer/estimation.py b/src/octoprint/printer/estimation.py
index 91bff26c6..9bf5b0255 100644
--- a/src/octoprint/printer/estimation.py
+++ b/src/octoprint/printer/estimation.py
@@ -226,14 +226,14 @@ class TimeEstimationHelper(object):
@property
def average_total_rolling(self):
- if not self._count or self._count < self._rolling_window:
+ if not self._count or self._count < self._rolling_window or not len(self._totals):
return None
else:
return sum(self._totals) / len(self._totals)
@property
def average_distance(self):
- if not self._count or self._count < self._rolling_window + 1:
+ if not self._count or self._count < self._rolling_window + 1 or not len(self._distances):
return None
else:
return sum(self._distances) / len(self._distances)
From f389773036b5ef9f1e70cce0ef5d99634c3a5168 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Tue, 9 Apr 2019 16:56:02 +0200
Subject: [PATCH 14/27] =?UTF-8?q?=E2=98=94=20Make=20sure=20rolling=20windo?=
=?UTF-8?q?w=20is=20at=20least=201?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
See #3116
---
src/octoprint/printer/estimation.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/octoprint/printer/estimation.py b/src/octoprint/printer/estimation.py
index 9bf5b0255..537760a8f 100644
--- a/src/octoprint/printer/estimation.py
+++ b/src/octoprint/printer/estimation.py
@@ -37,6 +37,8 @@ class PrintTimeEstimator(object):
if interval <= 0:
interval = 1.0
rolling_window = 15 / interval
+ if rolling_window < 1:
+ rolling_window = 1
# we are happy when one rolling window has been stable
countdown = rolling_window
From 323131cbc524ce8dfa41d9533e7468f3fa7b649e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Tue, 9 Apr 2019 16:56:17 +0200
Subject: [PATCH 15/27] =?UTF-8?q?=E2=98=94=20Harden=20against=20estimation?=
=?UTF-8?q?=20exceptions?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/octoprint/printer/standard.py | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/octoprint/printer/standard.py b/src/octoprint/printer/standard.py
index 5beac173e..420a0bf17 100644
--- a/src/octoprint/printer/standard.py
+++ b/src/octoprint/printer/standard.py
@@ -859,11 +859,14 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
statisticalTotalPrintTime = self._selectedFile["estimatedPrintTime"]
statisticalTotalPrintTimeType = self._selectedFile.get("estimatedPrintTimeType", None)
- printTimeLeft, printTimeLeftOrigin = estimator.estimate(progress,
- printTime,
- cleanedPrintTime,
- statisticalTotalPrintTime,
- statisticalTotalPrintTimeType)
+ try:
+ printTimeLeft, printTimeLeftOrigin = estimator.estimate(progress,
+ printTime,
+ cleanedPrintTime,
+ statisticalTotalPrintTime,
+ statisticalTotalPrintTimeType)
+ except Exception:
+ self._logger.exception("Error while estimating print time via {}".format(estimator))
return self._dict(completion=progress * 100 if progress is not None else None,
filepos=filepos,
From 72cc1afb45423473620f08201fd03fa1b2b6c018 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Tue, 9 Apr 2019 17:00:57 +0200
Subject: [PATCH 16/27] =?UTF-8?q?=F0=9F=90=9B=20Refresh=20connection=20tab?=
=?UTF-8?q?=20on=20disconnect?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
That way we'll hopefully notice vanishing/changed ports.
Potential fix for #3111, waiting for test results from @arhi
---
src/octoprint/static/js/app/viewmodels/connection.js | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/octoprint/static/js/app/viewmodels/connection.js b/src/octoprint/static/js/app/viewmodels/connection.js
index 63615747b..486464d67 100644
--- a/src/octoprint/static/js/app/viewmodels/connection.js
+++ b/src/octoprint/static/js/app/viewmodels/connection.js
@@ -177,6 +177,10 @@ $(function() {
self.requestData();
};
+ self.onEventDisconnected = function() {
+ self.requestData();
+ };
+
self.onStartup = function() {
var connectionTab = $("#connection");
connectionTab.on("show", function() {
From 58806a3d00ca49e31ed5ab09224697b44afcb6c1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Tue, 9 Apr 2019 17:22:16 +0200
Subject: [PATCH 17/27] =?UTF-8?q?=F0=9F=94=A7=20error=20tracking:=20update?=
=?UTF-8?q?=20DSNs?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/octoprint/plugins/errortracking/__init__.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/octoprint/plugins/errortracking/__init__.py b/src/octoprint/plugins/errortracking/__init__.py
index bb12821e4..fe6e54ce7 100644
--- a/src/octoprint/plugins/errortracking/__init__.py
+++ b/src/octoprint/plugins/errortracking/__init__.py
@@ -12,8 +12,8 @@ from octoprint.util.version import get_octoprint_version_string, is_released_oct
from flask import jsonify
from flask_babel import gettext
-SENTRY_URL_SERVER = "https://4273b441bb654c4398de42ba86350963@sentry.io/1373987"
-SENTRY_URL_COREUI = "https://f9bcd7185f73430bbe7c09ff69586b0f@sentry.io/1374096"
+SENTRY_URL_SERVER = "https://d70b163409984dd6a716788092c3b3fd@sentry.io/1373987"
+SENTRY_URL_COREUI = "https://190fb33f582a46768e24ec8a6db7522f@sentry.io/1374096"
SETTINGS_DEFAULTS = dict(enabled=False,
enabled_unreleased=False,
From 5ca286f4e385585886688be09da834e47898727f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Wed, 10 Apr 2019 11:39:02 +0200
Subject: [PATCH 18/27] =?UTF-8?q?=F0=9F=94=87=20error=20tracking:=20mute?=
=?UTF-8?q?=20ispErrors?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/octoprint/plugins/errortracking/__init__.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/octoprint/plugins/errortracking/__init__.py b/src/octoprint/plugins/errortracking/__init__.py
index fe6e54ce7..0a8b2149d 100644
--- a/src/octoprint/plugins/errortracking/__init__.py
+++ b/src/octoprint/plugins/errortracking/__init__.py
@@ -24,11 +24,15 @@ SETTINGS_DEFAULTS = dict(enabled=False,
import serial
import requests.exceptions
import errno
+import octoprint.util.avr_isp.ispBase
IGNORED_EXCEPTIONS = [
# serial exceptions in octoprint.util.comm
(serial.SerialException, lambda exc, logger, plugin: logger == "octoprint.util.comm"),
+ # isp errors during port auto detection in octoprint.util.comm
+ (octoprint.util.avr_isp.ispBase.IspError, lambda exc, logger, plugin: logger == "octoprint.util.comm"),
+
# IOErrors of any kind due to a full file system
(IOError, lambda exc, logger, plugin: getattr(exc, "errno") and exc.errno in (getattr(errno, "ENOSPC"),)),
@@ -40,7 +44,7 @@ try:
# noinspection PyUnresolvedReferences
from octoprint.plugins.backup import InsufficientSpace
- # if the backup plugin is enabled, ignore InsufficienSpace errors from it as well
+ # if the backup plugin is enabled, ignore InsufficientSpace errors from it as well
IGNORED_EXCEPTIONS.append(InsufficientSpace)
del InsufficientSpace
From bfcff9a1cda4bcf909148bdd8ef90505ad760355 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Wed, 10 Apr 2019 12:03:31 +0200
Subject: [PATCH 19/27] =?UTF-8?q?=F0=9F=90=9B=20Fix=20some=20potential=20e?=
=?UTF-8?q?ncoding=20errors?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/octoprint/util/comm.py | 27 +++++++++++++++++++--------
1 file changed, 19 insertions(+), 8 deletions(-)
diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py
index 97e9fb991..4df90bf7d 100644
--- a/src/octoprint/util/comm.py
+++ b/src/octoprint/util/comm.py
@@ -3188,7 +3188,7 @@ class MachineCom(object):
def _log_command_phase(self, phase, command, *args, **kwargs):
if self._phaseLogger.isEnabledFor(logging.DEBUG):
output_parts = [u"phase: {}".format(phase),
- u"command: {}".format(command)]
+ u"command: {}".format(to_unicode(command, errors="replace"))]
if kwargs.get("command_type"):
output_parts.append(u"command_type: {}".format(kwargs["command_type"]))
@@ -3199,7 +3199,7 @@ class MachineCom(object):
if kwargs.get("tags"):
output_parts.append(u"tags: [ {} ]".format(", ".join(sorted(kwargs["tags"]))))
- self._phaseLogger.debug(" | ".join(output_parts))
+ self._phaseLogger.debug(u" | ".join(output_parts))
def _process_command_phase(self, phase, command, command_type=None, gcode=None, subcode=None, tags=None):
if gcode is None:
@@ -3218,8 +3218,11 @@ class MachineCom(object):
try:
hook_results = hook(self, phase, command, command_type, gcode, subcode=subcode, tags=tags)
except:
- self._logger.exception("Error while processing hook {name} for phase "
- "{phase} and command {command}:".format(**locals()),
+ self._logger.exception(u"Error while processing hook {name} for phase "
+ u"{phase} and command {command}:".format(name=name,
+ phase=phase,
+ command=to_unicode(command,
+ errors="replace")),
extra=dict(plugin=name))
else:
normalized = _normalize_command_handler_result(command, command_type, gcode, subcode, tags,
@@ -3230,7 +3233,14 @@ class MachineCom(object):
# make sure we don't allow multi entry results in anything but the queuing phase
if not phase in ("queuing",) and len(normalized) > 1:
- self._logger.error("Error while processing hook {name} for phase {phase} and command {command}: Hook returned multi-entry result for phase {phase} and command {command}. That's not supported, if you need to do multi expansion of commands you need to do this in the queuing phase. Ignoring hook result and sending command as-is.".format(**locals()))
+ self._logger.error(u"Error while processing hook {name} for phase {phase} and command {command}: "
+ u"Hook returned multi-entry result for phase {phase} and command {command}. "
+ u"That's not supported, if you need to do multi expansion of commands you "
+ u"need to do this in the queuing phase. Ignoring hook result and sending "
+ u"command as-is.".format(name=name,
+ phase=phase,
+ command=to_unicode(command, errors="replace")),
+ extra=dict(plugin=name))
new_results.append((command, command_type, gcode, subcode, tags))
else:
new_results += normalized
@@ -3301,8 +3311,8 @@ class MachineCom(object):
try:
hook(self, phase, atcommand, parameters, tags=tags)
except:
- self._logger.exception("Error while processing hook {} for "
- "phase {} and command {}:".format(name, phase, atcommand),
+ self._logger.exception(u"Error while processing hook {} for "
+ u"phase {} and command {}:".format(name, phase, to_unicode(atcommand, errors="replace")),
extra=dict(plugin=name))
# trigger built-in handler if available
@@ -3311,7 +3321,8 @@ class MachineCom(object):
try:
handler(atcommand, parameters, tags=tags)
except:
- self._logger.exception("Error in handler for phase {} and command {}".format(phase, atcommand))
+ self._logger.exception(u"Error in handler for phase {} and command {}".format(phase,
+ to_unicode(atcommand, errors="replace")))
##~~ actual sending via serial
From 9775d99febc74c00313ac1b5a3c858e385bfceeb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Wed, 10 Apr 2019 12:03:45 +0200
Subject: [PATCH 20/27] =?UTF-8?q?=F0=9F=94=87=20error=20tracking:=20mute?=
=?UTF-8?q?=20tornado's=20WebSocketErrors?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/octoprint/plugins/errortracking/__init__.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/octoprint/plugins/errortracking/__init__.py b/src/octoprint/plugins/errortracking/__init__.py
index 0a8b2149d..15e9641c4 100644
--- a/src/octoprint/plugins/errortracking/__init__.py
+++ b/src/octoprint/plugins/errortracking/__init__.py
@@ -25,6 +25,7 @@ import serial
import requests.exceptions
import errno
import octoprint.util.avr_isp.ispBase
+import tornado.websocket
IGNORED_EXCEPTIONS = [
# serial exceptions in octoprint.util.comm
@@ -38,6 +39,9 @@ IGNORED_EXCEPTIONS = [
# RequestExceptions of any kind
requests.exceptions.RequestException,
+
+ # Tornado WebSocketErrors of any kind
+ tornado.websocket.WebSocketError
]
try:
From 68952c20bd15f0f9f8dfaa034a13308ba5807bdc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Wed, 10 Apr 2019 13:27:24 +0200
Subject: [PATCH 21/27] =?UTF-8?q?=E2=8F=AA=20Switch=20lines=20read=20from?=
=?UTF-8?q?=20serial=20back=20to=20bytes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
While long term we want to have unicode here, the rest of the code
is not even remotely prepared for handling utf-8 strings as visible in
the large amount of unicode issues visible in sentry.
So for now we go back to byte objects and fix #3091 differently
---
src/octoprint/util/comm.py | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py
index 4df90bf7d..8094cc705 100644
--- a/src/octoprint/util/comm.py
+++ b/src/octoprint/util/comm.py
@@ -2746,13 +2746,12 @@ class MachineCom(object):
self.close(is_error=True)
return None
- try:
- ret = ret.decode('utf-8').rstrip()
- except UnicodeDecodeError:
- ret = ret.decode('latin1').rstrip()
-
- if ret != u"":
- self._log(u"Recv: {}".format(ret))
+ if ret != "":
+ try:
+ self._log("Recv: " + sanitize_ascii(ret))
+ except ValueError as e:
+ self._log("WARN: While reading last line: %s" % e)
+ self._log("Recv: " + repr(ret))
for name, hook in self._received_message_hooks.items():
try:
From 9721aec32ae72e642bebea6cd9aa75d75777d32c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Wed, 10 Apr 2019 16:37:36 +0200
Subject: [PATCH 22/27] =?UTF-8?q?=F0=9F=90=9B=20printer=20safety:=20Fix=20?=
=?UTF-8?q?for=20unicode=20issues?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes #3090
---
.../plugins/printer_safety_check/__init__.py | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/octoprint/plugins/printer_safety_check/__init__.py b/src/octoprint/plugins/printer_safety_check/__init__.py
index 2fb9d50e6..f496dbbe0 100644
--- a/src/octoprint/plugins/printer_safety_check/__init__.py
+++ b/src/octoprint/plugins/printer_safety_check/__init__.py
@@ -8,6 +8,7 @@ import octoprint.plugin
from octoprint.events import Events
from octoprint.server import user_permission
+from octoprint.util import to_unicode
from .checks.firmware_unsafe import FirmwareUnsafeChecks
@@ -77,19 +78,24 @@ class PrinterSafetyCheckPlugin(octoprint.plugin.AssetPlugin,
def on_gcode_received(self, comm_instance, line, *args, **kwargs):
if self._scan_received:
- self._run_checks("received", line)
+ self._run_checks("received", to_unicode(line, errors="replace"))
return line
##~~ Firmware info hook handler
def on_firmware_info_received(self, comm_instance, firmware_name, firmware_data):
- self._run_checks("m115", firmware_name, firmware_data)
+ self._run_checks("m115",
+ to_unicode(firmware_name, errors="replace"),
+ dict((to_unicode(key, errors="replace"), to_unicode(value, errors="replace"))
+ for key, value in firmware_data.items()))
self._scan_received = False
##~~ Firmware capability hook handler
def on_firmware_cap_received(self, comm_instance, cap, enabled, all_caps):
- self._run_checks("cap", cap, enabled)
+ self._run_checks("cap",
+ to_unicode(cap, errors="replace"),
+ enabled)
##~~ Helpers
From 967b3bbff87e3a8f8e58c14a717f8a29c0294c95 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Wed, 10 Apr 2019 12:54:07 +0200
Subject: [PATCH 23/27] =?UTF-8?q?=F0=9F=94=96=20Preparing=20release=20of?=
=?UTF-8?q?=201.3.11rc3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
CHANGELOG.md | 26 +++++++++
SUPPORTERS.md | 2 +-
translations/de/LC_MESSAGES/messages.po | 74 ++++++++++++------------
translations/messages.pot | 76 ++++++++++++-------------
4 files changed, 102 insertions(+), 76 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 518dd432c..0b093542f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,31 @@
# OctoPrint Changelog
+## 1.3.11rc3 (2019-04-11)
+
+### Bug fixes
+
+ * [#3105](https://github.com/foosel/OctoPrint/issues/3105) (regression) - Virtual printer: Fix an encoding issue
+ * [#3108](https://github.com/foosel/OctoPrint/issues/3108) (regression) - Fix bug in port detection
+ * [#3111](https://github.com/foosel/OctoPrint/issues/3111) (regression) - Refresh port list after disconnect to detect vanishing ports
+ * [#3115](https://github.com/foosel/OctoPrint/issues/3115) (regression) - Fix extra newlines in `serial.log` and empty lines on terminal
+ * [#3116](https://github.com/foosel/OctoPrint/issues/3116) - Fix potential division by zero
+ * Fix wrong textual representation of `STARTING` state
+ * Fix some potential encoding errors in the comm layer
+
+### Unreproduced issues
+
+The following issues were reported in RC1 or RC2 but so far have been unreproduced and further data to analyse them is still missing. If you encounter any of them please report back with a [fully filled out issue template](https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md#what-should-i-include-in-a-bug-report):
+
+ * ["Print completes but temp data appears to be 'stuck' at last known value for bed and hotend."](https://github.com/foosel/OctoPrint/issues/3087#issuecomment-478369220)
+
+### Special thanks to all the contributors!
+
+Special thanks to everyone who contributed to this release candidate and provided full, analysable bug reports.
+
+### More information
+
+ * [Commits](https://github.com/foosel/OctoPrint/compare/1.3.11rc2...1.3.11rc3)
+
## 1.3.11rc2 (2019-04-04)
### Improvements
diff --git a/SUPPORTERS.md b/SUPPORTERS.md
index 6baff4b41..f752e4740 100644
--- a/SUPPORTERS.md
+++ b/SUPPORTERS.md
@@ -54,4 +54,4 @@ thanks to everyone who contributed!
* Trent Shumay
* Ulrich Kempken
-and 1509 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel)!
\ No newline at end of file
+and 1521 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel)!
\ No newline at end of file
diff --git a/translations/de/LC_MESSAGES/messages.po b/translations/de/LC_MESSAGES/messages.po
index 851f551cb..2dd8b3fa0 100644
--- a/translations/de/LC_MESSAGES/messages.po
+++ b/translations/de/LC_MESSAGES/messages.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: OctoPrint\n"
"Report-Msgid-Bugs-To: i18n@octoprint.org\n"
-"POT-Creation-Date: 2019-04-04 14:21+0200\n"
+"POT-Creation-Date: 2019-04-10 12:34+0200\n"
"PO-Revision-Date: 2019-03-26 14:25+0100\n"
"Last-Translator: Gina Häußge \n"
"Language: de\n"
@@ -650,13 +650,13 @@ msgid "Server Commands"
msgstr "Serverbefehle"
#: src/octoprint/plugins/corewizard/subwizards.py:49
-#: src/octoprint/server/views.py:585
+#: src/octoprint/server/views.py:595
msgid "Webcam & Timelapse"
msgstr "Webcam & Zeitraffer"
#: src/octoprint/plugins/corewizard/subwizards.py:64
#: src/octoprint/plugins/corewizard/templates/corewizard_acl_wizard.jinja2:1
-#: src/octoprint/server/views.py:591
+#: src/octoprint/server/views.py:601
msgid "Access Control"
msgstr "Zugangsbeschränkung"
@@ -1205,7 +1205,7 @@ msgstr ""
"Ohne dieses Plugin wird deine OctoPrint Instanz nicht mehr in deinem "
"Netzwerk mittels Bonjour oder uPnP automatisch auffindbar sein."
-#: src/octoprint/plugins/errortracking/__init__.py:39
+#: src/octoprint/plugins/errortracking/__init__.py:67
#: src/octoprint/plugins/errortracking/templates/errortracking_settings.jinja2:1
msgid "Error Tracking"
msgstr "Fehlertracking"
@@ -1333,7 +1333,7 @@ msgstr ""
" noreferer\">Privacy Policy an.\n"
"
\n"
-#: src/octoprint/plugins/forcelogin/__init__.py:189
+#: src/octoprint/plugins/forcelogin/__init__.py:190
msgid ""
"Without this plugin anonymous users will have read-only access to your "
"OctoPrint instance. Only disable this if you are comfortable with this, "
@@ -2170,25 +2170,25 @@ msgstr "Warnung!"
msgid "Learn more..."
msgstr "Mehr erfahren..."
-#: src/octoprint/plugins/softwareupdate/__init__.py:519
+#: src/octoprint/plugins/softwareupdate/__init__.py:521
msgid "Python"
msgstr "Python"
-#: src/octoprint/plugins/softwareupdate/__init__.py:520
+#: src/octoprint/plugins/softwareupdate/__init__.py:522
msgid "pip"
msgstr "pip"
-#: src/octoprint/plugins/softwareupdate/__init__.py:521
+#: src/octoprint/plugins/softwareupdate/__init__.py:523
msgid "setuptools"
msgstr "setuptools"
-#: src/octoprint/plugins/softwareupdate/__init__.py:608
+#: src/octoprint/plugins/softwareupdate/__init__.py:610
#: src/octoprint/plugins/softwareupdate/templates/softwareupdate_wizard.jinja2:1
msgid "Software Update"
msgstr "Software Update"
-#: src/octoprint/plugins/softwareupdate/__init__.py:1048
-#: src/octoprint/server/views.py:589
+#: src/octoprint/plugins/softwareupdate/__init__.py:1050
+#: src/octoprint/server/views.py:599
#: src/octoprint/static/js/app/viewmodels/appearance.js:99
#: src/octoprint/static/js/app/viewmodels/appearance.js:104
#: src/octoprint/static/js/app/viewmodels/appearance.js:106
@@ -2198,7 +2198,7 @@ msgstr "Software Update"
msgid "OctoPrint"
msgstr "OctoPrint"
-#: src/octoprint/plugins/softwareupdate/__init__.py:1212
+#: src/octoprint/plugins/softwareupdate/__init__.py:1214
msgid ""
"Without this plugin OctoPrint will no longer be able to update itself or "
"any of your installed plugins which might put your system at risk."
@@ -2871,109 +2871,109 @@ msgstr ""
"target=\"_blank\" rel=\"noopener noreferrer\">Privacy Policy auf "
"tracking.octoprint.org.\n"
-#: src/octoprint/server/views.py:499
+#: src/octoprint/server/views.py:507
msgid "Plugins"
msgstr "Plugins"
-#: src/octoprint/server/views.py:556
+#: src/octoprint/server/views.py:566
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:12
msgid "Connection"
msgstr "Verbindung"
-#: src/octoprint/server/views.py:557
+#: src/octoprint/server/views.py:567
#: src/octoprint/templates/sidebar/state.jinja2:1
msgid "State"
msgstr "Status"
-#: src/octoprint/server/views.py:558
+#: src/octoprint/server/views.py:568
msgid "Files"
msgstr "Dateien"
-#: src/octoprint/server/views.py:564
+#: src/octoprint/server/views.py:574
msgid "Temperature"
msgstr "Temperatur"
-#: src/octoprint/server/views.py:565
+#: src/octoprint/server/views.py:575
msgid "Control"
msgstr "Steuerung"
-#: src/octoprint/server/views.py:566
+#: src/octoprint/server/views.py:576
msgid "GCode Viewer"
msgstr "GCode Viewer"
-#: src/octoprint/server/views.py:567
+#: src/octoprint/server/views.py:577
msgid "Terminal"
msgstr "Terminal"
-#: src/octoprint/server/views.py:568
+#: src/octoprint/server/views.py:578
#: src/octoprint/templates/sidebar/state.jinja2:8
msgid "Timelapse"
msgstr "Zeitraffer"
-#: src/octoprint/server/views.py:574
+#: src/octoprint/server/views.py:584
msgid "Printer"
msgstr "Drucker"
-#: src/octoprint/server/views.py:576
+#: src/octoprint/server/views.py:586
msgid "Serial Connection"
msgstr "Serielle Verbindung"
-#: src/octoprint/server/views.py:577
+#: src/octoprint/server/views.py:587
#: src/octoprint/templates/dialogs/settings/printerprofiles.jinja2:1
msgid "Printer Profiles"
msgstr "Druckerprofile"
-#: src/octoprint/server/views.py:578
+#: src/octoprint/server/views.py:588
msgid "Temperatures"
msgstr "Temperaturen"
-#: src/octoprint/server/views.py:579
+#: src/octoprint/server/views.py:589
msgid "Terminal Filters"
msgstr "Terminalfilter"
-#: src/octoprint/server/views.py:580
+#: src/octoprint/server/views.py:590
msgid "GCODE Scripts"
msgstr "GCODE Scripts"
-#: src/octoprint/server/views.py:582 src/octoprint/server/views.py:584
+#: src/octoprint/server/views.py:592 src/octoprint/server/views.py:594
msgid "Features"
msgstr "Funktionen"
-#: src/octoprint/server/views.py:586
+#: src/octoprint/server/views.py:596
msgid "GCODE Visualizer"
msgstr "GCode Viewer"
-#: src/octoprint/server/views.py:587
+#: src/octoprint/server/views.py:597
msgid "API"
msgstr "API"
-#: src/octoprint/server/views.py:592
+#: src/octoprint/server/views.py:602
#: src/octoprint/templates/dialogs/settings/folders.jinja2:2
#: src/octoprint/templates/sidebar/files_header.jinja2:10
msgid "Folders"
msgstr "Verzeichnisse"
-#: src/octoprint/server/views.py:593
+#: src/octoprint/server/views.py:603
msgid "Appearance"
msgstr "Aussehen"
-#: src/octoprint/server/views.py:594
+#: src/octoprint/server/views.py:604
msgid "Server"
msgstr "Server"
-#: src/octoprint/server/views.py:600
+#: src/octoprint/server/views.py:610
msgid "Access"
msgstr "Zugriff"
-#: src/octoprint/server/views.py:601
+#: src/octoprint/server/views.py:611
msgid "Interface"
msgstr "Interface"
-#: src/octoprint/server/views.py:617
+#: src/octoprint/server/views.py:627
msgid "Start"
msgstr "Start"
-#: src/octoprint/server/views.py:618
+#: src/octoprint/server/views.py:628
#: src/octoprint/templates/dialogs/wizard.jinja2:57
msgid "Finish"
msgstr "Beenden"
diff --git a/translations/messages.pot b/translations/messages.pot
index 97f6b7b52..b397d294d 100644
--- a/translations/messages.pot
+++ b/translations/messages.pot
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: OctoPrint 1.3.11rc2.dev18+g0b6dd7e76\n"
+"Project-Id-Version: OctoPrint 1.3.11rc3.dev25+g9775d99fe\n"
"Report-Msgid-Bugs-To: i18n@octoprint.org\n"
-"POT-Creation-Date: 2019-04-04 14:21+0200\n"
+"POT-Creation-Date: 2019-04-10 12:34+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -595,13 +595,13 @@ msgid "Server Commands"
msgstr ""
#: src/octoprint/plugins/corewizard/subwizards.py:49
-#: src/octoprint/server/views.py:585
+#: src/octoprint/server/views.py:595
msgid "Webcam & Timelapse"
msgstr ""
#: src/octoprint/plugins/corewizard/subwizards.py:64
#: src/octoprint/plugins/corewizard/templates/corewizard_acl_wizard.jinja2:1
-#: src/octoprint/server/views.py:591
+#: src/octoprint/server/views.py:601
msgid "Access Control"
msgstr ""
@@ -1002,7 +1002,7 @@ msgid ""
"discoverable on the network via Bonjour and uPnP."
msgstr ""
-#: src/octoprint/plugins/errortracking/__init__.py:39
+#: src/octoprint/plugins/errortracking/__init__.py:67
#: src/octoprint/plugins/errortracking/templates/errortracking_settings.jinja2:1
msgid "Error Tracking"
msgstr ""
@@ -1092,7 +1092,7 @@ msgid ""
"\n"
msgstr ""
-#: src/octoprint/plugins/forcelogin/__init__.py:189
+#: src/octoprint/plugins/forcelogin/__init__.py:190
msgid ""
"Without this plugin anonymous users will have read-only access to your "
"OctoPrint instance. Only disable this if you are comfortable with this, "
@@ -1841,25 +1841,25 @@ msgstr ""
msgid "Learn more..."
msgstr ""
-#: src/octoprint/plugins/softwareupdate/__init__.py:519
+#: src/octoprint/plugins/softwareupdate/__init__.py:521
msgid "Python"
msgstr ""
-#: src/octoprint/plugins/softwareupdate/__init__.py:520
+#: src/octoprint/plugins/softwareupdate/__init__.py:522
msgid "pip"
msgstr ""
-#: src/octoprint/plugins/softwareupdate/__init__.py:521
+#: src/octoprint/plugins/softwareupdate/__init__.py:523
msgid "setuptools"
msgstr ""
-#: src/octoprint/plugins/softwareupdate/__init__.py:608
+#: src/octoprint/plugins/softwareupdate/__init__.py:610
#: src/octoprint/plugins/softwareupdate/templates/softwareupdate_wizard.jinja2:1
msgid "Software Update"
msgstr ""
-#: src/octoprint/plugins/softwareupdate/__init__.py:1048
-#: src/octoprint/server/views.py:589
+#: src/octoprint/plugins/softwareupdate/__init__.py:1050
+#: src/octoprint/server/views.py:599
#: src/octoprint/static/js/app/viewmodels/appearance.js:99
#: src/octoprint/static/js/app/viewmodels/appearance.js:104
#: src/octoprint/static/js/app/viewmodels/appearance.js:106
@@ -1869,7 +1869,7 @@ msgstr ""
msgid "OctoPrint"
msgstr ""
-#: src/octoprint/plugins/softwareupdate/__init__.py:1212
+#: src/octoprint/plugins/softwareupdate/__init__.py:1214
msgid ""
"Without this plugin OctoPrint will no longer be able to update itself or "
"any of your installed plugins which might put your system at risk."
@@ -2410,109 +2410,109 @@ msgid ""
"tracking.octoprint.org.\n"
msgstr ""
-#: src/octoprint/server/views.py:499
+#: src/octoprint/server/views.py:507
msgid "Plugins"
msgstr ""
-#: src/octoprint/server/views.py:556
+#: src/octoprint/server/views.py:566
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:12
msgid "Connection"
msgstr ""
-#: src/octoprint/server/views.py:557
+#: src/octoprint/server/views.py:567
#: src/octoprint/templates/sidebar/state.jinja2:1
msgid "State"
msgstr ""
-#: src/octoprint/server/views.py:558
+#: src/octoprint/server/views.py:568
msgid "Files"
msgstr ""
-#: src/octoprint/server/views.py:564
+#: src/octoprint/server/views.py:574
msgid "Temperature"
msgstr ""
-#: src/octoprint/server/views.py:565
+#: src/octoprint/server/views.py:575
msgid "Control"
msgstr ""
-#: src/octoprint/server/views.py:566
+#: src/octoprint/server/views.py:576
msgid "GCode Viewer"
msgstr ""
-#: src/octoprint/server/views.py:567
+#: src/octoprint/server/views.py:577
msgid "Terminal"
msgstr ""
-#: src/octoprint/server/views.py:568
+#: src/octoprint/server/views.py:578
#: src/octoprint/templates/sidebar/state.jinja2:8
msgid "Timelapse"
msgstr ""
-#: src/octoprint/server/views.py:574
+#: src/octoprint/server/views.py:584
msgid "Printer"
msgstr ""
-#: src/octoprint/server/views.py:576
+#: src/octoprint/server/views.py:586
msgid "Serial Connection"
msgstr ""
-#: src/octoprint/server/views.py:577
+#: src/octoprint/server/views.py:587
#: src/octoprint/templates/dialogs/settings/printerprofiles.jinja2:1
msgid "Printer Profiles"
msgstr ""
-#: src/octoprint/server/views.py:578
+#: src/octoprint/server/views.py:588
msgid "Temperatures"
msgstr ""
-#: src/octoprint/server/views.py:579
+#: src/octoprint/server/views.py:589
msgid "Terminal Filters"
msgstr ""
-#: src/octoprint/server/views.py:580
+#: src/octoprint/server/views.py:590
msgid "GCODE Scripts"
msgstr ""
-#: src/octoprint/server/views.py:582 src/octoprint/server/views.py:584
+#: src/octoprint/server/views.py:592 src/octoprint/server/views.py:594
msgid "Features"
msgstr ""
-#: src/octoprint/server/views.py:586
+#: src/octoprint/server/views.py:596
msgid "GCODE Visualizer"
msgstr ""
-#: src/octoprint/server/views.py:587
+#: src/octoprint/server/views.py:597
msgid "API"
msgstr ""
-#: src/octoprint/server/views.py:592
+#: src/octoprint/server/views.py:602
#: src/octoprint/templates/dialogs/settings/folders.jinja2:2
#: src/octoprint/templates/sidebar/files_header.jinja2:10
msgid "Folders"
msgstr ""
-#: src/octoprint/server/views.py:593
+#: src/octoprint/server/views.py:603
msgid "Appearance"
msgstr ""
-#: src/octoprint/server/views.py:594
+#: src/octoprint/server/views.py:604
msgid "Server"
msgstr ""
-#: src/octoprint/server/views.py:600
+#: src/octoprint/server/views.py:610
msgid "Access"
msgstr ""
-#: src/octoprint/server/views.py:601
+#: src/octoprint/server/views.py:611
msgid "Interface"
msgstr ""
-#: src/octoprint/server/views.py:617
+#: src/octoprint/server/views.py:627
msgid "Start"
msgstr ""
-#: src/octoprint/server/views.py:618
+#: src/octoprint/server/views.py:628
#: src/octoprint/templates/dialogs/wizard.jinja2:57
msgid "Finish"
msgstr ""
From e2519abbbe34f4b6c07ad1ee97436715323ba154 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Thu, 11 Apr 2019 12:14:38 +0200
Subject: [PATCH 24/27] =?UTF-8?q?=E2=9C=A8=20Add=20setting=20for=20exclusi?=
=?UTF-8?q?ve=20comm=20port=20flag?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Just in case there are issues with that on some setups as first RC seem
to indicate, we make it toggleable.
---
src/octoprint/server/api/settings.py | 2 ++
src/octoprint/settings.py | 1 +
src/octoprint/static/js/app/viewmodels/settings.js | 1 +
.../dialogs/settings/serialconnection.jinja2 | 12 ++++++++++--
src/octoprint/util/comm.py | 6 ++++--
5 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/src/octoprint/server/api/settings.py b/src/octoprint/server/api/settings.py
index aba8bac41..757f7a51f 100644
--- a/src/octoprint/server/api/settings.py
+++ b/src/octoprint/server/api/settings.py
@@ -130,6 +130,7 @@ def getSettings():
"serial": {
"port": connectionOptions["portPreference"],
"baudrate": connectionOptions["baudratePreference"],
+ "exclusive": s.getBoolean(["serial", "exclusive"]),
"portOptions": connectionOptions["ports"],
"baudrateOptions": connectionOptions["baudrates"],
"autoconnect": s.getBoolean(["serial", "autoconnect"]),
@@ -419,6 +420,7 @@ def _saveSettings(data):
if "autoconnect" in data["serial"]: s.setBoolean(["serial", "autoconnect"], data["serial"]["autoconnect"])
if "port" in data["serial"]: s.set(["serial", "port"], data["serial"]["port"])
if "baudrate" in data["serial"]: s.setInt(["serial", "baudrate"], data["serial"]["baudrate"])
+ if "exclusive" in data["serial"]: s.setBoolean(["serial", "exclusive"], data["serial"]["exclusive"])
if "timeoutConnection" in data["serial"]: s.setFloat(["serial", "timeout", "connection"], data["serial"]["timeoutConnection"], min=1.0)
if "timeoutDetection" in data["serial"]: s.setFloat(["serial", "timeout", "detection"], data["serial"]["timeoutDetection"], min=1.0)
if "timeoutCommunication" in data["serial"]: s.setFloat(["serial", "timeout", "communication"], data["serial"]["timeoutCommunication"], min=1.0)
diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py
index 8f758c02a..0faba904b 100644
--- a/src/octoprint/settings.py
+++ b/src/octoprint/settings.py
@@ -88,6 +88,7 @@ default_settings = {
"serial": {
"port": None,
"baudrate": None,
+ "exclusive": True,
"autoconnect": False,
"log": False,
"timeout": {
diff --git a/src/octoprint/static/js/app/viewmodels/settings.js b/src/octoprint/static/js/app/viewmodels/settings.js
index 2645c72f1..ac5bfc7fe 100644
--- a/src/octoprint/static/js/app/viewmodels/settings.js
+++ b/src/octoprint/static/js/app/viewmodels/settings.js
@@ -149,6 +149,7 @@ $(function() {
self.serial_port = ko.observable();
self.serial_baudrate = ko.observable();
+ self.serial_exclusive = ko.observable();
self.serial_portOptions = ko.observableArray([]);
self.serial_baudrateOptions = ko.observableArray([]);
self.serial_autoconnect = ko.observable(undefined);
diff --git a/src/octoprint/templates/dialogs/settings/serialconnection.jinja2 b/src/octoprint/templates/dialogs/settings/serialconnection.jinja2
index 6eac21d49..4165f5bc7 100644
--- a/src/octoprint/templates/dialogs/settings/serialconnection.jinja2
+++ b/src/octoprint/templates/dialogs/settings/serialconnection.jinja2
@@ -8,7 +8,7 @@
-
+
+
+
+
+
-
+
diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py
index 8094cc705..f0075e5cb 100644
--- a/src/octoprint/util/comm.py
+++ b/src/octoprint/util/comm.py
@@ -2591,10 +2591,12 @@ class MachineCom(object):
"baudrate": baudrateList()[0] if baudrate == 0 else baudrate,
"timeout": read_timeout,
"write_timeout": 0,
- "parity": serial.PARITY_ODD,
- "exclusive": True
+ "parity": serial.PARITY_ODD
}
+ if settings().getBoolean(["serial", "exclusive"]):
+ serial_port_args["exclusive"] = True
+
serial_obj = serial.Serial(**serial_port_args)
serial_obj.close()
From d1104ddbae5b628bb1d6e81220d5d379421294fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Thu, 11 Apr 2019 12:14:59 +0200
Subject: [PATCH 25/27] =?UTF-8?q?=F0=9F=90=9B=20Fix=20file=20list=20refres?=
=?UTF-8?q?h=20after=20SD=20list=20update?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/octoprint/printer/standard.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/octoprint/printer/standard.py b/src/octoprint/printer/standard.py
index 420a0bf17..0854d399d 100644
--- a/src/octoprint/printer/standard.py
+++ b/src/octoprint/printer/standard.py
@@ -1130,7 +1130,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
self._stateMonitor.set_state(self._dict(text=self.get_state_string(), flags=self._getStateFlags()))
def on_comm_sd_files(self, files):
- eventManager().fire(Events.UPDATED_FILES, {"type": "gcode"})
+ eventManager().fire(Events.UPDATED_FILES, {"type": "printables"})
self._sdFilelistAvailable.set()
def on_comm_file_selected(self, full_path, size, sd, user=None):
From af3285854995fb5b910fd2ce869e26c02d57bbc2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Thu, 11 Apr 2019 12:21:24 +0200
Subject: [PATCH 26/27] =?UTF-8?q?=F0=9F=94=96=20Preparing=20release=20of?=
=?UTF-8?q?=201.3.11rc3,=20part=202?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
CHANGELOG.md | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0b093542f..957624ad4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,14 @@
## 1.3.11rc3 (2019-04-11)
+### Improvements
+
+ * Define empty `UI_API_KEY` for backwards compatibility with third party plugins
+ * Add config flag `server.ignoredIncompleteStartup` to override incomplete startup detection
+ * Hardening against errors triggered during print time estimation
+ * Introduce setting to disable exclusive claim on serial port. There might be issues with this out there in the field, so having the option to disable it is a good thing.
+ * Error Tracking: Further restriction of what gets tracked
+
### Bug fixes
* [#3105](https://github.com/foosel/OctoPrint/issues/3105) (regression) - Virtual printer: Fix an encoding issue
@@ -11,6 +19,7 @@
* [#3116](https://github.com/foosel/OctoPrint/issues/3116) - Fix potential division by zero
* Fix wrong textual representation of `STARTING` state
* Fix some potential encoding errors in the comm layer
+ * Fix for the file list in the UI not getting refreshed after an SD list refresh from the printer.
### Unreproduced issues
From c00fdbf73b60f00e479d02eb1c67204bc501814a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Thu, 11 Apr 2019 15:21:39 +0200
Subject: [PATCH 27/27] =?UTF-8?q?=F0=9F=94=96=20staging/maintenance=20is?=
=?UTF-8?q?=20now=201.3.11rc4.dev?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.versioneer-lookup | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.versioneer-lookup b/.versioneer-lookup
index b2236eb28..d6dea408a 100644
--- a/.versioneer-lookup
+++ b/.versioneer-lookup
@@ -24,10 +24,10 @@ maintenance 1.3.11 e14c00f135bf2a955e54ac3f0a2928d8440055d2 pep440-dev
fix/.* 1.3.11 e14c00f135bf2a955e54ac3f0a2928d8440055d2 pep440-dev
improve/.* 1.3.11 e14c00f135bf2a955e54ac3f0a2928d8440055d2 pep440-dev
-# staging/maintenance is currently the branch for preparation of 1.3.11rc3
+# staging/maintenance is currently the branch for preparation of 1.3.11rc4
# so is regressionfix/...
-staging/maintenance 1.3.11rc3 18e7d2b72ad73c5d8e522cebbc001d0e8a3dff14 pep440-dev
-regressionfix/.* 1.3.11rc3 18e7d2b72ad73c5d8e522cebbc001d0e8a3dff14 pep440-dev
+staging/maintenance 1.3.11rc4 af3285854995fb5b910fd2ce869e26c02d57bbc2 pep440-dev
+regressionfix/.* 1.3.11rc4 af3285854995fb5b910fd2ce869e26c02d57bbc2 pep440-dev
# every other branch is a development branch and thus gets resolved to 1.4.0-dev for now
.* 1.4.0 7f5d03d0549bcbd26f40e7e4a3297ea5204fb1cc pep440-dev