Skip to content

Hetzner Target Unhealthy #104

Closed
Closed

Description

@nelsonic

2/3 of the Postgres Servers in the Autobase cluster are unhealthy:

Image Image

The Hetzner interface is not very good at clarifying why they are "unhealthy" or what that even means ... 🤷‍♂

So we need to investigate by logging into the machines (SSH) and figuring this out. 🔍

Activity

  1. added
    research
    on Mar 20, 2025
  2. self-assigned this
    on Mar 20, 2025
  3. added theissue type on Mar 20, 2025
  4. moved this to More ToDo ThanCanEver Be Done in Nelson's Liston Mar 20, 2025
  5. nelsonic commented on Mar 21, 2025

    @nelsonic
    MemberAuthor
  6. moved this from More ToDo ThanCanEver Be Done to In progress in Nelson's Liston Mar 21, 2025
  7. nelsonic commented on Mar 21, 2025

    @nelsonic
    MemberAuthor
    *** System restart required ***
    

    https://askubuntu.com/questions/258297/should-i-always-restart-the-system-when-i-see-system-restart-required

    sudo reboot
    Broadcast message from root@ubuntu-4gb-fsn1-2-autobase-console on pts/1 (Fri 2025-03-21 05:54:50 UTC):
    
    The system will reboot now!
  8. nelsonic commented on Mar 21, 2025

    @nelsonic
    MemberAuthor
    114 updates can be applied immediately.
    1 of these updates is a standard security update.

    https://askubuntu.com/questions/449032/29-packages-can-be-updated-how

    sudo apt-get update
    sudo apt-get upgrade

    Took a few minutes. ⏳
    Everything up-to-date now. ✅

    0 updates can be applied immediately.
  9. nelsonic commented on Mar 21, 2025

    @nelsonic
    MemberAuthor

    Now I'm going to SSH into each of the Nodes in the cluster and run the same updates.

  10. nelsonic commented on Mar 21, 2025

    @nelsonic
    MemberAuthor

    On the first node in the cluster, executed:

    sudo apt-get upgrade

    Got:

    Setting up pgbouncer (1.24.0-3.pgdg24.04+1) ...
    
    Configuration file '/etc/pgbouncer/pgbouncer.ini'
     ==> Modified (by you or by a script) since installation.
     ==> Package distributor has shipped an updated version.
       What would you like to do about it ?  Your options are:
        Y or I  : install the package maintainer's version
        N or O  : keep your currently-installed version
          D     : show the differences between the versions
          Z     : start a shell to examine the situation
     The default action is to keep your current version.
    *** pgbouncer.ini (Y/I/N/O/D/Z) [default=N] ?

    Chose N to keep the currently-installed version.

    Then:

    sudo reboot

    Did this for all 3 nodes in the cluster. ✅

  11. 1 remaining item

  12. nelsonic commented on Mar 21, 2025

    @nelsonic
    MemberAuthor

    Decided to DELETE the postgres-cluster-01-replica (Replica Load Balancer) because it's not needed:

    Image
  13. nelsonic commented on Mar 21, 2025

    @nelsonic
    MemberAuthor

    So now we only have the one Load Balancer:
    https://console.hetzner.cloud/projects/3886115/loadbalancers/2226998/overview

    Image

    No progress on the "health" of the 2/3 targets. ⏳

  14. nelsonic commented on Mar 21, 2025

    @nelsonic
    MemberAuthor

    I've done a bit of googling: "hetzner load balancer targets unhealthy" etc. 🔍
    But none of the Reddit pages were helpful. 🙅

    Reading: https://gitlab.com/postgres-ai/postgres-checkup

  15. nelsonic commented on Mar 21, 2025

    @nelsonic
    MemberAuthor

    Better reading than the README of the project: https://postgres.ai/docs/checkup

  16. nelsonic commented on Mar 21, 2025

    @nelsonic
    MemberAuthor
  17. nelsonic commented on Mar 21, 2025

    @nelsonic
    MemberAuthor

    Viewing the Autobase dashboard:

    Image

    Status is "healthy" ...

    And viewing the cluster there is no additional info or reason for concern:

    Image
  18. nelsonic commented on Mar 21, 2025

    @nelsonic
    MemberAuthor

    note: yes, it bugs me too that the Autobase console is http not https (i.e. insecure) by default ... 😕

    Image

    Attempting to view the page with https fails:

    Image

    I feel like this needs to be addressed as P1 because MITM is inevitable.

  19. nelsonic commented on Mar 21, 2025

    @nelsonic
    MemberAuthor

    Feel like I need to address the insecure (by default) Autobase console issue as a priority ... 🔥 🧑‍🚒
    If anyone between me and the server (quite a few hops) intercepts the request they can use it to gain access to the Hetzner API keys and spin up servers for any nefarious purpose ... 😕

  20. nelsonic commented on Mar 21, 2025

    @nelsonic
    MemberAuthor

    Side-quest: #105

  21. nelsonic commented on Mar 23, 2025

    @nelsonic
    MemberAuthor

    A couple of days later after updates & reboots of the servers and nothing has changed on the "health" front:

    Image

    I will continue investigating. 🔍

  22. nelsonic commented on Mar 25, 2025

    @nelsonic
    MemberAuthor

    autobase reports the cluster as healthy:
    https://autobase.dwy.is/clusters
    Image

    Closing as there's nothing else I can do on this. 🙃

  23. moved this from In progress to Done in Nelson's Liston Mar 25, 2025
  24. vitabaks commented on Jun 5, 2025

    @vitabaks

    @nelsonic Hi! Just a quick clarification to avoid confusion:

    The /primary health check endpoint on port 8008 is designed to return HTTP 200 only on the current primary node. This is intentional, as there can be only one primary in a Patroni-managed PostgreSQL cluster. Conversely, the /replica endpoint returns 200 on replica nodes.   

    This behavior is leveraged by load balancers to route traffic appropriately: 

    • Write traffic is directed to the node where /primary returns 200.
    • Read traffic is distributed among nodes where /replica returns 200. 

    For a visual representation of this load balancing logic, refer to the diagram below:

    Image

    This setup ensures that clients always connect to the appropriate node based on their read/write requirements. 

    Source code: https://github.com/vitabaks/autobase/blob/2.2.0/automation/roles/cloud-resources/tasks/hetzner.yml#L550-L559

  25. nelsonic commented on Jun 16, 2025

    @nelsonic
    MemberAuthor

    @vitabaks great diagram + explanation. Thanks. 👌

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

Metadata

Metadata

Assignees

Labels

chorehelp wantedpriority-1researchtechnical

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions