-
-
Notifications
You must be signed in to change notification settings - Fork 411
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
Opsdroid logger returning errors #1429
Comments
I've hit the same error, when enabling logging as defined in the default configuration sourced from https://raw.githubusercontent.com/opsdroid/opsdroid/master/opsdroid/configuration/example_configuration.yaml. The block that triggers the error is: logging:
level: info
path: opsdroid.log
console: true
extended: false
filter:
whitelist:
- opsdroid.core
blacklist:
- opsdroid.loader The error message is as follows opsdroid start -f /opt/opsdroid/configuration.yaml
Traceback (most recent call last):
File "/opt/opsdroid/bin/opsdroid", line 8, in <module>
sys.exit(cli())
File "/opt/opsdroid/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/opt/opsdroid/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/opt/opsdroid/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/opt/opsdroid/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/opt/opsdroid/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/opt/opsdroid/lib/python3.7/site-packages/opsdroid/cli/start.py", line 38, in start
configure_logging(config)
File "/opt/opsdroid/lib/python3.7/site-packages/opsdroid/logging.py", line 93, in configure_logging
console_handler.setFormatter(formatter)
UnboundLocalError: local variable 'formatter' referenced before assignment Version
|
@nzlosh where you able to fix this? Did you try |
@nzlosh this issue appears to be logging related. The |
Hello @Gideon357 and @nzlosh Thank you for raising this issue and I'd like to apologise for the troubles you are having with opsdroid. Just out of curiosity are you setting your logging with the I might have botched up something while creating the extended filter. I'm going to work on this issue tomorrow and hopefully fix it. |
@FabioRosado thanks for responding. I was using the default configuration that I generated using logging:
level: info
path: opsdroid.log
console: true
extended: false
filter:
whitelist:
- opsdroid.core
blacklist:
- opsdroid.loader |
Hello @Gideon357 I've just submitted a PR to hopefully fix the issues you are having with opsdroid. Looking at the code I'm not sure why you were getting that exception, but decided to move the normal formatter outside the try/except block so hopefully this fix will work for you. We are having a bit of trouble with Travis reporting the status to github, so I'll try to get this PR merged as soon as possible. Feel free to test the fix on your end until we get this merged and patch opsdroid 😄 👍 |
Gideon, cadair have merged the PR so hopefully this fixes the issue. We will need to do a release/patch if you are using opsdroid installed from pip you might need to wait a bit. Unless you want to clone the repo and test it from the dev version 👍 |
Thank you @FabioRosado and @Cadair. When will this release come out. It seems like an important patch. |
Hello @Gideon357 thank you for the message, Jacob just released the latest opsdroid version yesterday night. If you update your opsdroid version the fix should be there. Please let us know if you get the same or any other issues 😄 |
Description
Hi, I have been using
opsdroid
for a few days now, and while it is a good framework, I have been having a lot of trouble. Most recently I have been getting a errorformatter refrenced before use
. I have linted my configuration.yaml and none of my python files have errors. The error message below only shows errors in opsdroid library files. Even so, I am probably doing something wrong. Any help is greatly appreciated!Steps to Reproduce
I just linted and built my config. Neither of those actions returned errors.
Expected Functionality
My bot should have run on Telegram and in bash.
Experienced Functionality
Versions
Configuration File
My config.yaml is to large to include, but this is the only line I've change from the example (other than adding tokens)
Again, that file returns no errors when I run
opsdroid config -f [PATH] lint
oropsdroid config -f [PATH] build
.Additionally, the python file:
My directory structure (/home for WSL, not windows):
Additional Details
Interestingly, my bot worked fine with the example config
Any help is much appreciated!
The text was updated successfully, but these errors were encountered: