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

v3: Config file filtering: go deeper into -instances elements before starting up #27

Closed
gits7r opened this issue Apr 16, 2020 · 2 comments

Comments

@gits7r
Copy link
Contributor

gits7r commented Apr 16, 2020

Right now, if onionbalance is missing - instances from the config file, it will correctly exit:

[WARNING]: Initializing onionbalance (version: 0.1.9+14.g5864dfc)...
[ERROR]: Config file is bad. 'instances' is missing. Did you make it with onionbalance-config?

But in case we have - instances set, but no data under it (no address / name parameters) it won't exit with an "[ERROR] Config file is bad. No backend instances are set. Onionbalance needs at least 1". instead:

Traceback (most recent call last):
File "/usr/local/bin/onionbalance", line 11, in
load_entry_point('OnionBalance==0.1.9+14.g5864dfc', 'console_scripts', 'onionbalance')()
File "/usr/local/lib/python3.7/dist-packages/OnionBalance-0.1.9+14.g5864dfc-py3.7.egg/onionbalance/manager.py", line 31, in main
File "/usr/local/lib/python3.7/dist-packages/OnionBalance-0.1.9+14.g5864dfc-py3.7.egg/onionbalance/hs_v3/manager.py", line 27, in main
File "/usr/local/lib/python3.7/dist-packages/OnionBalance-0.1.9+14.g5864dfc-py3.7.egg/onionbalance/hs_v3/onionbalance.py", line 42, in init_subsystems
File "/usr/local/lib/python3.7/dist-packages/OnionBalance-0.1.9+14.g5864dfc-py3.7.egg/onionbalance/hs_v3/onionbalance.py", line 95, in load_config_file
TypeError: 'NoneType' object is not iterable

@asn-d6
Copy link
Member

asn-d6 commented Apr 21, 2020

Should be fixed in 11749d0! Thanks!

@asn-d6 asn-d6 closed this as completed Apr 21, 2020
@gits7r
Copy link
Contributor Author

gits7r commented Apr 21, 2020

It's much better, but you set address: with no invalid v3 hostname, or string that does not end with .onion, in fact just enter:

- address:
and nothing more. It will return:
Traceback (most recent call last):
File "/usr/local/bin/onionbalance", line 11, in
load_entry_point('OnionBalance==0.1.9+30.g0dabbd1', 'console_scripts', 'onionbalance')()
File "/usr/local/lib/python3.7/dist-packages/OnionBalance-0.1.9+30.g0dabbd1-py3.7.egg/onionbalance/manager.py", line 31, in main
File "/usr/local/lib/python3.7/dist-packages/OnionBalance-0.1.9+30.g0dabbd1-py3.7.egg/onionbalance/hs_v3/manager.py", line 27, in main
File "/usr/local/lib/python3.7/dist-packages/OnionBalance-0.1.9+30.g0dabbd1-py3.7.egg/onionbalance/hs_v3/onionbalance.py", line 42, in init_subsystems
File "/usr/local/lib/python3.7/dist-packages/OnionBalance-0.1.9+30.g0dabbd1-py3.7.egg/onionbalance/hs_v3/onionbalance.py", line 106, in load_config_file
File "/usr/local/lib/python3.7/dist-packages/stem-1.8.0-py3.7.egg/stem/descriptor/hidden_service.py", line 1141, in identity_key_from_address
if onion_address.endswith('.onion'):
AttributeError: 'NoneType' object has no attribute 'endswith'

While we would expect:
[ERROR]: Config file is bad. No backend instances are set. Onionbalance needs at least 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants