Skip to content

Login with Github always redirects back to the Login page #41

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

Open
rahul-roy-glean opened this issue Jun 27, 2024 · 22 comments
Open

Login with Github always redirects back to the Login page #41

rahul-roy-glean opened this issue Jun 27, 2024 · 22 comments
Assignees
Labels
Area: General UX Issues with general UX bug Something isn't working help wanted Extra attention is needed Low Low Priority Issues (to be fixed or re-evaluated in 12 months

Comments

@rahul-roy-glean
Copy link

rahul-roy-glean commented Jun 27, 2024

I'm trying out the self-hosted setup with Docker compose and trying to enable a login with GH.
I have setup the GH app as mentioned in the guide and trying to login with the same.
My docker compose looks like -

version: "3"

services:
  gateway:
    image: codecov/self-hosted-gateway:latest-stable #note: this is for setup purposes only, be sure to pin to the latest release from our changelog: https://docs.codecov.io/changelog
    volumes:
      - ./config:/config
      - ${CODECOV_SSL_CERT-/cert/codecov.pem}:/etc/codecov/ssl/certs/cert.crt:ro # uncomment if using ssl
      - ${CODECOV_SSL_KEY-/cert/privkey.pem}:/etc/codecov/ssl/certs/cert.crt.key:ro
    ports:
      - "${CODECOV_PORT-8080}:8080"
      - "${CODECOV_SSL_PORT-8443}:8443" # uncomment if using ssl
    environment:
      - CODECOV_GATEWAY_MINIO_ENABLED=true
      - CODECOV_GATEWAY_SSL_ENABLED=true # uncomment if using ssl
    networks:
      - codecov
    depends_on:
      - api
      - frontend

  frontend:
    image: codecov/self-hosted-frontend:latest-stable #note: this is for setup purposes only, be sure to pin to the latest release from our changelog: https://docs.codecov.io/changelog
    environment:
      - CODECOV_BASE_HOST=localhost:8443
      - CODECOV_API_HOST=localhost:8443
      - CODECOV_IA_HOST=localhost:8443
      - CODECOV_SCHEME=http
    volumes:
      - ./config:/config:z
      - ${CODECOV_SSL_CERT-/cert/codecov.pem}:/etc/nginx/codecov.crt:ro
      - ${CODECOV_SSL_KEY-/cert/privkey.pem}:/etc/nginx/codecov.key:ro
    ports:
      - "8080"
    networks:
      - codecov

  api:
    image: codecov/self-hosted-api:latest-stable #note: this is for setup purposes only, be sure to pin to the latest release from our changelog: https://docs.codecov.io/changelog
    volumes:
      - ./config:/config:z
    networks:
      - codecov
    depends_on:
      - minio
      - timescale
      - postgres
      - redis

  worker:
    image: codecov/self-hosted-worker:latest-stable #note: this is for setup purposes only, be sure to pin to the latest release from our changelog: https://docs.codecov.io/changelog
    environment:
      - RUN_ENV=ENTERPRISE
    volumes:
      - ./config:/config
      - archive-volume:/archive
    networks:
      - codecov
    depends_on:
      - minio
      - redis
      - postgres
      - timescale

  redis:
    image: redis:6-alpine
    volumes:
      - redis-volume:/data
    networks:
      - codecov

  postgres:
    image: postgres:14-alpine
    environment:
      - POSTGRES_PASSWORD=testpassword
      - POSTGRES_USER=postgres
      - POSTGRES_DB=postgres
    volumes:
      - postgres-volume:/var/lib/postgresql/data
    networks:
      - codecov

  timescale:
    image: timescale/timescaledb-ha:pg14-latest
    environment:
      - POSTGRES_PASSWORD=testpassword
      - POSTGRES_USER=postgres
      - POSTGRES_DB=postgres
    volumes:
      - timescale-volume:/var/lib/postgresql/data
    networks:
      - codecov

  minio:
    image: minio/minio:RELEASE.2020-04-15T00-39-01Z
    command: server /export
    ports:
      - "${CODECOV_MINIO_PORT-9000}:9000"
    environment:
      - MINIO_ACCESS_KEY=codecov-default-key
      - MINIO_SECRET_KEY=codecov-default-secret
    volumes:
      - archive-volume:/export
    networks:
      - codecov

volumes:
  postgres-volume:
  timescale-volume:
  redis-volume:
  archive-volume:

networks:
  codecov:
    driver: bridge

and my codecov.yml looks like

  codecov_url: https://35.188.12.198:8443
  enterprise_license: "<some_license>"
  # https://docs.codecov.com/docs/configuration#instance-wide-admins
  admins:
    - service: github
      username: "<GH Username>"
  http:
    cookie_secret: "1234abcxyz"
  timeseries:
    enabled: true
