[GH-ISSUE #625] Hoarder-app always unhealthy #397

Closed
opened 2026-03-02 11:49:30 +03:00 by kerem · 9 comments
Owner

Originally created by @hot22shot on GitHub (Nov 7, 2024).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/625

Describe the Bug

Hi,

The health status is always unhealthy for the docker container of the hoarder-app.
But the application is working correctly.

I checked the healthcheck and found that the test fails :

/app # wget --spider http://127.0.0.1:3000/api/health
Connecting to 127.0.0.1:3000 (127.0.0.1:3000)
wget: can't connect to remote host (127.0.0.1): Connection refused

But if I use the actual @ip of the container it works :

/app # wget --spider http://172.24.0.5:3000/api/health
Connecting to 172.24.0.5:3000 (172.24.0.5:3000)
remote file exists

Steps to Reproduce

Check the status of the hoarder-app container.

Expected Behaviour

healthcheck is OK

Screenshots or Additional Context

No response

Device Details

No response

Exact Hoarder Version

0.18.0

Originally created by @hot22shot on GitHub (Nov 7, 2024). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/625 ### Describe the Bug Hi, The health status is always unhealthy for the docker container of the hoarder-app. But the application is working correctly. I checked the healthcheck and found that the test fails : `/app # wget --spider http://127.0.0.1:3000/api/health` `Connecting to 127.0.0.1:3000 (127.0.0.1:3000)` `wget: can't connect to remote host (127.0.0.1): Connection refused` But if I use the actual @ip of the container it works : `/app # wget --spider http://172.24.0.5:3000/api/health` `Connecting to 172.24.0.5:3000 (172.24.0.5:3000)` `remote file exists` ### Steps to Reproduce Check the status of the hoarder-app container. ### Expected Behaviour healthcheck is OK ### Screenshots or Additional Context _No response_ ### Device Details _No response_ ### Exact Hoarder Version 0.18.0
kerem closed this issue 2026-03-02 11:49:30 +03:00
Author
Owner

@MohamedBassem commented on GitHub (Nov 7, 2024):

hmmm, that's interesting. Are you running the container in any special setup? Kubernetes, for example?

<!-- gh-comment-id:2461787457 --> @MohamedBassem commented on GitHub (Nov 7, 2024): hmmm, that's interesting. Are you running the container in any special setup? Kubernetes, for example?
Author
Owner

@hot22shot commented on GitHub (Nov 7, 2024):

My host is an unraid server with docker and I used portainer to deploy it with a stack.

<!-- gh-comment-id:2461809015 --> @hot22shot commented on GitHub (Nov 7, 2024): My host is an unraid server with docker and I used portainer to deploy it with a stack.
Author
Owner

@MohamedBassem commented on GitHub (Nov 7, 2024):

Are you using "network=host" by any chance?

<!-- gh-comment-id:2461857855 --> @MohamedBassem commented on GitHub (Nov 7, 2024): Are you using "network=host" by any chance?
Author
Owner

@hot22shot commented on GitHub (Nov 7, 2024):

no, I have a dedicated network for the stack :

networks:
  info-network:
    name: info-network
    driver: bridge
<!-- gh-comment-id:2461865238 --> @hot22shot commented on GitHub (Nov 7, 2024): no, I have a dedicated network for the stack : ``` networks: info-network: name: info-network driver: bridge ```
Author
Owner

@MohamedBassem commented on GitHub (Nov 7, 2024):

hmmm, interesting. Does using localhost work by any chance?

<!-- gh-comment-id:2461908599 --> @MohamedBassem commented on GitHub (Nov 7, 2024): hmmm, interesting. Does using localhost work by any chance?
Author
Owner

@hot22shot commented on GitHub (Nov 7, 2024):

localhost is also failing :

/app # wget --spider http://localhost:3000/api/health
Connecting to localhost:3000 ([::1]:3000)
wget: can't connect to remote host: Connection refused
<!-- gh-comment-id:2461923682 --> @hot22shot commented on GitHub (Nov 7, 2024): localhost is also failing : ``` /app # wget --spider http://localhost:3000/api/health Connecting to localhost:3000 ([::1]:3000) wget: can't connect to remote host: Connection refused ```
Author
Owner

@MohamedBassem commented on GitHub (Nov 7, 2024):

Ok this will need some googling I guess. Can you share your compose file for reference?

<!-- gh-comment-id:2461934039 --> @MohamedBassem commented on GitHub (Nov 7, 2024): Ok this will need some googling I guess. Can you share your compose file for reference?
Author
Owner

@hot22shot commented on GitHub (Nov 7, 2024):

I solved it, I had a HOSTNAME env variable set to "hoarder-app" in my docker-compose file, that conflicted with :

const hostname = process.env.HOSTNAME || '0.0.0.0'

in the server.js file.

It prevented hoarder from biding 0.0.0.0 and instead only binded the local address of the container.
Once I commented my variable in the docker compose script the container is now healthy !

<!-- gh-comment-id:2461943086 --> @hot22shot commented on GitHub (Nov 7, 2024): I solved it, I had a HOSTNAME env variable set to "hoarder-app" in my docker-compose file, that conflicted with : > const hostname = process.env.HOSTNAME || '0.0.0.0' in the server.js file. It prevented hoarder from biding 0.0.0.0 and instead only binded the local address of the container. Once I commented my variable in the docker compose script the container is now healthy !
Author
Owner

@MohamedBassem commented on GitHub (Nov 7, 2024):

ah that makes sense 👍

<!-- gh-comment-id:2461947722 --> @MohamedBassem commented on GitHub (Nov 7, 2024): ah that makes sense 👍
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#397
No description provided.