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

Etcd storehouse backend not working #63

Open
italovalcy opened this issue Dec 4, 2020 · 0 comments
Open

Etcd storehouse backend not working #63

italovalcy opened this issue Dec 4, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@italovalcy
Copy link

Hi,

I'm trying to use the the Etcd storehouse backend by the following steps:

  1. Use the Kytos/nightly docker image

  2. After start the container:

apt-get update && apt-get install etcd-server etcd-client && service etcd start

sed -i 's/BACKEND = "filesystem"/BACKEND = "etcd"/g' /var/lib/kytos/napps/kytos/storehouse/settings.py

kytosd -E

Just after starting Kytos we have some errors on the log:

Nov 12 21:11:55 d7cc32bbe40d kytos.napps.kytos/storehouse:ERROR main:182:  Bad callback function <bound method StoreHouse._get_or_create_a_box_from_list_of_boxes of <napps.kytos.mef_eline.storehouse.StoreHouse object at 0x7faeac31c5c0>>!
Nov 12 21:11:55 d7cc32bbe40d kytos.napps.kytos/storehouse:ERROR main:182:  Bad callback function <bound method Main.request_retrieve_entities of <Main(topology, stopped 140387805136640)>>!
Nov 12 21:11:55 d7cc32bbe40d kytos.napps.kytos/storehouse:ERROR main:183:  'generator' object is not subscriptable
Nov 12 21:11:55 d7cc32bbe40d kytos.napps.kytos/storehouse:ERROR main:183:  'generator' object is not subscriptable
Nov 12 21:11:55 d7cc32bbe40d kytos.napps.kytos/storehouse:ERROR main:182:  Bad callback function <bound method Main.request_retrieve_entities of <Main(topology, stopped 140387805136640)>>!
Nov 12 21:11:55 d7cc32bbe40d kytos.napps.kytos/storehouse:ERROR main:183:  'generator' object is not subscriptable
Nov 12 21:11:55 d7cc32bbe40d kytos.napps.kytos/storehouse:ERROR main:182:  Bad callback function <bound method Main.request_retrieve_entities of <Main(topology, stopped 140387805136640)>>!
Nov 12 21:11:55 d7cc32bbe40d kytos.napps.kytos/storehouse:ERROR main:182:  Bad callback function <bound method StoreHouse._get_or_create_a_box_from_list_of_boxes of <napps.kytos.topology.storehouse.StoreHouse object at 0x7faeb1d62208>>!
Nov 12 21:11:55 d7cc32bbe40d kytos.napps.kytos/storehouse:ERROR main:183:  'generator' object is not subscriptable
Nov 12 21:11:55 d7cc32bbe40d kytos.napps.kytos/storehouse:ERROR main:183:  'generator' object is not subscriptable

If you ignore those erros and go ahead to actually use Kytos ("use Kytos" here means create an EVC in mef_eline napp, but I suppose this will happens for any other usage):

prompt$ curl -s -X POST -d '{"name": "my evc3 100","enabled": true,"dynamic_backup_path":true, "uni_a": { "interface_id": "00:00:00:00:00:00:00:01:1", "tag": {"tag_type":1, "value": 200} }, "uni_z": {"interface_id": "00:00:00:00:00:00:00:02:1", "tag": {"tag_type":1, "value": 200}}}' http://$KYTOS_IP:8181/api/kytos/mef_eline/v2/evc/ -H "Content-Type: application/json"

{"code":500,"description":"The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.","name":"Internal Server Error"}

In the server logs:

Nov 12 21:13:35 d7cc32bbe40d kytos.core.controller:ERROR app:1892:  Exception on /api/kytos/mef_eline/v2/evc/ [POST]
Nov 12 21:13:35 d7cc32bbe40d Traceback (most recent call last):
Nov 12 21:13:35 d7cc32bbe40d File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 2447, in wsgi_app
Nov 12 21:13:35 d7cc32bbe40d response = self.full_dispatch_request()
Nov 12 21:13:35 d7cc32bbe40d File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1952, in full_dispatch_request
Nov 12 21:13:35 d7cc32bbe40d rv = self.handle_user_exception(e)
Nov 12 21:13:35 d7cc32bbe40d File "/usr/local/lib/python3.6/dist-packages/flask_cors/extension.py", line 161, in wrapped_function
Nov 12 21:13:35 d7cc32bbe40d return cors_after_request(app.make_response(f(*args, **kwargs)))
Nov 12 21:13:35 d7cc32bbe40d File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1821, in handle_user_exception
Nov 12 21:13:35 d7cc32bbe40d reraise(exc_type, exc_value, tb)
Nov 12 21:13:35 d7cc32bbe40d File "/usr/local/lib/python3.6/dist-packages/flask/_compat.py", line 39, in reraise
Nov 12 21:13:35 d7cc32bbe40d raise value
Nov 12 21:13:35 d7cc32bbe40d File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1950, in full_dispatch_request
Nov 12 21:13:35 d7cc32bbe40d rv = self.dispatch_request()
Nov 12 21:13:35 d7cc32bbe40d File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1936, in dispatch_request
Nov 12 21:13:35 d7cc32bbe40d return self.view_functions[rule.endpoint](**req.view_args)
Nov 12 21:13:35 d7cc32bbe40d File "//var/lib/kytos/napps/kytos/mef_eline/main.py", line 148, in create_circuit
Nov 12 21:13:35 d7cc32bbe40d self.storehouse.save_evc(evc)
Nov 12 21:13:35 d7cc32bbe40d File "//var/lib/kytos/napps/../napps/kytos/mef_eline/storehouse.py", line 89, in save_evc
Nov 12 21:13:35 d7cc32bbe40d self.box.data[evc.id] = evc.as_dict()
Nov 12 21:13:35 d7cc32bbe40d AttributeError: 'NoneType' object has no attribute 'data'
Nov 12 21:13:35 d7cc32bbe40d kytos.napps.kytos/storehouse:ERROR main:182:  Bad callback function <bound method StoreHouse._get_or_create_a_box_from_list_of_boxes of <napps.kytos.mef_eline.storehouse.StoreHouse object at 0x7faeac31c5c0>>!
Nov 12 21:13:35 d7cc32bbe40d kytos.napps.kytos/storehouse:ERROR main:183:  'generator' object is not subscriptable
Nov 12 21:13:35 d7cc32bbe40d kytos.napps.kytos/storehouse:ERROR main:182:  Bad callback function <bound method StoreHouse._get_or_create_a_box_from_list_of_boxes of <napps.kytos.mef_eline.storehouse.StoreHouse object at 0x7faeac31c5c0>>!
Nov 12 21:13:35 d7cc32bbe40d kytos.napps.kytos/storehouse:ERROR main:183:  'generator' object is not subscriptable

I guess the problem starts since this error at the beginning:

kytos.napps.kytos/storehouse:ERROR main:182:  Bad callback function <bound method StoreHouse._get_or_create_a_box_from_list_of_boxes of <napps.kytos.mef_eline.storehouse.StoreHouse object at 0x7faeac31c5c0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants