Proxmox lxc container nicht mehr vom Web erreichbar

Holger-Graef

New Member
Apr 18, 2024
11
0
1
Hallo zusammen,

seit Mitte letzter Woche ist ein, unter Proxmox laufender lxc container (erneut) nicht vom Web aus erreichbar.

Auf dem Container läuft Keycloak. Derzeit wird ein Zertifikatsfehler angezeigt, aber wenn man den umgeht, ist die Seite dennoch nicht erreichbar.

Über die Shell ist der Container erreichbar.

Wir hatten das gleiche Problem vor einigen Monaten schon einmal und fanden keine Lösung.

Daher haben wir Keycloak noch einmal ganz frisch aufgesetzt.

Wenn es jetzt mit Proxmox weitergehen soll, müssen wir den Fehler finden.

Das Zurückspielen eines Backups brachte keinen Erfolg. Somit gehe ich davon aus, dass das Problem nicht auf dem Container selber bzw. der Keycloak-Installation zu finden ist.

Ich wäre für jeden Tipp dankbar.

Viele Grüße
Holger
 
Last edited:
Hallo zusammen,

seit Mitte letzter Woche ist ein, unter Proxmox laufender lxc container (erneut) nicht vom Web aus erreichbar.

Auf dem Container läuft Keycloak. Derzeit wird ein Zertifikatsfehler angezeigt, aber wenn man den umgeht, ist die Seite dennoch nicht erreichbar.

Über die Shell ist der Container erreichbar.

Wir hatten das gleiche Problem vor einigen Monaten schon einmal und fanden keine Lösung.

Daher haben wir Keycloak noch einmal ganz frisch aufgesetzt.

Wenn es jetzt mit Proxmox weitergehen soll, müssen wir den Fehler finden.

Das Zurückspielen eines Backups brachte keinen Erfolg. Somit gehe ich davon aus, dass das Problem nicht auf dem Container selber bzw. der Keycloak-Installation zu finden ist.

Ich wäre für jeden Tipp dankbar.

Viele Grüße
Holger
Hallo,
wie ist das Netzwerk eingerichtet? Bitte den Output von cat /etc/network/interfaces und pct config VMID mit VMID des entsprechenden containers posten. Meine erste Vermutung ist die doppelte Vergabe einer IP Adresse, da ja ein service zumindest ein Zertifikat zu liefern scheint? Kann dies ausgeschlossen werden?
 
Hi Chris,

vielen herzlichen Dank für den superschnellen Support.

Hier die angeforderten Daten.

Code:
source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

iface lo inet6 loopback

iface eth0 inet manual

iface enp7s0 inet manual

auto vmbr0
iface vmbr0 inet static
        address 148.251.xxx.xxx/32
        gateway 148.251.xxx.xxx
        bridge-ports enp7s0
        bridge-stp off
        bridge-fd 1
        hwaddress 58:11:22:c4:xx:xx
        pointopoint 148.251.xxx.xxx
        bridge_hello 2
        bridge_maxage 12

auto vmbr1
iface vmbr1 inet manual
        bridge-ports none
        bridge-stp off
        bridge-fd 0
#LAN

auto vmbr2
iface vmbr2 inet static
        address 10.100.0.1/24
        bridge-ports none
        bridge-stp off
        bridge-fd 0
#internal

------------------

Code:
arch: amd64
cores: 2
features: keyctl=1,nesting=1
hostname: Keycloak2
memory: 8192
net0: name=eth0,bridge=vmbr0,firewall=1,gw=148.251.xxx.xxx,hwaddr=00:50:56:00:B0:3F,ip=148.251.xxx.xxx/24,type=veth
onboot: 1
ostype: ubuntu
rootfs: HDD:106/vm-106-disk-1.raw,size=128G
swap: 512
unprivileged: 1

Hinzuzufügen ist, dass das System nicht manuell verändert wurde. Der Fehler trat über Nacht auf. Eine doppelte IP-Vergabe sollte damit ausgeschlossen sein.

Viele Grüße
Holger
 
Last edited:
Ist der container via ping zu erreichen? Wenn ja, dann ist der Netzwerklayer in Ordnung (bitte auch public IPs in posts unkenntlich machen). Eventuell liefert ja das systemd journal im container mehr informationen weshalb die keycloack installation nicht erreichbar ist. journalctl -r -b liefert eine scrollbare Auflistung des Journals seit dem boot in umgekehrter Chronologie. Was liefert systemctl status keycloak? Wird ein reverse proxy eingesetzt?
 
Guten Morgen

Ping geht problemlos durch.
ping.png

Das Journal ist ja endlos lang. Ich habe es daher mal umgedreht und den Teil gepostet, der unmittelbar nach dem Bekanntwerden des Fehlers passierte. Morgens um 7:00 Uhr, als wir die Maschine neu gestartet haben, das Backup zurückgespielt haben etc.

