perara / wg-manager

A easy to use WireGuard dashboard and management tool
MIT License
594 stars 74 forks source link

Errors after restarting container #39

Open laemm-line opened 3 years ago

laemm-line commented 3 years ago

I had a working setup via docker-compose. After I restarted the container via docker-compose up -d the Dashboard fails to load, the HTTP call to /api/v1/server/all returns error 500. And a previously working connection from a peer does not work anymore.

In the docker logs I can see the following error when I try to access the Dashboard:

wg-manager   | [2020-10-02 19:24:17 +0000] [8] [ERROR] Exception in ASGI application
wg-manager   | Traceback (most recent call last):
wg-manager   |   File "/usr/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
wg-manager   |     result = await app(self.scope, self.receive, self.send)
wg-manager   |   File "/usr/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
wg-manager   |     return await self.app(scope, receive, send)
wg-manager   |   File "/usr/lib/python3.8/site-packages/fastapi/applications.py", line 146, in __call__
wg-manager   |     await super().__call__(scope, receive, send)
wg-manager   |   File "/usr/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
wg-manager   |     await self.middleware_stack(scope, receive, send)
wg-manager   |   File "/usr/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
wg-manager   |     raise exc from None
wg-manager   |   File "/usr/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
wg-manager   |     await self.app(scope, receive, _send)
wg-manager   |   File "/usr/lib/python3.8/site-packages/starlette/middleware/base.py", line 25, in __call__
wg-manager   |     response = await self.dispatch_func(request, self.call_next)
wg-manager   |   File "/app/middleware.py", line 34, in db_session_middleware
wg-manager   |     response = await call_next(request)
wg-manager   |   File "/usr/lib/python3.8/site-packages/starlette/middleware/base.py", line 45, in call_next
wg-manager   |     task.result()
wg-manager   |   File "/usr/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
wg-manager   |     await self.app(scope, receive, send)
wg-manager   |   File "/usr/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
wg-manager   |     raise exc from None
wg-manager   |   File "/usr/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
wg-manager   |     await self.app(scope, receive, sender)
wg-manager   |   File "/usr/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
wg-manager   |     await route.handle(scope, receive, send)
wg-manager   |   File "/usr/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
wg-manager   |     await self.app(scope, receive, send)
wg-manager   |   File "/usr/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
wg-manager   |     response = await func(request)
wg-manager   |   File "/usr/lib/python3.8/site-packages/fastapi/routing.py", line 196, in app
wg-manager   |     raw_response = await run_endpoint_function(
wg-manager   |   File "/usr/lib/python3.8/site-packages/fastapi/routing.py", line 150, in run_endpoint_function
wg-manager   |     return await run_in_threadpool(dependant.call, **values)
wg-manager   |   File "/usr/lib/python3.8/site-packages/starlette/concurrency.py", line 34, in run_in_threadpool
wg-manager   |     return await loop.run_in_executor(None, func, *args)
wg-manager   |   File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
wg-manager   |     result = self.fn(*self.args, **self.kwargs)
wg-manager   |   File "/app/routers/v1/server.py", line 25, in servers_all
wg-manager   |     iface.is_running = script.wireguard.is_running(iface)
wg-manager   |   File "/app/script/wireguard.py", line 114, in is_running
wg-manager   |     if b'No such device' in e.output:
wg-manager   | AttributeError: 'WGPermissionsError' object has no attribute 'output'
matzeeg3 commented 2 years ago

a solution availible?