Skip to content

[Bug] Google Health does not connec #1745

Backlog

Description

@VocAddict

HealthLog version

1.4.19

Deployment type

Self-hosted (Docker)

What happened?

I set up Google Health according the documentation on Google Cloud but when I clicked connect, I got the following error on the url /api/google-health/connect

{"data":null,"error":"Interner Serverfehler","meta":{"errorCode":"http.internal","requestId":"0a390386-f0a4-4c67-ad70-789c0bcccf8d"}}

I'm not in a position to check the admin account to view the system logs, and I understand this integration is still in beta, so do let me know what I can investigate to help with this.

Expected behavior

For it to work.

Steps to reproduce

  1. Set up on Google Cloud Console
  2. Add client id and secret to HealthLog
  3. Click save
  4. Click connect with Google
  5. Error appears on its own page

Error ID

No response

Support info / support report


Screenshots / other logs

Browser / OS (if applicable)

No response

Pre-flight checks

  • I confirmed this is not a duplicate of an existing issue.
  • I redacted any secrets, tokens, or personal data from logs.

Activity

  1. added
    bug
    on Dec 1, 2026
  2. MBombeck commented on Dec 1, 2026

    @MBombeck
    Owner

    @VocAddict Thanks a lot for trying Google Health this early and for writing it up so clearly, including the request id. That made it quick to find.

    The error comes from the connect step itself, before HealthLog ever sends you to Google. It first builds the callback address it will register with Google from the server's public URL (NEXT_PUBLIC_APP_URL, or GOOGLE_HEALTH_REDIRECT_URI if that is set). When that address fails its check, the error was never caught, and you got the bare "Interner Serverfehler" page instead of a message. The usual triggers are:

    • NEXT_PUBLIC_APP_URL ending in a slash, e.g. https://health.example.com/
    • plain http:// on anything other than localhost (Google only accepts https callbacks, except for localhost)
    • NEXT_PUBLIC_APP_URL not set, or GOOGLE_HEALTH_REDIRECT_URI on a different address than NEXT_PUBLIC_APP_URL

    Less likely: if the server's encryption key changed after you saved the client id and secret, they can't be read anymore. That ended in the same page.

    The fix is ready and ships with the next release, most likely this Saturday. From then on a trailing slash simply works, and every other case takes you back to Settings, Connections with a message saying what to change. If you want it earlier, the :edge image picks it up as soon as it lands.

    Meanwhile, if you (or whoever runs the server) can check:

    1. NEXT_PUBLIC_APP_URL is the exact https address you open HealthLog at, with no trailing slash.
    2. In the Google Cloud console, the OAuth client's "Authorized redirect URIs" contains exactly https://<that address>/api/google-health/callback. Same scheme, same host, same port, no extra slash. Settings, Connections in HealthLog shows the address it expects in the Google Health setup guide.
    3. If one of those was off, fix it, restart the container, save the client id and secret again, and click Connect once more.

    If it still fails after that, let me know what your public URL looks like (just the shape, e.g. "https with a subdomain" or "http on a LAN IP"), and the new request id, and I'll dig further.

    Refs #1745

  3. VocAddict commented on Dec 1, 2026

    @VocAddict
    Author
    1. The NEXT_PUBLIC_APP_URL and APP_URL were previously set to http://localhost:3000, it's now set to the public facing URL. For reference, a Tailscale serve is being used for this, being https://healthlog.taildXXXXX.ts.net. There were not trailing slash on the last URL
    2. Yes, this is the URI. https://healthlog.taildXXXXX.ts.net/api/google-health/callback
    3. Fixed and restarted, the error remains.

    I'm seeing that there are no test users set up under audience though, is this a strict requirement for it to work?

  4. MBombeck commented on Dec 1, 2026

    @MBombeck
    Owner

    @VocAddict thanks for checking all three so carefully. Your URL and callback look right, so let's narrow down what's left.

    Test users: yes, add yourself. While the Google app is in "Testing", only accounts listed as test users can sign in. That would show up as an "access blocked" page at Google, though, not as the error you're seeing, which happens before HealthLog sends you to Google at all. So it's needed, but it isn't this error.

    Two things I'd check next, in this order:

    1. Was the container recreated, or only restarted? Docker reads the environment when a container is created. docker restart (or the restart button in most UIs) keeps the old values, so the app may still be running with http://localhost:3000. Run docker compose up -d in the HealthLog folder instead, then check what the app actually sees:
      docker compose exec app printenv NEXT_PUBLIC_APP_URL
      It should print your https://…ts.net address.
    2. Save the client ID and secret again in Settings, Connections, Google Health, then click connect. If the server's encryption key changed at some point after you first saved them, the stored values can't be read anymore, and that also ends in this same error. Saving them again fixes that case.

    If it still fails after both, a fresh request id from the error page would help, and whoever runs the server could look up that id in the logs. The fix that turns this bare error into a readable message is queued and ships on Saturday; it will also tell you exactly which of these it was.

    Refs #1745

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions