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

Sometimes exchange_view() raises an IndexError exception #12

Open
robzenn92 opened this issue Dec 13, 2017 · 0 comments
Open

Sometimes exchange_view() raises an IndexError exception #12

robzenn92 opened this issue Dec 13, 2017 · 0 comments
Labels

Comments

@robzenn92
Copy link
Owner

The exception is the following:

Internal Server Error: /exchange-view
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 128, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/src/cyclon_project/api/views.py", line 102, in exchange_view
    cyclon.partialView.merge(to_send, received_partial_view)
  File "/usr/src/partialView/partialView.py", line 131, in merge
    self.remove_peer(can_be_replaced[i - how_many])
IndexError: list index out of range
[2017-12-13,17:22:00.424 - ERROR] exception.py:118 | handle_uncaught_exception - Internal Server Error: /exchange-view
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 128, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/src/cyclon_project/api/views.py", line 102, in exchange_view
    cyclon.partialView.merge(to_send, received_partial_view)
  File "/usr/src/partialView/partialView.py", line 131, in merge
    self.remove_peer(can_be_replaced[i - how_many])
IndexError: list index out of range

More info in the following stack trace.

[2017-12-13,17:21:58.446 - INFO] cyclon.py:78 | shuffle_partial_view - My partialView:
{'ip': '172.17.0.6', 'limit': 2, 'peer_list': [{'age': 1, 'ip': '172.17.0.9'}, {'age': 1, 'ip': '172.17.0.5'}], 'shuffle_length': 2, 'size': 2}
[2017-12-13,17:21:58.447 - INFO] cyclon.py:81 | shuffle_partial_view - Selected oldest: 172.17.0.9
[2017-12-13,17:21:58.447 - INFO] cyclon.py:84 | shuffle_partial_view - Selected neighbors:
{'ip': '172.17.0.6', 'limit': 2, 'peer_list': [{'age': 1, 'ip': '172.17.0.5'}], 'shuffle_length': 2, 'size': 1}
[2017-12-13,17:21:58.447 - INFO] cyclon.py:87 | shuffle_partial_view - Selected neighbors + myself (will be sent to 172.17.0.9):
{'ip': '172.17.0.6', 'limit': 2, 'peer_list': [{'age': 1, 'ip': '172.17.0.5'}, {'age': 0, 'ip': '172.17.0.6'}], 'shuffle_length': 2, 'size': 2}
[2017-12-13,17:21:58.447 - INFO] cyclon.py:110 | send_message - I am sending Message:
{'source': 'http://172.17.0.6:5000', 'destination': 'http://172.17.0.9:5000', 'data': {'ip': '172.17.0.6', 'limit': 2, 'peer_list': [{'age': 1, 'ip': '172.17.0.5'}, {'age': 0, 'ip': '172.17.0.6'}], 'shuffle_length': 2, 'size': 2}}
[2017-12-13,17:21:58.452 - INFO] cyclon.py:112 | send_message - I got the following response:
<Response [200]>
[2017-12-13,17:21:58.453 - INFO] cyclon.py:94 | shuffle_partial_view - I received (from 172.17.0.9):
{'ip': '172.17.0.9', 'limit': 1, 'peer_list': [{'age': 1, 'ip': '172.17.0.8'}], 'shuffle_length': 1, 'size': 1}
[2017-12-13,17:21:58.453 - INFO] cyclon.py:98 | shuffle_partial_view - My partialView after removing oldest:
{'ip': '172.17.0.6', 'limit': 2, 'peer_list': [{'age': 1, 'ip': '172.17.0.5'}], 'shuffle_length': 2, 'size': 1}
[2017-12-13,17:21:58.453 - INFO] cyclon.py:102 | shuffle_partial_view - My partialView after merging:
{'ip': '172.17.0.6', 'limit': 2, 'peer_list': [{'age': 1, 'ip': '172.17.0.5'}, {'age': 1, 'ip': '172.17.0.8'}], 'shuffle_length': 2, 'size': 2}
[2017-12-13,17:21:58.453 - INFO] base.py:135 | run_job - Job "Cyclon.shuffle_partial_view (trigger: interval[0:00:15], next run at: 2017-12-13 17:22:13 CET)" executed successfully
[2017-12-13,17:21:59.753 - INFO] views.py:75 | get_k_view - {'ip': '172.17.0.6', 'limit': 2, 'peer_list': [{'age': 1, 'ip': '172.17.0.5'}, {'age': 1, 'ip': '172.17.0.8'}], 'shuffle_length': 2, 'size': 2}
[2017-12-13,17:22:00.424 - INFO] views.py:90 | exchange_view - My view before the exchange is:
{'ip': '172.17.0.6', 'limit': 2, 'peer_list': [{'age': 1, 'ip': '172.17.0.8'}], 'shuffle_length': 2, 'size': 1}
[2017-12-13,17:22:00.424 - INFO] views.py:95 | exchange_view - I got (from http://172.17.0.7:5000) the following:
{'ip': '172.17.0.7', 'limit': 3, 'peer_list': [{'age': 1, 'ip': '172.17.0.2'}, {'age': 2, 'ip': '172.17.0.8'}, {'age': 0, 'ip': '172.17.0.7'}], 'shuffle_length': 3, 'size': 3}
[2017-12-13,17:22:00.424 - INFO] views.py:99 | exchange_view - I will send (to http://172.17.0.7:5000) the following:
{'ip': '172.17.0.6', 'limit': 1, 'peer_list': [{'age': 1, 'ip': '172.17.0.8'}], 'shuffle_length': 1, 'size': 1}.
Internal Server Error: /exchange-view
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 128, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/src/cyclon_project/api/views.py", line 102, in exchange_view
    cyclon.partialView.merge(to_send, received_partial_view)
  File "/usr/src/partialView/partialView.py", line 131, in merge
    self.remove_peer(can_be_replaced[i - how_many])
IndexError: list index out of range
[2017-12-13,17:22:00.424 - ERROR] exception.py:118 | handle_uncaught_exception - Internal Server Error: /exchange-view
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 128, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/src/cyclon_project/api/views.py", line 102, in exchange_view
    cyclon.partialView.merge(to_send, received_partial_view)
  File "/usr/src/partialView/partialView.py", line 131, in merge
    self.remove_peer(can_be_replaced[i - how_many])
IndexError: list index out of range
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant