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

Github - Time Spent Per Commit not working (Not Found) #87

Open
jontstaz opened this issue Sep 13, 2023 · 1 comment
Open

Github - Time Spent Per Commit not working (Not Found) #87

jontstaz opened this issue Sep 13, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@jontstaz
Copy link

Hi,

Nice project. However I'm facing a specific issue. I have many projects connected to Github repos that are both private and public. When I try to use the Time Spent Per Commit feature, it throws a red alert error at the top right saying "Failed to fetch the commit log". Then when I look at the Docker logs I see the following:

hakatime  |   host                 = "api.github.com"
hakatime  |   port                 = 443
hakatime  |   secure               = True
hakatime  |   requestHeaders       = [("Authorization","<REDACTED>"),("User-Agent","Hakatime Server"),("Accept","application/json")]
hakatime  |   path                 = "/repos/<my_gh_username>/<my_repo>/commits"
hakatime  |   queryString          = "?per_page=81"
hakatime  |   method               = "GET"
hakatime  |   proxy                = Nothing
hakatime  |   rawBody              = False
hakatime  |   redirectCount        = 10
hakatime  |   responseTimeout      = ResponseTimeoutDefault
hakatime  |   requestVersion       = HTTP/1.1
hakatime  |   proxySecureMode      = ProxySecureWithConnect
hakatime  | }
hakatime  |  (StatusCodeException (Response {responseStatus = Status {statusCode = 404, statusMessage = "Not Found"}, responseVersion = HTTP/1.1, responseHeaders = [("Server","github.com"),("Date","Wed, 13 Sep 2023 09:54:17 GMT"),("Content-Type","application/json; charset=utf-8"),("Transfer-Encoding","chunked"),("X-GitHub-Media-Type","github.v3"),("x-github-api-version-selected","2022-11-28"),("X-RateLimit-Limit","60"),("X-RateLimit-Remaining","40"),("X-RateLimit-Reset","1694599592"),("X-RateLimit-Used","20"),("X-RateLimit-Resource","core"),("Access-Control-Expose-Headers","ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset"),("Access-Control-Allow-Origin","*"),("Strict-Transport-Security","max-age=31536000; includeSubdomains; preload"),("X-Frame-Options","deny"),("X-Content-Type-Options","nosniff"),("X-XSS-Protection","0"),("Referrer-Policy","origin-when-cross-origin, strict-origin-when-cross-origin"),("Content-Security-Policy","default-src 'none'"),("Vary","Accept-Encoding, Accept, X-Requested-With"),("Content-Encoding","gzip"),("X-GitHub-Request-Id","D922:4CCA:F1B5C5:1008E93:650186C9")], responseBody = (), responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose, responseOriginalRequest = Request {

Is this a known issue? I've got the correct permissions on my Personal Access Token. I've even tried using a token with all permissions enabled just to test but same result. And interestingly, when I look at the list of the tokens on Github, they each say Never used.

Here's my Docker-Compose config for context:

version: "3"
services:
  server:
    container_name: hakatime
    image: mujx/hakatime:v1.7.3
    environment:
      # DB settings.
      HAKA_DB_HOST: haka_db
      HAKA_DB_PORT: 5432
      HAKA_DB_NAME: hakatime
      HAKA_DB_PASS: <my_pg_pw>
      HAKA_DB_USER: <my_pg_user>
      # Server settings.
      # Fill out this field if the api is behind another path (e.g behind a reverse proxy).
      # This will adjust the Set-Cookie path for all the /auth related API calls.
      HAKA_API_PREFIX: ""
      # Update this with the external endpoint that you use to access hakatime.
      HAKA_BADGE_URL: "https://<my_hakatime_instance_url>"
      HAKA_PORT: 8080
      HAKA_SHIELDS_IO_URL: "https://img.shields.io"
      HAKA_ENABLE_REGISTRATION: "true" # Toggle after you've created your account.
      # Number of hours after which inactive browser sessions will expire (login required).
      HAKA_SESSION_EXPIRY: "24"
      HAKA_LOG_LEVEL: "info" # Control the verbosity of the logger.
      HAKA_ENV: "dev" # Use a json logger for production, otherwise key=value pairs.
      HAKA_HTTP_LOG: "true" # If you want to log http requests.
      GITHUB_TOKEN: "<ghp_my_token>" # If you want to retrieve time spent per commit. No extra scope is required.
      # Add the following variables if you want to forward any received heartbeats to another
      # Wakatime compatible server.
      HAKA_REMOTE_WRITE_URL: "https://wakatime.com/api/v1/users/current/heartbeats.bulk"
      HAKA_REMOTE_WRITE_TOKEN: "<my_wakatime.com_api_key>"
    ports:
      - "3117:8080"
  haka_db:
    container_name: haka_db
    image: postgres:12-alpine
    environment:
      POSTGRES_DB: hakatime
      POSTGRES_PASSWORD: <pg_password>
      POSTGRES_USER: <pg_user>
    volumes:
      - deploy_db_data:/var/lib/postgresql/data

volumes:
  deploy_db_data: {}

Thanks in advance

@mujx mujx added the bug Something isn't working label Sep 20, 2023
@lokize
Copy link

lokize commented Jun 10, 2024

same problem here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants