Skip to content

Health check failure is confusing #4943

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

Closed
ammario opened this issue Nov 7, 2022 · 0 comments · Fixed by #4944
Closed

Health check failure is confusing #4943

ammario opened this issue Nov 7, 2022 · 0 comments · Fixed by #4944

Comments

@ammario
Copy link
Member

ammario commented Nov 7, 2022

I created a fresh Coder deployment, added the docker-code-server template, and my code-server app is stuck in the Initializing... state.

The resource is configured as such:

resource "coder_app" "code-server" {
  agent_id     = coder_agent.main.id
  slug         = "code-server"
  display_name = "code-server"
  url          = "http://localhost:8080/?folder=/home/coder"
  icon         = "/icon/code.svg"
  subdomain    = false
  share        = "owner"

  healthcheck {
    url       = "http://localhost:8080/healthz"
    interval  = 3
    threshold = 10
  }
}

But, when I curl the health check endpoint within the workspace, it reports 200:

coder@test-1:~$ curl -v 127.0.0.1:8080/healthz
*   Trying 127.0.0.1:8080...
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET /healthz HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/7.74.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=utf-8
< Content-Length: 50
< ETag: W/"32-bnbntZrd4z8IPIgEbmlsZvjOOyQ"
< Vary: Accept-Encoding
< Date: Mon, 07 Nov 2022 22:56:27 GMT
< Connection: keep-alive
< Keep-Alive: timeout=5
<
* Connection #0 to host 127.0.0.1 left intact
{"status":"expired","lastHeartbeat":1667861611004}

I found this in /tmp/coder-agent.log:

2022-11-07 23:01:44.510 [ERROR]	<./agent/apphealth.go:137>	NewWorkspaceAppHealthReporter.func1	failed to report workspace app stat ...
  "error": POST https://fcca82996ca86b1a46d910c0d64dbdb6.pit-1.try.coder.app/api/v2/workspaceagents/me/app-health: unexpected status code 404: Error setting workspace app health
           	Error: workspace app name  not found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant