UPS Plugin - Does not see UPS until I save plugin config

What is the problem?

When I start OctoPrint, the UPS plugin status is blank. journalctl shows the following error spamming once or twice per second:

octoprint[793]: 2024-09-20 11:31:45,697 - octoprint.plugins.ups - ERROR - An exception occurred while getting vars info
octoprint[793]: Traceback (most recent call last):
octoprint[793]: File "/home/schooner/OctoPrint/venv/lib/python3.11/site-packages/octoprint_ups/init.py", line 132, in _loop
octoprint[793]: vars = self.ups.list_vars(ups=self.config['ups'])
octoprint[793]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
octoprint[793]: File "/home/schooner/OctoPrint/venv/lib/python3.11/site-packages/nut2.py", line 157, in list_vars
octoprint[793]: self._srv_handler.write(b"LIST VAR %s\n" % ups.encode('utf-8'))
octoprint[793]: ^^^^^^^^^^
octoprint[793]: AttributeError: 'NoneType' object has no attribute 'encode'

What did you already try to solve it?

I go into the plugin settings for UPS, click save. No config change required. This fixes the issue. Afterward I see this in the journal log:

octoprint.plugins.ups - INFO - Connection information changed.

Afterward the errors stop and the UPS icon in the status bar updates with correct info.

Have you tried running in safe mode?

N/A

Did running in safe mode solve the problem?

N/A\

Systeminfo Bundle

Please let me know if this is needed and I will provide.

Additional information about your setup

OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible

Latest Octoprint, latest RaspbianOS (64bit). All packages up to date.

Hopefully you've reported on the plugin's GitHub repo issue tracker already so @kantlivelong can be aware.

Seems like it's the same as this issue: https://github.com/kantlivelong/OctoPrint-UPS/issues/12 and should be fixed but not released yet maybe?

You could try installing the fixed version by copying/pasting this URL into Plugin Manager ? Get More > ...from URL and clicking install...

https://github.com/kantlivelong/OctoPrint-UPS/archive/refs/heads/devel.zip

Thank you @jneilliii , I will cross-post there. I did many googles on this but I didn't come across the articles you mentioned. I will give them a read.

Thanks again!