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

Unable to add peer #99

Open
Cyber-Ard opened this issue May 13, 2021 · 2 comments
Open

Unable to add peer #99

Cyber-Ard opened this issue May 13, 2021 · 2 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@Cyber-Ard
Copy link

Describe the bug

Unable to add peer

To Reproduce
Steps to reproduce the behavior:

Click on 'Add peer to wg0'

Platform:

  • OS: Docker version 20.10.6, build 370c289 on Ubuntu 20.04.2 LTS
  • Browser: Chrome / Edge (both v90)

Screenshot:

Screenshot 2021-05-13 192304

Stacktrace/error output:

today at 7:15:58 PM Exception in ASGI application
today at 7:15:58 PM Traceback (most recent call last):
today at 7:15:58 PM File "/usr/lib/python3/dist-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
today at 7:15:58 PM result = await app(self.scope, self.receive, self.send)
today at 7:15:58 PM File "/usr/lib/python3/dist-packages/uvicorn/middleware/proxy_headers.py", line 45, in call
today at 7:15:58 PM return await self.app(scope, receive, send)
today at 7:15:58 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/applications.py", line 199, in call
today at 7:15:58 PM await super().call(scope, receive, send)
today at 7:15:58 PM File "/usr/local/lib/python3.8/dist-packages/starlette/applications.py", line 111, in call
today at 7:15:58 PM await self.middleware_stack(scope, receive, send)
today at 7:15:58 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 181, in call
today at 7:15:58 PM raise exc from None
today at 7:15:58 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 159, in call
today at 7:15:58 PM await self.app(scope, receive, _send)
today at 7:15:58 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 25, in call
today at 7:15:58 PM response = await self.dispatch_func(request, self.call_next)
today at 7:15:58 PM File "/app/middleware.py", line 35, in db_session_middleware
today at 7:15:58 PM response = await call_next(request)
today at 7:15:58 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 45, in call_next
today at 7:15:58 PM task.result()
today at 7:15:58 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 38, in coro
today at 7:15:58 PM await self.app(scope, receive, send)
today at 7:15:58 PM File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 82, in call
today at 7:15:58 PM raise exc from None
today at 7:15:58 PM File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 71, in call
today at 7:15:58 PM await self.app(scope, receive, sender)
today at 7:15:58 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 566, in call
today at 7:15:58 PM await route.handle(scope, receive, send)
today at 7:15:58 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 227, in handle
today at 7:15:58 PM await self.app(scope, receive, send)
today at 7:15:58 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 41, in app
today at 7:15:58 PM response = await func(request)
today at 7:15:58 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 201, in app
today at 7:15:58 PM raw_response = await run_endpoint_function(
today at 7:15:58 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 150, in run_endpoint_function
today at 7:15:58 PM return await run_in_threadpool(dependant.call, **values)
today at 7:15:58 PM File "/usr/local/lib/python3.8/dist-packages/starlette/concurrency.py", line 34, in run_in_threadpool
today at 7:15:58 PM return await loop.run_in_executor(None, func, *args)
today at 7:15:58 PM File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
today at 7:15:58 PM result = self.fn(*self.args, **self.kwargs)
today at 7:15:58 PM File "/app/routers/v1/peer.py", line 60, in add_peer
today at 7:15:58 PM peer.address = generate_ip_address(server, v6=False)
today at 7:15:58 PM File "/app/routers/v1/peer.py", line 43, in generate_ip_address
today at 7:15:58 PM return str(list(sorted(address_space)).pop(0))
today at 7:15:58 PM IndexError: pop from empty list

@Cyber-Ard Cyber-Ard added the bug Something isn't working label May 13, 2021
@alotofshit
Copy link

can you show server config?

@perara
Copy link
Owner

perara commented Jun 30, 2021

Which IP address are you trying to assign. If the server has the /32 subnet, I would imagine that this error can occur. Surely this is something that we should improve!

@perara perara added the enhancement New feature or request label Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants