Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config['ups'] gets set to 'null' #12

Open
kantlivelong opened this issue Mar 18, 2022 · 11 comments
Open

config['ups'] gets set to 'null' #12

kantlivelong opened this issue Mar 18, 2022 · 11 comments
Labels
bug Something isn't working solved

Comments

@kantlivelong
Copy link
Owner

Not sure where or why this happens yet but...

022-03-17 20:44:26,381 - octoprint.plugins.ups - ERROR - An exception occurred while getting vars info
Traceback (most recent call last):
File "/home/pi/.octoprint/plugins/ups/init.py", line 132, in _loop
vars = self.ups.list_vars(ups=self.config['ups'])
File "/home/pi/oprint/lib/python3.7/site-packages/nut2.py", line 157, in list_vars
self._srv_handler.write(b"LIST VAR %s\n" % ups.encode('utf-8'))
AttributeError: 'NoneType' object has no attribute 'encode'

config yaml shows ups is 'null'. Opening settings. selecting the ups again, and saving works around for a short while until it happens again.

@kantlivelong kantlivelong added the bug Something isn't working label Mar 18, 2022
@kantlivelong
Copy link
Owner Author

So far I can't replicate it on demand. If anyone is able to please provide.

@kantlivelong
Copy link
Owner Author

I think I see what's happening. Normally this shouldn't happen (obviously) but in some cases a response may not be received when requesting the UPS list during showing the settings window. Since we don't need to get the list every time we open the window I've adjusted to set the list options to the current value on load then grab the list when clicking the dropdown or the refresh button.

@InoSiX would you be willing to test this version?

https://github.com/kantlivelong/OctoPrint-UPS/archive/6a1769f1e4a556c488a4eafba698c71cb39ba232.zip

@kantlivelong
Copy link
Owner Author

This is fixed with 5d4cec9 and will be in the next release.

@InoSiX
Copy link

InoSiX commented Apr 14, 2022

I'm so sorry, @kantlivelong I failed to pay attention to my emails/this issue. I would have loved to be part of the solution. I'll try the update here soon. Thank you for following up.

@kantlivelong
Copy link
Owner Author

All good. The changrs in devel should do the trick.

@InoSiX
Copy link

InoSiX commented Apr 14, 2022

Maybe I misread your post, I thought I read you fixed it in an upcoming release but no update is available on the plugin manager. How do I go about installing your zip to assist you? I reenabled the plugin and it is currently disconnected (although it is configured as far as I can tell).

@kantlivelong
Copy link
Owner Author

Use the zip link above in plugin manager where the option is available to install from URL.

@InoSiX
Copy link

InoSiX commented Apr 14, 2022

I have successfully updated using your zip link. It wasn't connected immediately and I had to open the options page and select the UPS again. Once I did, however, it is connected.

I will monitor the log to make sure it doesn't inflate again.

@edalquist
Copy link

Fixes the issue for me as well, any chance this can get pushed into an actual release?

@kantlivelong
Copy link
Owner Author

I'm hoping to do some work on this plugin soon ™️ and get a release out.

@SCH00N3R
Copy link

SCH00N3R commented Sep 21, 2024

This patch confirmed worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working solved
Projects
None yet
Development

No branches or pull requests

4 participants