can not login bygithub,myhost:8080/internal/user return 401
McDonald755 opened this issue · 3 comments
I installed the documentation deployment and started it successfully. When I visit "myhost:8080", it can correctly prompt me to log in. But when I click login via girhub. It went back to his home page.(http://myhost:8080/login/github?code=xxxx&state=xxxx) and tell me {"error": "Server Error (500)"}./internal/user always 401
codecov.yml
`setup:
codecov_url: https://myhost:8080
enterprise_license: "F5O0Fu5ASFTPtWXM51BK8YQlq7IM2s+8TBGULrf9Um7wHjfPwI+Z3E4PfF/dPs6Uc5A+MLti+2etHq5dnFEfZgoiIVCLZ8x+0BVmUSWwPS42vJXnf1veY9Bglang4mDIhmfWfp5l6AT6cxmAVFpGrwobiK6OcN9pjWx4iWabazmsOiF9LM++v0WtuHNvhgzRcKmnJPgqahEB7qqF6KQ1hg=="
admins:
- service: github
username: myaccount
http:
cookie_secret: ""
timeseries:
enabled: true
github:
client_id: xxx
client_secret: xxx
integration: xxx
pem: /config/codecov.pem
global_upload_token: ""
services:
redis_url: "redis://redis:6379"
database_url: "postgres://postgres:testpassword@postgres:5432/postgres"
timeseries_database_url: "postgres://postgres:testpassword@timescale:5432/postgres"
minio:
host: minio
port: 9000
`
@McDonald755 did you find a solution here?
He doesn't seem to support the address of http. But I have been running normally for some time after I changed to https, and I don't seem to be able to log in today.
{"message": "Unable to log in due to problem on Github", "asctime": "2024-01-22 03:15:47,351", "name": "codecov_auth.views.github", "levelname": "WARNING", "lineno": 117, "pathname": "/app/codecov_auth/views/github.py", "funcName": "actual_login_step", "threadName": "MainThread", "exc_info": "Traceback (most recent call last):\n File "/usr/local/lib/python3.9/site-packages/httpcore/backends/asyncio.py", line 109, in connect_tcp\n stream: anyio.abc.ByteStream = await anyio.connect_tcp(\n File "/usr/local/lib/python3.9/site-packages/anyio/_core/_sockets.py", line 218, in connect_tcp\n await event.wait()\n File "/usr/local/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 662, in aexit\n raise exceptions[0]\n File "/usr/local/lib/python3.9/site-packages/anyio/_core/_sockets.py", line 164, in try_connect\n stream = await asynclib.connect_tcp(remote_host, remote_port, local_address)\n File "/usr/local/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 1691, in connect_tcp\n await get_running_loop().create_connection(\n File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1050, in create_connection\n sock = await self._connect_sock(\n File "/usr/local/lib/python3.9/asyncio/base_events.py", line 961, in _connect_sock\n await self.sock_connect(sock, address)\n File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 500, in sock_connect\n return await fut\nasyncio.exceptions.CancelledError\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/usr/local/lib/python3.9/site-packages/httpcore/_exceptions.py", line 8, in map_exceptions\n yield\n File "/usr/local/lib/python3.9/site-packages/httpcore/backends/asyncio.py", line 109, in connect_tcp\n stream: anyio.abc.ByteStream = await anyio.connect_tcp(\n File "/usr/local/lib/python3.9/site-packages/anyio/_core/_tasks.py", line 118, in exit\n raise TimeoutError\nTimeoutError\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions\n yield\n File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 353, in handle_async_request\n resp = await self._pool.handle_async_request(req)\n File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection_pool.py", line 253, in handle_async_request\n raise exc\n File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection_pool.py", line 237, in handle_async_request\n response = await connection.handle_async_request(request)\n File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection.py", line 86, in handle_async_request\n raise exc\n File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection.py", line 63, in handle_async_request\n stream = await self._connect(request)\n File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection.py", line 111, in _connect\n stream = await self._network_backend.connect_tcp(**kwargs)\n File "/usr/local/lib/python3.9/site-packages/httpcore/backends/auto.py", line 29, in connect_tcp\n return await self._backend.connect_tcp(\n File "/usr/local/lib/python3.9/site-packages/httpcore/backends/asyncio.py", line 109, in connect_tcp\n stream: anyio.abc.ByteStream = await anyio.connect_tcp(\n File "/usr/local/lib/python3.9/contextlib.py", line 137, in exit\n self.gen.throw(typ, value, traceback)\n File "/usr/local/lib/python3.9/site-packages/httpcore/_exceptions.py", line 12, in map_exceptions\n raise to_exc(exc)\nhttpcore.ConnectTimeout\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File "/usr/local/lib/python3.9/site-packages/shared/torngit/github.py", line 208, in make_http_call\n res = await client.request(method, url, **kwargs)\n File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1527, in request\n return await self.send(request, auth=auth, follow_redirects=follow_redirects)\n File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1614, in send\n response = await self._send_handling_auth(\n File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1642, in _send_handling_auth\n response = await self._send_handling_redirects(\n File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1679, in _send_handling_redirects\n response = await self._send_single_request(request)\n File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1716, in _send_single_request\n response = await transport.handle_async_request(request)\n File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 353, in handle_async_request\n resp = await self._pool.handle_async_request(req)\n File "/usr/local/lib/python3.9/contextlib.py", line 137, in exit\n self.gen.throw(typ, value, traceback)\n File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions\n raise mapped_exc(message) from exc\nhttpx.ConnectTimeout\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/app/codecov_auth/views/github.py", line 113, in actual_login_step\n user_dict = self.fetch_user_data(code)\n File "/usr/local/lib/python3.9/site-packages/asgiref/sync.py", line 240, in call\n return call_result.result()\n File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 439, in result\n return self.__get_result()\n File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result\n raise self._exception\n File "/usr/local/lib/python3.9/site-packages/asgiref/sync.py", line 306, in main_wrap\n result = await self.awaitable(*args, **kwargs)\n File "/app/codecov_auth/views/github.py", line 79, in fetch_user_data\n authenticated_user = await repo_service.get_authenticated_user(code)\n File "/usr/local/lib/python3.9/site-packages/shared/torngit/github.py", line 422, in get_authenticated_user\n response = await self.make_http_call(\n File "/usr/local/lib/python3.9/site-packages/shared/torngit/github.py", line 229, in make_http_call\n raise TorngitServerUnreachableError(\nshared.torngit.exceptions.TorngitServerUnreachableError: GitHub was not able to be reached.", "logger.name": "codecov_auth.views.github", "logger.thread_name": "MainThread", "level": "WARNING"}
Report an error like this.