Code:
Apr 09 07:05:04 Keycloak2 systemd-journald[42]: Journal started
Apr 09 07:05:04 Keycloak2 systemd-journald[42]: Runtime Journal (/run/log/journal/7>
Apr 09 07:05:04 Keycloak2 systemd-journald[42]: Time spent on flushing to /var/log/>
Apr 09 07:05:04 Keycloak2 systemd-journald[42]: System Journal (/var/log/journal/71>
Apr 09 07:05:04 Keycloak2 systemd[1]: Starting Flush Journal to Persistent Storage.>
Apr 09 07:05:04 Keycloak2 systemd[1]: Finished Create Static Device Nodes in /dev.
Apr 09 07:05:04 Keycloak2 systemd[1]: Condition check resulted in Rule-based Manage>
Apr 09 07:05:04 Keycloak2 systemd[1]: Finished Set the console keyboard layout.
Apr 09 07:05:04 Keycloak2 systemd[1]: Reached target Preparation for Local File Sys>
Apr 09 07:05:04 Keycloak2 systemd[1]: Reached target Local File Systems.
Apr 09 07:05:04 Keycloak2 keyboard-setup.sh[53]: Couldn't get a file descriptor ref>
Apr 09 07:05:04 Keycloak2 systemd[1]: Starting Load AppArmor profiles...
Apr 09 07:05:04 Keycloak2 keyboard-setup.sh[56]: Couldn't get a file descriptor ref>
Apr 09 07:05:04 Keycloak2 systemd[1]: Starting Set console font and keymap...
Apr 09 07:05:04 Keycloak2 keyboard-setup.sh[57]: Couldn't get a file descriptor ref>
Apr 09 07:05:04 Keycloak2 systemd[1]: Starting Set Up Additional Binary Formats...
Apr 09 07:05:04 Keycloak2 keyboard-setup.sh[58]: setupcon: We are not on the consol>
Apr 09 07:05:04 Keycloak2 systemd[1]: Condition check resulted in Store a System To>
Apr 09 07:05:04 Keycloak2 systemd[1]: Condition check resulted in Commit a transien>
Apr 09 07:05:04 Keycloak2 systemd[1]: Condition check resulted in Merge System Exte>
Apr 09 07:05:04 Keycloak2 systemd[1]: Starting Uncomplicated firewall...
Apr 09 07:05:04 Keycloak2 apparmor.systemd[75]: Restarting AppArmor
Apr 09 07:05:04 Keycloak2 apparmor.systemd[75]: Reloading AppArmor profiles
Apr 09 07:05:04 Keycloak2 systemd[1]: Finished nftables.
Apr 09 07:05:04 Keycloak2 apparmor.systemd[92]: Skipping profile in /etc/apparmor.d>
Apr 09 07:05:04 Keycloak2 systemd[1]: Finished Uncomplicated firewall.
Apr 09 07:05:04 Keycloak2 systemd[1]: Reached target Preparation for Network.
Apr 09 07:05:04 Keycloak2 systemd[1]: Starting Network Configuration...
Apr 09 07:05:04 Keycloak2 systemd[1]: Finished Set Up Additional Binary Formats.
Apr 09 07:05:04 Keycloak2 systemd[1]: Finished Set console font and keymap.
Apr 09 07:05:04 Keycloak2 systemd[1]: Finished Load AppArmor profiles.
Apr 09 07:05:04 Keycloak2 systemd-networkd[83]: Failed to increase receive buffer s>
Apr 09 07:05:04 Keycloak2 systemd-networkd[83]: lo: Link UP
Apr 09 07:05:04 Keycloak2 systemd-networkd[83]: lo: Gained carrier
Apr 09 07:05:04 Keycloak2 systemd-networkd[83]: Enumeration completed
Apr 09 07:05:04 Keycloak2 systemd[1]: Started Network Configuration.
Apr 09 07:05:04 Keycloak2 systemd[1]: Starting Wait for Network to be Configured...
Apr 09 07:05:04 Keycloak2 systemd-networkd[83]: eth0: Link UP
Apr 09 07:05:04 Keycloak2 systemd-networkd[83]: eth0: Gained carrier
Apr 09 07:05:04 Keycloak2 systemd[1]: Finished Flush Journal to Persistent Storage.
Apr 09 07:05:04 Keycloak2 systemd[1]: Starting Create Volatile Files and Directorie>
Apr 09 07:05:04 Keycloak2 systemd[1]: Finished Create Volatile Files and Directorie>
Apr 09 07:05:04 Keycloak2 systemd[1]: Starting Network Name Resolution...
Apr 09 07:05:04 Keycloak2 systemd[1]: Condition check resulted in Network Time Sync>
Apr 09 07:05:04 Keycloak2 systemd[1]: Reached target System Time Set.
Apr 09 07:05:04 Keycloak2 systemd[1]: Starting Record System Boot/Shutdown in UTMP.>
Apr 09 07:05:04 Keycloak2 cron[99]: (CRON) INFO (pidfile fd = 3)
Apr 09 07:05:04 Keycloak2 systemd[1]: Finished Record System Boot/Shutdown in UTMP.
Apr 09 07:05:04 Keycloak2 cron[99]: (CRON) INFO (Running @reboot jobs)
Apr 09 07:05:04 Keycloak2 systemd[1]: Reached target System Initialization.
Apr 09 07:05:04 Keycloak2 rsyslogd[104]: imuxsock: Acquired UNIX socket '/run/syste>
Apr 09 07:05:04 Keycloak2 systemd[1]: Started Daily apt download activities.
Apr 09 07:05:04 Keycloak2 rsyslogd[104]: imklog: cannot open kernel log (/proc/kmsg>
Apr 09 07:05:04 Keycloak2 systemd[1]: Started Daily apt upgrade and clean activitie>

systemctl status liefert folgende Meldung:

Code:
Keycloak2
    State: running
     Jobs: 0 queued
   Failed: 0 units
    Since: Tue 2024-04-09 07:05:03 UTC; 1 week 2 days ago
   CGroup: /
           ├─.lxc
           │ ├─176940 /bin/bash
           │ ├─176948 systemctl status
           │ └─176949 less
           ├─init.scope
           │ └─1 /sbin/init
           └─system.slice
             ├─containerd.service
             │ ├─ 124 /usr/bin/containerd
             │ ├─ 757 /usr/bin/containerd-shim-runc-v2 -namespace moby -id bae5d4f9>
             │ ├─ 917 /usr/bin/containerd-shim-runc-v2 -namespace moby -id f5fa0a99>
             │ └─1124 /usr/bin/containerd-shim-runc-v2 -namespace moby -id 8479ea2d>
             ├─systemd-networkd.service
             │ └─83 /lib/systemd/systemd-networkd
             ├─cron.service
             │ └─99 /usr/sbin/cron -f -P
             ├─docker-8479ea2d26f124848fd2a08649a6998fe0921ad89866dd19790f2cefb5e06>
             │ ├─  1145 /bin/bash /app/start.sh
             │ ├─  1515 /bin/bash /app/letsencrypt_service
             │ ├─  1516 docker-gen -watch -notify /app/signal_le_service -wait 5s:2>
             │ └─176897 sleep 3600
             ├─docker-f5fa0a9938da186886f9c44d2c901dcb2e2f1cb4c1b04540c8f72cf6102ec>
             │ ├─ 940 postgres
             │ ├─1115 postgres: checkpointer
             │ ├─1116 postgres: background writer
             │ ├─1980 postgres: walwriter
             │ ├─1981 postgres: autovacuum launcher
             │ └─1982 postgres: logical replication launcher
             ├─docker.service
             │ ├─136 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/contain>
             │ ├─686 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 4>
             │ ├─692 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 443 -c>
             │ ├─706 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8>
             │ └─712 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 80 -co>
             ├─networkd-dispatcher.service
             │ └─103 /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-tr>
             ├─systemd-journald.service
             │ └─42 /lib/systemd/systemd-journald
             ├─rsyslog.service
             │ └─104 /usr/sbin/rsyslogd -n -iNONE
             ├─console-getty.service
             │ └─125 /sbin/agetty -o -p -- \u --noclear --keep-baud console 115200,>
             ├─system-postfix.slice
             │ └─postfix@-.service
             │   ├─   303 /usr/lib/postfix/sbin/master -w
             │   ├─  1978 qmgr -l -t unix -u
             │   └─176528 pickup -l -t unix -u -c
             ├─systemd-resolved.service
             │ └─96 /lib/systemd/systemd-resolved
             ├─docker-bae5d4f919d8bab957ff9161236573b4ae4e999ef0e664843349d1d004ac4>
             │ ├─ 778 forego start -r
             │ ├─ 875 docker-gen -watch -notify nginx -s reload /app/nginx.tmpl /et>
             │ ├─ 879 nginx: master process nginx -g daemon off;
             │ ├─2147 nginx: worker process
             │ ├─2148 nginx: worker process
             │ ├─2149 nginx: worker process
             │ ├─2150 nginx: worker process
             │ ├─2151 nginx: worker process
             │ ├─2152 nginx: worker process
             │ ├─2154 nginx: worker process
             │ ├─2155 nginx: worker process
             │ ├─2156 nginx: worker process
             │ ├─2157 nginx: worker process
             │ ├─2158 nginx: worker process
             │ └─2159 nginx: worker process
             ├─system-container\x2dgetty.slice
             │ ├─container-getty@2.service
             │ │ └─127 /sbin/agetty -o -p -- \u --noclear --keep-baud tty2 115200,3>
             │ └─container-getty@1.service
             │   └─126 /sbin/agetty -o -p -- \u --noclear --keep-baud tty1 115200,3>
             ├─dbus.service
             │ └─100 @dbus-daemon --system --address=systemd: --nofork --nopidfile >
             └─systemd-logind.service
               └─105 /lib/systemd/systemd-logind

Eine Fehlermeldung fällt auf:

Code:
Apr 19 06:24:00 Keycloak2 sshd[176929]: error: kex_exchange_identification: Connect>

Also doch ein Zertifikatsproblem?

Ja, wir setzten einen Reverse Proxy ein.
 

Attachments

  • ping.png
    ping.png
    8.2 KB · Views: 3
Last edited:
Guten Morgen

Ping geht problemlos durch.
View attachment 66589

Das Journal ist ja endlos lang. Ich habe es daher mal umgedreht und den Teil gepostet, der unmittelbar nach dem Bekanntwerden des Fehlers passierte. Morgens um 7:00 Uhr, als wir die Maschine neu gestartet haben, das Backup zurückgespielt haben etc.

Code:
Apr 09 07:05:04 Keycloak2 systemd-journald[42]: Journal started
Apr 09 07:05:04 Keycloak2 systemd-journald[42]: Runtime Journal (/run/log/journal/7>
Apr 09 07:05:04 Keycloak2 systemd-journald[42]: Time spent on flushing to /var/log/>
Apr 09 07:05:04 Keycloak2 systemd-journald[42]: System Journal (/var/log/journal/71>
Apr 09 07:05:04 Keycloak2 systemd[1]: Starting Flush Journal to Persistent Storage.>
Apr 09 07:05:04 Keycloak2 systemd[1]: Finished Create Static Device Nodes in /dev.
Apr 09 07:05:04 Keycloak2 systemd[1]: Condition check resulted in Rule-based Manage>
Apr 09 07:05:04 Keycloak2 systemd[1]: Finished Set the console keyboard layout.
Apr 09 07:05:04 Keycloak2 systemd[1]: Reached target Preparation for Local File Sys>
Apr 09 07:05:04 Keycloak2 systemd[1]: Reached target Local File Systems.
Apr 09 07:05:04 Keycloak2 keyboard-setup.sh[53]: Couldn't get a file descriptor ref>
Apr 09 07:05:04 Keycloak2 systemd[1]: Starting Load AppArmor profiles...
Apr 09 07:05:04 Keycloak2 keyboard-setup.sh[56]: Couldn't get a file descriptor ref>
Apr 09 07:05:04 Keycloak2 systemd[1]: Starting Set console font and keymap...
Apr 09 07:05:04 Keycloak2 keyboard-setup.sh[57]: Couldn't get a file descriptor ref>
Apr 09 07:05:04 Keycloak2 systemd[1]: Starting Set Up Additional Binary Formats...
Apr 09 07:05:04 Keycloak2 keyboard-setup.sh[58]: setupcon: We are not on the consol>
Apr 09 07:05:04 Keycloak2 systemd[1]: Condition check resulted in Store a System To>
Apr 09 07:05:04 Keycloak2 systemd[1]: Condition check resulted in Commit a transien>
Apr 09 07:05:04 Keycloak2 systemd[1]: Condition check resulted in Merge System Exte>
Apr 09 07:05:04 Keycloak2 systemd[1]: Starting Uncomplicated firewall...
Apr 09 07:05:04 Keycloak2 apparmor.systemd[75]: Restarting AppArmor
Apr 09 07:05:04 Keycloak2 apparmor.systemd[75]: Reloading AppArmor profiles
Apr 09 07:05:04 Keycloak2 systemd[1]: Finished nftables.
Apr 09 07:05:04 Keycloak2 apparmor.systemd[92]: Skipping profile in /etc/apparmor.d>
Apr 09 07:05:04 Keycloak2 systemd[1]: Finished Uncomplicated firewall.
Apr 09 07:05:04 Keycloak2 systemd[1]: Reached target Preparation for Network.
Apr 09 07:05:04 Keycloak2 systemd[1]: Starting Network Configuration...
Apr 09 07:05:04 Keycloak2 systemd[1]: Finished Set Up Additional Binary Formats.
Apr 09 07:05:04 Keycloak2 systemd[1]: Finished Set console font and keymap.
Apr 09 07:05:04 Keycloak2 systemd[1]: Finished Load AppArmor profiles.
Apr 09 07:05:04 Keycloak2 systemd-networkd[83]: Failed to increase receive buffer s>
Apr 09 07:05:04 Keycloak2 systemd-networkd[83]: lo: Link UP
Apr 09 07:05:04 Keycloak2 systemd-networkd[83]: lo: Gained carrier
Apr 09 07:05:04 Keycloak2 systemd-networkd[83]: Enumeration completed
Apr 09 07:05:04 Keycloak2 systemd[1]: Started Network Configuration.
Apr 09 07:05:04 Keycloak2 systemd[1]: Starting Wait for Network to be Configured...
Apr 09 07:05:04 Keycloak2 systemd-networkd[83]: eth0: Link UP
Apr 09 07:05:04 Keycloak2 systemd-networkd[83]: eth0: Gained carrier
Apr 09 07:05:04 Keycloak2 systemd[1]: Finished Flush Journal to Persistent Storage.
Apr 09 07:05:04 Keycloak2 systemd[1]: Starting Create Volatile Files and Directorie>
Apr 09 07:05:04 Keycloak2 systemd[1]: Finished Create Volatile Files and Directorie>
Apr 09 07:05:04 Keycloak2 systemd[1]: Starting Network Name Resolution...
Apr 09 07:05:04 Keycloak2 systemd[1]: Condition check resulted in Network Time Sync>
Apr 09 07:05:04 Keycloak2 systemd[1]: Reached target System Time Set.
Apr 09 07:05:04 Keycloak2 systemd[1]: Starting Record System Boot/Shutdown in UTMP.>
Apr 09 07:05:04 Keycloak2 cron[99]: (CRON) INFO (pidfile fd = 3)
Apr 09 07:05:04 Keycloak2 systemd[1]: Finished Record System Boot/Shutdown in UTMP.
Apr 09 07:05:04 Keycloak2 cron[99]: (CRON) INFO (Running @reboot jobs)
Apr 09 07:05:04 Keycloak2 systemd[1]: Reached target System Initialization.
Apr 09 07:05:04 Keycloak2 rsyslogd[104]: imuxsock: Acquired UNIX socket '/run/syste>
Apr 09 07:05:04 Keycloak2 systemd[1]: Started Daily apt download activities.
Apr 09 07:05:04 Keycloak2 rsyslogd[104]: imklog: cannot open kernel log (/proc/kmsg>
Apr 09 07:05:04 Keycloak2 systemd[1]: Started Daily apt upgrade and clean activitie>

systemctl status liefert folgende Meldung:

Code:
Keycloak2
    State: running
     Jobs: 0 queued
   Failed: 0 units
    Since: Tue 2024-04-09 07:05:03 UTC; 1 week 2 days ago
   CGroup: /
           ├─.lxc
           │ ├─176940 /bin/bash
           │ ├─176948 systemctl status
           │ └─176949 less
           ├─init.scope
           │ └─1 /sbin/init
           └─system.slice
             ├─containerd.service
             │ ├─ 124 /usr/bin/containerd
             │ ├─ 757 /usr/bin/containerd-shim-runc-v2 -namespace moby -id bae5d4f9>
             │ ├─ 917 /usr/bin/containerd-shim-runc-v2 -namespace moby -id f5fa0a99>
             │ └─1124 /usr/bin/containerd-shim-runc-v2 -namespace moby -id 8479ea2d>
             ├─systemd-networkd.service
             │ └─83 /lib/systemd/systemd-networkd
             ├─cron.service
             │ └─99 /usr/sbin/cron -f -P
             ├─docker-8479ea2d26f124848fd2a08649a6998fe0921ad89866dd19790f2cefb5e06>
             │ ├─  1145 /bin/bash /app/start.sh
             │ ├─  1515 /bin/bash /app/letsencrypt_service
             │ ├─  1516 docker-gen -watch -notify /app/signal_le_service -wait 5s:2>
             │ └─176897 sleep 3600
             ├─docker-f5fa0a9938da186886f9c44d2c901dcb2e2f1cb4c1b04540c8f72cf6102ec>
             │ ├─ 940 postgres
             │ ├─1115 postgres: checkpointer
             │ ├─1116 postgres: background writer
             │ ├─1980 postgres: walwriter
             │ ├─1981 postgres: autovacuum launcher
             │ └─1982 postgres: logical replication launcher
             ├─docker.service
             │ ├─136 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/contain>
             │ ├─686 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 4>
             │ ├─692 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 443 -c>
             │ ├─706 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8>
             │ └─712 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 80 -co>
             ├─networkd-dispatcher.service
             │ └─103 /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-tr>
             ├─systemd-journald.service
             │ └─42 /lib/systemd/systemd-journald
             ├─rsyslog.service
             │ └─104 /usr/sbin/rsyslogd -n -iNONE
             ├─console-getty.service
             │ └─125 /sbin/agetty -o -p -- \u --noclear --keep-baud console 115200,>
             ├─system-postfix.slice
             │ └─postfix@-.service
             │   ├─   303 /usr/lib/postfix/sbin/master -w
             │   ├─  1978 qmgr -l -t unix -u
             │   └─176528 pickup -l -t unix -u -c
             ├─systemd-resolved.service
             │ └─96 /lib/systemd/systemd-resolved
             ├─docker-bae5d4f919d8bab957ff9161236573b4ae4e999ef0e664843349d1d004ac4>
             │ ├─ 778 forego start -r
             │ ├─ 875 docker-gen -watch -notify nginx -s reload /app/nginx.tmpl /et>
             │ ├─ 879 nginx: master process nginx -g daemon off;
             │ ├─2147 nginx: worker process
             │ ├─2148 nginx: worker process
             │ ├─2149 nginx: worker process
             │ ├─2150 nginx: worker process
             │ ├─2151 nginx: worker process
             │ ├─2152 nginx: worker process
             │ ├─2154 nginx: worker process
             │ ├─2155 nginx: worker process
             │ ├─2156 nginx: worker process
             │ ├─2157 nginx: worker process
             │ ├─2158 nginx: worker process
             │ └─2159 nginx: worker process
             ├─system-container\x2dgetty.slice
             │ ├─container-getty@2.service
             │ │ └─127 /sbin/agetty -o -p -- \u --noclear --keep-baud tty2 115200,3>
             │ └─container-getty@1.service
             │   └─126 /sbin/agetty -o -p -- \u --noclear --keep-baud tty1 115200,3>
             ├─dbus.service
             │ └─100 @dbus-daemon --system --address=systemd: --nofork --nopidfile >
             └─systemd-logind.service
               └─105 /lib/systemd/systemd-logind

Eine Fehlermeldung fällt auf:

Code:
Apr 19 06:24:00 Keycloak2 sshd[176929]: error: kex_exchange_identification: Connect>

Also doch ein Zertifikatsproblem?

Ja, wir setzten einen Reverse Proxy ein.
Ah okay, Docker services nested in einem LXC zu betreiben empfehlen wir nicht, das macht immer wieder Probleme, hierzu empfiehlt es sich eine VM zu verwenden.

Der gezeigte Fehler `kex_exchange_identification: Connect` ist leider abgeschnitten, betrifft aber nur die ssh Verbindung, vermutlich ein fehlgeschlagener Verbindungsversuch aus dem Internet (bitte unbedingt die Firewall rules checken).

Nachdem der LXC container soweit korrekt läuft und die Verbindung mit dem proxy zumindest hergestellt werden kann, ist vermutlich das Problem entweder beim proxy oder keycloak service im docker zu finden. Bitte den status und logs inner halb des entsprechenden docker containers verifizieren.
 
Ich vermute stark, wir haben den Fehler gefunden. Siehe Logs. Vielen herzlichen Dank dafür. Hier die letzten Logs aus dem Docker Container postgres:

Code:
PostgreSQL Database directory appears to contain a database; Skipping initialization

2024-04-09 07:16:21.266 UTC [1] LOG:  starting PostgreSQL 15.6 (Debian 15.6-1.pgdg120+2) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-04-09 07:16:21.266 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-04-09 07:16:21.266 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-04-09 07:16:21.479 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-04-09 07:16:21.722 UTC [28] LOG:  database system was interrupted; last known up at 2024-03-29 16:29:40 UTC
2024-04-09 07:16:24.077 UTC [28] LOG:  database system was not properly shut down; automatic recovery in progress
2024-04-09 07:16:24.210 UTC [28] LOG:  redo starts at 0/2468E08
2024-04-09 07:16:24.210 UTC [28] LOG:  invalid record length at 0/2468EF0: wanted 24, got 0
2024-04-09 07:16:24.210 UTC [28] LOG:  redo done at 0/2468EB8 system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s
2024-04-09 07:16:24.302 UTC [29] FATAL:  the database system is not yet accepting connections
2024-04-09 07:16:24.302 UTC [29] DETAIL:  Consistent recovery state has not been yet reached.
2024-04-09 07:16:24.819 UTC [26] LOG:  checkpoint starting: end-of-recovery immediate wait
2024-04-09 07:16:24.955 UTC [30] FATAL:  the database system is not yet accepting connections
2024-04-09 07:16:24.955 UTC [30] DETAIL:  Consistent recovery state has not been yet reached.
2024-04-09 07:16:26.447 UTC [26] LOG:  checkpoint complete: wrote 2 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.427 s, sync=0.426 s, total=1.737 s; sync files=3, longest=0.167 s, average=0.142 s; distance=0 kB, estimate=0 kB
2024-04-09 07:16:26.666 UTC [1] LOG:  database system is ready to accept connections
root@Keycloak2:~#

Und hier die Logs aus dem Docker-Container acme-proxy:

Code:
2024/04/09 07:16:23 Contents of /app/letsencrypt_service_data did not change. Skipping notification '/app/signal_le_service'
Creating/renewal auth.it-xxxxxxx.de certificates... (auth.it-xxxxx.de)
[Tue Apr  9 07:16:23 UTC 2024] Domains not changed.
[Tue Apr  9 07:16:23 UTC 2024] Skip, Next renewal time is: 2024-04-18T16:08:22Z
[Tue Apr  9 07:16:23 UTC 2024] Add '--force' to force to renew.
Sleep for 3600s
2024/04/09 07:16:26 Received event die for container fee067407ea8
2024/04/09 07:16:31 Debounce minTimer fired
2024/04/09 07:16:31 Generated '/app/letsencrypt_service_data' from 3 containers
2024/04/09 07:16:31 Running '/app/signal_le_service'
Reloading nginx proxy (bae5d4f919d8bab957ff9161236573b4ae4e999ef0e664843349d1d004ac469a)...
2024/04/09 07:16:32 Generated '/etc/nginx/conf.d/default.conf' from 3 containers
2024/04/09 07:16:32 [notice] 100#100: signal process started
Sleep for 3600s
Sleep for 3600s
Sleep for 3600s
Sleep for 3600s
Sleep for 3600s
Sleep for 3600s
Sleep for 3600s
Sleep for 3600s

Wie bekomme ich das jetzt wieder zum Laufen? Einfach certbot im Docker-Container manuell starten?
 
Last edited:
Da ist die Systemzeit wohl nicht synchronisiert, bitte NTP service checken.
systemctl status ntp
Unit ntp.service could not be found. (Habe ich da etwas falsch gemacht? Dazu muss ich raus aus Proxmox und eine Stufe höher per SSH rein, oder? Dazu habe ich leider keine Zugangdaten)

root@pve ~ # date
Fri Apr 19 01:39:03 PM CEST 2024

root@Keycloak2:~# date
Fri Apr 19 11:39:52 UTC 2024

Usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG...]

Execute a command in a running container
root@Keycloak2:~# date
Fri Apr 19 11:41:04 UTC 2024

Tatsächlich hinkt die Systemzeit um zwei Stunden.
 
Last edited:
Da ist die Systemzeit wohl nicht synchronisiert, bitte NTP service checken.
Hmmm...

Code:
root@Keycloak2:~# timedatectl status
               Local time: Mon 2024-04-22 07:47:37 UTC
           Universal time: Mon 2024-04-22 07:47:37 UTC
                 RTC time: n/a
                Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: yes
              NTP service: inactive
          RTC in local TZ: no
root@Keycloak2:~#
 
Unit ntp.service could not be found. (Habe ich da etwas falsch gemacht? Dazu muss ich raus aus Proxmox und eine Stufe höher per SSH rein, oder? Dazu habe ich leider keine Zugangdaten)
Na ja, wie das service genau heißt, hängt davon ab welches in der Dockerumgebung genau genutzt wird, systemd-timesyncd, chrony, ...

Da das Zertifikat im docker gemanagt und somit auch renewed wird, muss zumindest dort die Systemzeit passed (tut sie scheinbar auch, ist vermutlich also nicht die Ursache). Ein manuelles renew ist eventuell angebracht, falls das Zertifikat nicht mehr gültig ist.
 
Na ja, wie das service genau heißt, hängt davon ab welches in der Dockerumgebung genau genutzt wird, systemd-timesyncd, chrony, ...

Da das Zertifikat im docker gemanagt und somit auch renewed wird, muss zumindest dort die Systemzeit passed (tut sie scheinbar auch, ist vermutlich also nicht die Ursache). Ein manuelles renew ist eventuell angebracht, falls das Zertifikat nicht mehr gültig ist.
Nein, tut sie leider nicht. Die Zeit stimmt im ganzen Keycloak-Container nicht. Und systemd-timesyncd lässt sich nicht starten.
Code:
root@Keycloak2:~# systemctl restart systemd-timesyncd
root@Keycloak2:~# systemctl status systemd-timesyncd
○ systemd-timesyncd.service - Network Time Synchronization
     Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: en>
     Active: inactive (dead)
  Condition: start condition failed at Mon 2024-04-22 08:56:59 UTC; 20s ago
             └─ ConditionVirtualization=!container was not met
       Docs: man:systemd-timesyncd.service(8)
 
Nein, tut sie leider nicht. Die Zeit stimmt im ganzen Keycloak-Container nicht. Und systemd-timesyncd lässt sich nicht starten.
Code:
root@Keycloak2:~# systemctl restart systemd-timesyncd
root@Keycloak2:~# systemctl status systemd-timesyncd
○ systemd-timesyncd.service - Network Time Synchronization
     Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: en>
     Active: inactive (dead)
  Condition: start condition failed at Mon 2024-04-22 08:56:59 UTC; 20s ago
             └─ ConditionVirtualization=!container was not met
       Docs: man:systemd-timesyncd.service(8)
Die Zeit scheint aber zu passen (wobei ich kann nichts zur exakten, minutengenauen Zeit sagen)? Bitte beachten, die Urzeit ist hier in UTC gegeben.
 
Last edited:
Die Zeit scheint aber zu passen (wobei ich kann nichts zur exakten, minutengenauen Zeit sagen)? Bitte beachten, die Urzeit ist hier in UTC gegeben.
Die fehlerhafte Zeit habe ich inzwischen repariert.

Es funktioniert aber leider immer noch nicht.

Die Seite zeigt einen NET::ERR_CERT_AUTHORITY_INVALID Fehler an. Das Zertifikat ist aber gültig und liegt im Docker-Container acme-proxy
 
Update: Ich habe die Systemzeit im Proxmox-Container erfolgreich aktualisiert, aber leider nicht im docker-container.

Habe versucht, das Zertifikat neu auszustellen. Funktionierte nicht:

Code:
2024/04/22 10:18:35 Received signal: terminated
2024/04/22 10:18:35 Received signal: terminated
Info: running acme-companion version v2.2.10-11-g30ea718
Info: 4096 bits RFC7919 Diffie-Hellman group found, generation skipped.
Reloading nginx proxy (bae5d4f919d8bab957ff9161236573b4ae4e999ef0e664843349d1d004ac469a)...
2024/04/22 10:18:40 Generated '/etc/nginx/conf.d/default.conf' from 3 containers
2024/04/22 10:18:40 [notice] 140#140: signal process started
Sleep for 3600s
2024/04/22 10:18:40 Contents of /app/letsencrypt_service_data did not change. Skipping notification '/app/signal_le_service'
2024/04/22 10:18:40 Watching docker events
2024/04/22 10:18:40 Contents of /app/letsencrypt_service_data did not change. Skipping notification '/app/signal_le_service'
2024/04/22 10:18:56 Received event stop for container bae5d4f919d8
2024/04/22 10:18:56 Received event die for container bae5d4f919d8
2024/04/22 10:18:58 Received event start for container bae5d4f919d8
2024/04/22 10:19:03 Debounce minTimer fired
2024/04/22 10:19:03 Contents of /app/letsencrypt_service_data did not change. Skipping notification '/app/signal_le_service'
root@Keycloak2:~#

Dort steht, ich hätte das um 10:18 Uhr veranlasst. Es ist aber um 12:18 Uhr gewesen.

Die Synchronisation via docker exec -it acme-proxy date -s "$(date -u +"%Y-%m-%d %H:%M:%S")" wird mit einem

Code:
root@Keycloak2:~# docker exec -it acme-proxy date -s "$(date -u +"%Y-%m-%d %H:%M:%S")"
date: cannot set date: Operation not permitted
Mon Apr 22 10:26:36 UTC 2024
root@Keycloak2:~

quittiert.

Das Zertifikat ist komplett fehlerhaft und lässt sich nicht erneuern. Weder durch Neustart der Container, noch durch
docker exec -it acme-proxy /app/force_renew

Edit:

Nun habe ich das Zertifikat gelöscht, aber es wird mir auf allen Browsern weiterhin angezeigt. Am chache liegt es nicht.
 
Last edited:
Der Zertifikatsfehler ist jetzt weg. Irgendwas hatte default.cert in die nginx conf geschrieben. Habe das geändert.

Nach wie vor aber ein 503er Fehler

Code:
# nginx-proxy version : 1.5.1
# Networks available to the container running docker-gen (which are assumed to
# match the networks available to the container running nginx):
#     keycloak-docker-compose_internal
# If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the
# scheme used to connect to this server
map $http_x_forwarded_proto $proxy_x_forwarded_proto {
    default $http_x_forwarded_proto;
    '' $scheme;
}
map $http_x_forwarded_host $proxy_x_forwarded_host {
    default $http_x_forwarded_host;
    '' $host;
}
# If we receive X-Forwarded-Port, pass it through; otherwise, pass along the
# server port the client connected to
map $http_x_forwarded_port $proxy_x_forwarded_port {
    default $http_x_forwarded_port;
    '' $server_port;
}
# Include the port in the Host header sent to the container if it is non-standard
map $server_port $host_port {
    default :$server_port;
    80 '';
    443 '';
}
# If the request from the downstream client has an "Upgrade:" header (set to any
# non-empty value), pass "Connection: upgrade" to the upstream (backend) server.
# Otherwise, the value for the "Connection" header depends on whether the user
# has enabled keepalive to the upstream server.
map $http_upgrade $proxy_connection {
    default upgrade;
    '' $proxy_connection_noupgrade;
}
map $upstream_keepalive $proxy_connection_noupgrade {
    # Preserve nginx's default behavior (send "Connection: close").
    default close;
    # Use an empty string to cancel nginx's default behavior.
    true '';
}
# Abuse the map directive (see <https://stackoverflow.com/q/14433309>) to ensure
# that $upstream_keepalive is always defined.  This is necessary because:
#   - The $proxy_connection variable is indirectly derived from
#     $upstream_keepalive, so $upstream_keepalive must be defined whenever
#     $proxy_connection is resolved.
#   - The $proxy_connection variable is used in a proxy_set_header directive in
#     the http block, so it is always fully resolved for every request -- even
#     those where proxy_pass is not used (e.g., unknown virtual host).
map "" $upstream_keepalive {
    # The value here should not matter because it should always be overridden in
    # a location block (see the "location" template) for all requests where the
    # value actually matters.
    default false;
}
# Apply fix for very long server names
server_names_hash_bucket_size 128;
# Default dhparam
ssl_dhparam /etc/nginx/dhparam/dhparam.pem;
# Set appropriate X-Forwarded-Ssl header based on $proxy_x_forwarded_proto
map $proxy_x_forwarded_proto $proxy_x_forwarded_ssl {
    default off;
    https on;
}
gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
log_format vhost escape=default '$host $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$upstream_addr"';
access_log off;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305';
    ssl_prefer_server_ciphers off;
error_log /dev/stderr;
resolver 127.0.0.11;
# HTTP 1.1 support
proxy_http_version 1.1;
proxy_set_header Host $host$host_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $proxy_x_forwarded_host;
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl;
proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;
proxy_set_header X-Original-URI $request_uri;
# Mitigate httpoxy attack (see README for details)
proxy_set_header Proxy "";
server {
    server_name _; # This is just an invalid value which will never trigger on a real hostname.
    server_tokens off;
    access_log /var/log/nginx/access.log vhost;
    http2 on;
    listen 80;
    listen 443 ssl;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/auth.xxxx.de/fullchain.pem;
    ssl_certificate_key /etc/nginx/certs/auth.xxxx.de/key.pem;
    return 503;

Woran kann das bloß liegen?
 
Ich habe eben gesehen, dass der gesamte keycloak docker container nicht aufgelistet wird. Habe ihn zu starten versucht und dann umbenannt und aus einem image neu angelegt. Wieder zu starten versucht.

Jedes Mal, wenn ich ihn starte, werden falsche Zertifikate bei nginx eingetragen. Aber via docker ps wird er nicht aufgelistet.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!