github:
  integration:
    id: 22
    pem: /config/file.pem
  client_id: "<some_id>"
  client_secret: "<some_secret>"
  global_upload_token: "<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

I haven't been able to perform a login with GH, in the worker logs i see something like -

{"message": "Warning: login request is missing state or has disagreeing state", "asctime": "2024-06-26 04:24:33,493", "name": "codecov_auth.views.base", "levelname": "WARNING", "lineno": 141, "pathname": "/app/codecov_auth/views/base.py", "funcName": "get_redirection_url_from_state", "threadName": "MainThread", "taskName": null, "logger.name": "codecov_auth.views.base", "logger.thread_name": "MainThread", "level": "WARNING"}
{"h": "192.168.240.9", "t": "[26/Jun/2024:04:24:33 +0000]", "r": "GET /login/gh?code=4521914e2b612b721886&state=5664647f224048439cad99a99de6444e HTTP/1.1", "s": "302", "b": "0", "f": "-", "a": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36", "taskName": null}
{"message": "GraphQL Request", "asctime": "2024-06-26 04:24:33,815", "name": "graphql_api.views", "levelname": "INFO", "lineno": 223, "pathname": "/app/graphql_api/views.py", "funcName": "post", "threadName": "ThreadPoolExecutor-9_0", "taskName": "Task-41", "server_hostname": "b77eb9829181", "request_method": "POST", "request_path": "/graphql/gh", "request_body": {"query": "query GetLoginProviders { config { loginProviders } }", "variables": {}}, "user": "AnonymousUser", "logger.name": "graphql_api.views", "logger.thread_name": "ThreadPoolExecutor-9_0", "level": "INFO"}

Could someone please help here ?

@thomasrockhu-codecov thomasrockhu-codecov added help wanted Extra attention is needed bug Something isn't working labels Jun 27, 2024
@rmaced0
Copy link
Contributor

rmaced0 commented Jul 1, 2024

I am also seeing this issue. I've attached a video for reference.

Screen.Recording.2024-06-30.at.11.29.01.PM.mov

@tekkeitserktok
Copy link

Same than this one with gitlab : #34

@rmaced0
Copy link
Contributor

rmaced0 commented Jul 3, 2024

This fixed the issue for me: #42
@rahul-roy-glean @tekkeitserktok Can you please test this on your end?
@jason-ford-codecov Can you review the PR?

@tekkeitserktok
Copy link

tekkeitserktok commented Jul 4, 2024

Hello @bert0RM, I use MY_IP.nip.io for codecov and gitlab.local domains for my local setup.
Will it work ? Or do I need to change other parameters in my config ?
I use "latest-calver" tag for docker images btw.

Thanks !

@rmaced0
Copy link
Contributor

rmaced0 commented Jul 4, 2024

@tekkeitserktok The change works for the default docker compose setup. Im not sure how nip.io works but what did you set the cookies_domain to? and what host are you using for the self-hosted-frontend?

@tekkeitserktok
Copy link

tekkeitserktok commented Jul 5, 2024

@bert0RM , here is my config for the frontend part:
`
frontend:
image: codecov/self-hosted-frontend:latest-calver
environment:
- CODECOV_BASE_HOST=10.84.31.161.nip.io:8080
- CODECOV_API_HOST=10.84.31.161.nip.io:8080
- CODECOV_IA_HOST=10.84.31.161.nip.io:8080
- CODECOV_SCHEME=http
volumes:
- ./config:/config
ports:
- "8080"
networks:
- codecov

`

I tried "localhost" and "nip.io" for the cookie_domain config but it didn't work

@rmaced0
Copy link
Contributor

rmaced0 commented Jul 5, 2024

Can you try 10.84.31.161 or 10.84.31.161.nip.io for the cookie_domain?

@hamzaaitbenyissa
Copy link

I am also seeing this issue. I've attached a video for reference.

Screen.Recording.2024-06-30.at.11.29.01.PM.mov

Thanks for your efforts to fix the issue. I am testing the same flow using Docker Compose and ngrok but am still encountering the same issue. When I tried using an older version of codecov-api. This issue disappeared, but other issues arose. I have also tested your proposed solutions by setting cookie_domain, but it did not resolve the problem. any idea ?

@tekkeitserktok
Copy link

Can you try 10.84.31.161 or 10.84.31.161.nip.io for the cookie_domain?

I tried, it didn't work :'(

@MrVinceZ
Copy link

MrVinceZ commented Jul 9, 2024

I have the same problem
I've tried @bert0RM method with "localhost" or my domain name but without success.

I've tried the latest-calver, latest-stable and 24.4.1

@disberd
Copy link

disberd commented Jul 25, 2024

Also having this same issue with a self-hosted gitlab instance

@garaemon
Copy link

garaemon commented Aug 2, 2024

@bert0RM 's PR fixed my issue! Thanks!

@adiRandom
Copy link

adiRandom commented Aug 14, 2024

Hey!
Same issue here. I have the docker containers behind nginx. I tried setting cookie_domain to both localhost and the ip of the server (no domain attached to it), but without success

Edit: Here are the relevant configs:

  gateway:
    image: codecov/self-hosted-gateway:latest-calver #note: this is for setup purposes only, be sure to pin to the latest release from our changelog: https://docs.codecov.io/changelog
    volumes:
      - ./config:/config
      #- ${CODECOV_SSL_CERT-/cert/codecov.crt}:/etc/codecov/ssl/certs/cert.crt:ro # uncomment if using ssl
    ports:
      - "${CODECOV_PORT-8080}:8080"
      #- "${CODECOV_SSL_PORT-8443}:8443" # uncomment if using ssl
    environment:
      - CODECOV_GATEWAY_MINIO_ENABLED=true
      #- CODECOV_GATEWAY_SSL_ENABLED=true # uncomment if using ssl
    networks:
      - codecov
    depends_on:
      - api
      - frontend

  frontend:
    image: codecov/self-hosted-frontend:latest-calver #note: this is for setup purposes only, be sure to pin to the latest release from our changelog: https://docs.codecov.io/changelog
    environment:
      - CODECOV_BASE_HOST=18.156.69.72
      - CODECOV_API_HOST=18.156.69.72
      - CODECOV_IA_HOST=18.156.69.72
      - CODECOV_SCHEME=http
    volumes:
      - ./config:/config
    ports:
      - "8080"
    networks:
      - codecov

  api:
    image: codecov/self-hosted-api:latest-calver #note: this is for setup purposes only, be sure to pin to the latest release from our changelog: https://docs.codecov.io/changelog
    volumes:
      - ./config:/config
    networks:
      - codecov
    depends_on:
      - minio
      - timescale
      - postgres
      - redis
setup:
  codecov_url: "http://18.156.69.72"
  enterprise_license: "<license>"
  admins:
    - service: github
      username: "adiRandom"
  http:
    cookie_secret: "<secret>"
    cookies_domain: localhost #also tried 18.156.69.72
  timeseries:
    enabled: true

@thomasrockhu-codecov thomasrockhu-codecov added the Area: General UX Issues with general UX label Aug 20, 2024
@thomasrockhu-codecov thomasrockhu-codecov added the Low Low Priority Issues (to be fixed or re-evaluated in 12 months label Sep 10, 2024
@mrtnin
Copy link

mrtnin commented Oct 5, 2024

@rahul-roy-glean @adiRandom and others using GitHub.com:
In the GitHub App settings, ensure that the callback URL is example.com/login/gh, not example.com/login/ghe
ghe = GitHub Enterprise

@isatfg
Copy link

isatfg commented Mar 26, 2025

Has a solution been found as yet. I'm having the same issue when I click login it redirects me to github where I authorize the app and then it redirect back to localhost:8000 and it just flashes as i @bert0RM screenshot. I'm see the same error

api-1        | {"message": "Warning: login request is missing state or has disagreeing state", "asctime": "2025-03-26 12:29:43,193", "name": "codecov_auth.views.base", "levelname": "WARNING", "lineno": 145, "pathname": "/app/apps/codecov-api/codecov_auth/views/base.py", "funcName": "get_redirection_url_from_state", "threadName": "MainThread", "taskName": null, "utctime": "2025-03-26T12:29:43.193000", "logger.name": "codecov_auth.views.base", "logger.thread_name": "MainThread", "level": "WARNING"}
setup:
  codecov_url: http://localhost:8080
  enterprise_license: "XXXXX"
  # https://docs.codecov.com/docs/configuration#instance-wide-admins
  admins:
    - service: github
      username: "myuser"
  # Replace with a random string
  # https://docs.codecov.io/docs/configuration#section-cookie-secret
  http:
    cookie_secret: "secret123"
    cookies_domain: localhost
  timeseries:
    enabled: true
github:
  client_id: "xxxxxxxxxxxxxxx"
  client_secret: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  global_upload_token: "<upload-token>"
  webhook_secret: "xxxxxxxxxxxxxxxxxxxxxxxxx"
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
    auto_create_bucket: true

@isatfg
Copy link

isatfg commented Apr 2, 2025

@rahul-roy-glean @adiRandom and others using GitHub.com: In the GitHub App settings, ensure that the callback URL is example.com/login/gh, not example.com/login/ghe ghe = GitHub Enterprise

Hi @mrtnin

I changed the callback url as you recommended from ghe to gh but now I'm seeing I get a internal server error. Did you experience this?

api-1 | {"message": "Internal Server Error: /login/gh", "asctime": "2025-04-02 10:22:57,531", "name": "django.request", "levelname": "ERROR", "lineno": 241, "pathname": "/usr/local/lib/python3.12/site-packages/django/utils/log.py", "funcName": "log_response", "threadName": "MainThread", "exc_info": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/django/core/handlers/exception.py\", line 55, in inner\n response = get_response(request)\n ^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/django/core/handlers/base.py\", line 197, in _get_response\n response = wrapped_callback(request, *callback_args, **callback_kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/django/views/generic/base.py\", line 104, in view\n return self.dispatch(request, *args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/django/views/generic/base.py\", line 143, in dispatch\n return handler(request, *args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/apps/codecov-api/codecov_auth/views/github.py\", line 139, in get\n return self.actual_login_step(request)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/apps/codecov-api/codecov_auth/views/github.py\", line 127, in actual_login_step\n self.login_owner(owner, request, response)\n File \"/app/apps/codecov-api/codecov_auth/views/base.py\", line 261, in login_owner\n RefreshService().trigger_refresh(owner.ownerid, owner.username)\n File \"/app/apps/codecov-api/services/refresh.py\", line 45, in trigger_refresh\n resp = self.task_service.refresh(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/apps/codecov-api/services/task/task.py\", line 205, in refresh\n self._create_signature(\n File \"/app/apps/codecov-api/services/task/task.py\", line 39, in _create_signature\n queue_and_config = route_task(name, args=args, kwargs=kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/apps/codecov-api/services/task/task_router.py\", line 104, in route_task\n return route_tasks_based_on_user_plan(name, user_plan)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/shared/celery_router.py\", line 51, in route_tasks_based_on_user_plan\n plan = Plan.objects.get(name=user_plan)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/django/db/models/manager.py\", line 87, in manager_method\n return getattr(self.get_queryset(), name)(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/django/db/models/query.py\", line 637, in get\n raise self.model.DoesNotExist(\nshared.django_apps.codecov_auth.models.Plan.DoesNotExist: Plan matching query does not exist.", "taskName": null, "status_code": 500, "request": "<WSGIRequest: GET '/login/gh?code=xxxxxxxxxxxxxxxxxxxx&state=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'>", "utctime": "2025-04-02T10:22:57.531000", "logger.name": "django.request", "logger.thread_name": "MainThread", "level": "ERROR"}

@mrtnin
Copy link

mrtnin commented Apr 2, 2025

@rahul-roy-glean @adiRandom and others using GitHub.com: In the GitHub App settings, ensure that the callback URL is example.com/login/gh, not example.com/login/ghe ghe = GitHub Enterprise

Hi @mrtnin

I changed the callback url as you recommended from ghe to gh but now I'm seeing I get a internal server error. Did you experience this?

@isatfg
I don't get 500 errors no. Here's some screenshots of my setup.

Image Image

Then you just need to make sure it's installed to your repo with the correct permissions.

@isatfg
Copy link

isatfg commented Apr 2, 2025

Thanks , @mrtnin can you please share your docker compose file and config/codecov.yml obviously you can redact sensitive information. I have no idea why this does not for me.

@stickperson
Copy link

@isatfg what do you see when you run docker compose logs api? When I first try to login, I was seeing shared.django_apps.codecov_auth.models.Plan.DoesNotExist: Plan matching query does not exist. If I restart the api container those errors go away and I can login.

@isatfg
Copy link

isatfg commented Apr 3, 2025

@stickperson I have tried restarting the api but still get the same error message. Can you please share you docker-compose and config/codecove.yaml. Im not using github enterprise so my github app callback url is http://localhost:8080/login/gh not sure if this is correct or not.

api-1  | {"message": "Appending repo to scope", "asctime": "2025-04-03 07:54:13,395", "name": "codecov_auth.views.github", "levelname": "INFO", "lineno": 147, "pathname": "/app/apps/codecov-api/codecov_auth/views/github.py", "funcName": "get", "threadName": "MainThread", "taskName": null, "utctime": "2025-04-03T07:54:13.395000", "logger.name": "codecov_auth.views.github", "logger.thread_name": "MainThread", "level": "INFO"}
api-1  | {"h": "172.18.0.9", "t": "[03/Apr/2025:07:54:13 +0000]", "r": "GET /login/gh HTTP/1.1", "s": "302", "b": "0", "f": "http://localhost:8080/", "a": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36", "taskName": null}
api-1  | {"message": "HTTP Request: GET https://github.com/login/oauth/access_token?code=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&client_secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \"HTTP/1.1 200 OK\"", "asctime": "2025-04-03 07:54:14,217", "name": "httpx", "levelname": "INFO", "lineno": 1740, "pathname": "/usr/local/lib/python3.12/site-packages/httpx/_client.py", "funcName": "_send_single_request", "threadName": "ThreadPoolExecutor-3_0", "taskName": "Task-7", "utctime": "2025-04-03T07:54:14.217000", "logger.name": "httpx", "logger.thread_name": "ThreadPoolExecutor-3_0", "level": "INFO"}
api-1  | {"message": "Github HTTP 200", "asctime": "2025-04-03 07:54:14,219", "name": "shared.torngit.github", "levelname": "INFO", "lineno": 838, "pathname": "/usr/local/lib/python3.12/site-packages/shared/torngit/github.py", "funcName": "make_http_call", "threadName": "ThreadPoolExecutor-3_0", "taskName": "Task-7", "current_retry": 1, "body": null, "rl_remaining": null, "rl_limit": null, "rl_reset_time": null, "retry_after": null, "gh_request_id": "AABE:09DD:25B935:3F4A82:67EE3EA5", "utctime": "2025-04-03T07:54:14.219000", "logger.name": "shared.torngit.github", "logger.thread_name": "ThreadPoolExecutor-3_0", "level": "INFO"}
api-1  | {"message": "Making Github API call", "asctime": "2025-04-03 07:54:14,219", "name": "shared.torngit.github", "levelname": "INFO", "lineno": 646, "pathname": "/usr/local/lib/python3.12/site-packages/shared/torngit/github.py", "funcName": "api", "threadName": "ThreadPoolExecutor-3_0", "taskName": "Task-7", "has_token": false, "has_self_token": true, "is_same_token": false, "utctime": "2025-04-03T07:54:14.219000", "logger.name": "shared.torngit.github", "logger.thread_name": "ThreadPoolExecutor-3_0", "level": "INFO"}
api-1  | {"message": "HTTP Request: GET https://api.github.com/user \"HTTP/1.1 200 OK\"", "asctime": "2025-04-03 07:54:14,590", "name": "httpx", "levelname": "INFO", "lineno": 1740, "pathname": "/usr/local/lib/python3.12/site-packages/httpx/_client.py", "funcName": "_send_single_request", "threadName": "ThreadPoolExecutor-3_0", "taskName": "Task-7", "utctime": "2025-04-03T07:54:14.590000", "logger.name": "httpx", "logger.thread_name": "ThreadPoolExecutor-3_0", "level": "INFO"}
api-1  | {"message": "Github HTTP 200", "asctime": "2025-04-03 07:54:14,591", "name": "shared.torngit.github", "levelname": "INFO", "lineno": 838, "pathname": "/usr/local/lib/python3.12/site-packages/shared/torngit/github.py", "funcName": "make_http_call", "threadName": "ThreadPoolExecutor-3_0", "taskName": "Task-7", "current_retry": 1, "body": null, "rl_remaining": "4994", "rl_limit": "5000", "rl_reset_time": "1743670420", "retry_after": null, "gh_request_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "event": "api", "endpoint": "/user", "method": "GET", "bot": null, "repo_slug": null, "loggable_token": "WX5g1", "utctime": "2025-04-03T07:54:14.591000", "logger.name": "shared.torngit.github", "logger.thread_name": "ThreadPoolExecutor-3_0", "level": "INFO"}
api-1  | {"message": "Making Github API call", "asctime": "2025-04-03 07:54:14,591", "name": "shared.torngit.github", "levelname": "INFO", "lineno": 646, "pathname": "/usr/local/lib/python3.12/site-packages/shared/torngit/github.py", "funcName": "api", "threadName": "ThreadPoolExecutor-3_0", "taskName": "Task-7", "has_token": false, "has_self_token": true, "is_same_token": false, "utctime": "2025-04-03T07:54:14.591000", "logger.name": "shared.torngit.github", "logger.thread_name": "ThreadPoolExecutor-3_0", "level": "INFO"}
api-1  | {"message": "HTTP Request: GET https://api.github.com/user/emails \"HTTP/1.1 200 OK\"", "asctime": "2025-04-03 07:54:14,887", "name": "httpx", "levelname": "INFO", "lineno": 1740, "pathname": "/usr/local/lib/python3.12/site-packages/httpx/_client.py", "funcName": "_send_single_request", "threadName": "ThreadPoolExecutor-3_0", "taskName": "Task-7", "utctime": "2025-04-03T07:54:14.887000", "logger.name": "httpx", "logger.thread_name": "ThreadPoolExecutor-3_0", "level": "INFO"}
api-1  | {"message": "Github HTTP 200", "asctime": "2025-04-03 07:54:14,888", "name": "shared.torngit.github", "levelname": "INFO", "lineno": 838, "pathname": "/usr/local/lib/python3.12/site-packages/shared/torngit/github.py", "funcName": "make_http_call", "threadName": "ThreadPoolExecutor-3_0", "taskName": "Task-7", "current_retry": 1, "body": null, "rl_remaining": "4993", "rl_limit": "5000", "rl_reset_time": "1743670420", "retry_after": null, "gh_request_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "event": "api", "endpoint": "/user/emails", "method": "GET", "bot": null, "repo_slug": null, "loggable_token": "WX5g1", "utctime": "2025-04-03T07:54:14.888000", "logger.name": "shared.torngit.github", "logger.thread_name": "ThreadPoolExecutor-3_0", "level": "INFO"}
api-1  | {"message": "Making Github API call", "asctime": "2025-04-03 07:54:14,888", "name": "shared.torngit.github", "levelname": "INFO", "lineno": 646, "pathname": "/usr/local/lib/python3.12/site-packages/shared/torngit/github.py", "funcName": "api", "threadName": "ThreadPoolExecutor-3_0", "taskName": "Task-7", "has_token": true, "has_self_token": true, "is_same_token": true, "utctime": "2025-04-03T07:54:14.888000", "logger.name": "shared.torngit.github", "logger.thread_name": "ThreadPoolExecutor-3_0", "level": "INFO"}
api-1  | {"message": "HTTP Request: GET https://api.github.com/user/memberships/orgs?state=active&page=1 \"HTTP/1.1 200 OK\"", "asctime": "2025-04-03 07:54:15,226", "name": "httpx", "levelname": "INFO", "lineno": 1740, "pathname": "/usr/local/lib/python3.12/site-packages/httpx/_client.py", "funcName": "_send_single_request", "threadName": "ThreadPoolExecutor-3_0", "taskName": "Task-7", "utctime": "2025-04-03T07:54:15.226000", "logger.name": "httpx", "logger.thread_name": "ThreadPoolExecutor-3_0", "level": "INFO"}
api-1  | {"message": "Github HTTP 200", "asctime": "2025-04-03 07:54:15,227", "name": "shared.torngit.github", "levelname": "INFO", "lineno": 838, "pathname": "/usr/local/lib/python3.12/site-packages/shared/torngit/github.py", "funcName": "make_http_call", "threadName": "ThreadPoolExecutor-3_0", "taskName": "Task-7", "current_retry": 1, "body": null, "rl_remaining": "4992", "rl_limit": "5000", "rl_reset_time": "1743670420", "retry_after": null, "gh_request_id": "cccccccccccccccccccccccccccccccccc", "event": "api", "endpoint": "/user/memberships/orgs?state=active", "method": "GET", "bot": null, "repo_slug": null, "loggable_token": "WX5g1", "utctime": "2025-04-03T07:54:15.227000", "logger.name": "shared.torngit.github", "logger.thread_name": "ThreadPoolExecutor-3_0", "level": "INFO"}
api-1  | {"message": "Making Github API call", "asctime": "2025-04-03 07:54:15,227", "name": "shared.torngit.github", "levelname": "INFO", "lineno": 646, "pathname": "/usr/local/lib/python3.12/site-packages/shared/torngit/github.py", "funcName": "api", "threadName": "ThreadPoolExecutor-3_0", "taskName": "Task-7", "has_token": false, "has_self_token": true, "is_same_token": false, "utctime": "2025-04-03T07:54:15.227000", "logger.name": "shared.torngit.github", "logger.thread_name": "ThreadPoolExecutor-3_0", "level": "INFO"}
api-1  | {"message": "HTTP Request: GET https://education.github.com/api/user \"HTTP/1.1 401 Unauthorized\"", "asctime": "2025-04-03 07:54:16,208", "name": "httpx", "levelname": "INFO", "lineno": 1740, "pathname": "/usr/local/lib/python3.12/site-packages/httpx/_client.py", "funcName": "_send_single_request", "threadName": "ThreadPoolExecutor-3_0", "taskName": "Task-7", "utctime": "2025-04-03T07:54:16.208000", "logger.name": "httpx", "logger.thread_name": "ThreadPoolExecutor-3_0", "level": "INFO"}
api-1  | {"message": "Github HTTP 401", "asctime": "2025-04-03 07:54:16,209", "name": "shared.torngit.github", "levelname": "WARNING", "lineno": 838, "pathname": "/usr/local/lib/python3.12/site-packages/shared/torngit/github.py", "funcName": "make_http_call", "threadName": "ThreadPoolExecutor-3_0", "taskName": "Task-7", "current_retry": 1, "body": "", "rl_remaining": null, "rl_limit": null, "rl_reset_time": null, "retry_after": null, "gh_request_id": "867A:5D6A9:5F638C:7743FF:67EE3EA7", "utctime": "2025-04-03T07:54:16.209000", "logger.name": "shared.torngit.github", "logger.thread_name": "ThreadPoolExecutor-3_0", "level": "WARNING"}
api-1  | {"message": "Making Github API call", "asctime": "2025-04-03 07:54:16,210", "name": "shared.torngit.github", "levelname": "INFO", "lineno": 646, "pathname": "/usr/local/lib/python3.12/site-packages/shared/torngit/github.py", "funcName": "api", "threadName": "ThreadPoolExecutor-3_0", "taskName": "Task-7", "has_token": false, "has_self_token": true, "is_same_token": false, "utctime": "2025-04-03T07:54:16.210000", "logger.name": "shared.torngit.github", "logger.thread_name": "ThreadPoolExecutor-3_0", "level": "INFO"}
api-1  | {"message": "HTTP Request: GET https://api.github.com/user/teams?per_page=100&page=1 \"HTTP/1.1 200 OK\"", "asctime": "2025-04-03 07:54:16,685", "name": "httpx", "levelname": "INFO", "lineno": 1740, "pathname": "/usr/local/lib/python3.12/site-packages/httpx/_client.py", "funcName": "_send_single_request", "threadName": "ThreadPoolExecutor-3_0", "taskName": "Task-7", "utctime": "2025-04-03T07:54:16.685000", "logger.name": "httpx", "logger.thread_name": "ThreadPoolExecutor-3_0", "level": "INFO"}
api-1  | {"message": "Github HTTP 200", "asctime": "2025-04-03 07:54:16,685", "name": "shared.torngit.github", "levelname": "INFO", "lineno": 838, "pathname": "/usr/local/lib/python3.12/site-packages/shared/torngit/github.py", "funcName": "make_http_call", "threadName": "ThreadPoolExecutor-3_0", "taskName": "Task-7", "current_retry": 1, "body": null, "rl_remaining": "4990", "rl_limit": "5000", "rl_reset_time": "1743670420", "retry_after": null, "gh_request_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "event": "api", "endpoint": "/user/teams?per_page=100&page=1", "method": "GET", "bot": null, "repo_slug": null, "loggable_token": "WX5g1", "utctime": "2025-04-03T07:54:16.685000", "logger.name": "shared.torngit.github", "logger.thread_name": "ThreadPoolExecutor-3_0", "level": "INFO"}
api-1  | {"message": "RUN_ENV is not production. Amplitude events will not be tracked.", "asctime": "2025-04-03 07:54:16,701", "name": "shared.events.amplitude.publisher", "levelname": "INFO", "lineno": 40, "pathname": "/usr/local/lib/python3.12/site-packages/shared/events/amplitude/publisher.py", "funcName": "__init__", "threadName": "MainThread", "taskName": null, "utctime": "2025-04-03T07:54:16.701000", "logger.name": "shared.events.amplitude.publisher", "logger.thread_name": "MainThread", "level": "INFO"}
api-1  | {"message": "StubbedAmplitudeClient tracked event User Logged in", "asctime": "2025-04-03 07:54:16,701", "name": "shared.events.amplitude.publisher", "levelname": "INFO", "lineno": 169, "pathname": "/usr/local/lib/python3.12/site-packages/shared/events/amplitude/publisher.py", "funcName": "track", "threadName": "MainThread", "taskName": null, "user_id": "1", "event_type": "User Logged in", "event_properties": {}, "groups": {}, "utctime": "2025-04-03T07:54:16.701000", "logger.name": "shared.events.amplitude.publisher", "logger.thread_name": "MainThread", "level": "INFO"}
api-1  | {"message": "StubbedAmplitudeClient set_group org: []", "asctime": "2025-04-03 07:54:16,702", "name": "shared.events.amplitude.publisher", "levelname": "INFO", "lineno": 162, "pathname": "/usr/local/lib/python3.12/site-packages/shared/events/amplitude/publisher.py", "funcName": "set_group", "threadName": "MainThread", "taskName": null, "user_id": "1", "utctime": "2025-04-03T07:54:16.702000", "logger.name": "shared.events.amplitude.publisher", "logger.thread_name": "MainThread", "level": "INFO"}
api-1  | {"message": "User logged in", "asctime": "2025-04-03 07:54:16,749", "name": "codecov_auth.views.base", "levelname": "INFO", "lineno": 255, "pathname": "/app/apps/codecov-api/codecov_auth/views/base.py", "funcName": "login_owner", "threadName": "MainThread", "taskName": null, "user_id": 1, "ownerid": 1, "utctime": "2025-04-03T07:54:16.749000", "logger.name": "codecov_auth.views.base", "logger.thread_name": "MainThread", "level": "INFO"}
api-1  | {"message": "Internal Server Error: /login/gh", "asctime": "2025-04-03 07:54:16,756", "name": "django.request", "levelname": "ERROR", "lineno": 241, "pathname": "/usr/local/lib/python3.12/site-packages/django/utils/log.py", "funcName": "log_response", "threadName": "MainThread", "exc_info": "Traceback (most recent call last):\n  File \"/usr/local/lib/python3.12/site-packages/django/core/handlers/exception.py\", line 55, in inner\n    response = get_response(request)\n               ^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.12/site-packages/django/core/handlers/base.py\", line 197, in _get_response\n    response = wrapped_callback(request, *callback_args, **callback_kwargs)\n               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.12/site-packages/django/views/generic/base.py\", line 104, in view\n    return self.dispatch(request, *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.12/site-packages/django/views/generic/base.py\", line 143, in dispatch\n    return handler(request, *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/app/apps/codecov-api/codecov_auth/views/github.py\", line 139, in get\n    return self.actual_login_step(request)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/app/apps/codecov-api/codecov_auth/views/github.py\", line 127, in actual_login_step\n    self.login_owner(owner, request, response)\n  File \"/app/apps/codecov-api/codecov_auth/views/base.py\", line 261, in login_owner\n    RefreshService().trigger_refresh(owner.ownerid, owner.username)\n  File \"/app/apps/codecov-api/services/refresh.py\", line 45, in trigger_refresh\n    resp = self.task_service.refresh(\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/app/apps/codecov-api/services/task/task.py\", line 205, in refresh\n    self._create_signature(\n  File \"/app/apps/codecov-api/services/task/task.py\", line 39, in _create_signature\n    queue_and_config = route_task(name, args=args, kwargs=kwargs)\n                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/app/apps/codecov-api/services/task/task_router.py\", line 104, in route_task\n    return route_tasks_based_on_user_plan(name, user_plan)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.12/site-packages/shared/celery_router.py\", line 51, in route_tasks_based_on_user_plan\n    plan = Plan.objects.get(name=user_plan)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.12/site-packages/django/db/models/manager.py\", line 87, in manager_method\n    return getattr(self.get_queryset(), name)(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.12/site-packages/django/db/models/query.py\", line 637, in get\n    raise self.model.DoesNotExist(\nshared.django_apps.codecov_auth.models.Plan.DoesNotExist: Plan matching query does not exist.", "taskName": null, "status_code": 500, "request": "<WSGIRequest: GET '/login/gh?code=xxxxxxxxxxxxxxxxxxxx&state=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'>", "utctime": "2025-04-03T07:54:16.756000", "logger.name": "django.request", "logger.thread_name": "MainThread", "level": "ERROR"}
api-1  | {"h": "172.18.0.9", "t": "[03/Apr/2025:07:54:16 +0000]", "r": "GET /login/gh?code=xxxxxxxxxxxxxxxxxxxxxxate=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx HTTP/1.1", "s": "500", "b": "31", "f": "-", "a": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36", "taskName": null}

@mrtnin
Copy link

mrtnin commented Apr 3, 2025

@isatfg There's something in this log that sticks out. I don't know if it's relevant or not.

api-1  | {"message": "HTTP Request: GET https://education.github.com/api/user \"HTTP/1.1 401 Unauthorized\"", "asctime": "2025-04-03 07:54:16,208", "name": "httpx", "levelname": "INFO", "lineno": 1740, "pathname": "/usr/local/lib/python3.12/site-packages/httpx/_client.py", "funcName": "_send_single_request", "threadName": "ThreadPoolExecutor-3_0", "taskName": "Task-7", "utctime": "2025-04-03T07:54:16.208000", "logger.name": "httpx", "logger.thread_name": "ThreadPoolExecutor-3_0", "level": "INFO"}
api-1  | {"message": "Github HTTP 401", "asctime": "2025-04-03 07:54:16,209", "name": "shared.torngit.github", "levelname": "WARNING", "lineno": 838, "pathname": "/usr/local/lib/python3.12/site-packages/shared/torngit/github.py", "funcName": "make_http_call", "threadName": "ThreadPoolExecutor-3_0", "taskName": "Task-7", "current_retry": 1, "body": "", "rl_remaining": null, "rl_limit": null, "rl_reset_time": null, "retry_after": null, "gh_request_id": "867A:5D6A9:5F638C:7743FF:67EE3EA7", "utctime": "2025-04-03T07:54:16.209000", "logger.name": "shared.torngit.github", "logger.thread_name": "ThreadPoolExecutor-3_0", "level": "WARNING"}

I'll contribute with my logs later, I'm unable at the moment.

@isatfg
Copy link

isatfg commented Apr 3, 2025

I have manage to login if I pin the version from latest-calver to 25.2.7 it seems like the migration is not running sucessfully on version latest-calver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: General UX Issues with general UX bug Something isn't working help wanted Extra attention is needed Low Low Priority Issues (to be fixed or re-evaluated in 12 months
Projects
None yet
Development

No branches or pull requests