abesnier / docker-guacamole

A self-contained guacamole docker container for x64. Remotely connect over SSH, RDP or VNC using HTML5.
https://hub.docker.com/r/abesnier/guacamole
GNU General Public License v3.0
78 stars 14 forks source link

Container won't start #14

Closed bearylabs closed 1 year ago

bearylabs commented 1 year ago

How can I delete this issue? Somehow it works now.

abesnier commented 1 year ago

Hi.

I'll still copy/paste your initial issue here, for future reference, and my answer at the bottom.

Original question:

Hey I could not get the container startet. I am new to this, so I cannot provide a lot of info, as I don't know how. But this is my terminal output:

docker run
-p 8012:8080
-v /test001:/config
-e "EXTENSIONS=auth-ldap,auth-duo"
abesnier/guacamole
Unable to find image 'abesnier/guacamole:latest' locally
latest: Pulling from abesnier/guacamole
b2ddfd337773: Pull complete
35794a35c4aa: Pull complete
261269474501: Pull complete
48a873c16c38: Pull complete
c171da1e14ca: Pull complete
093a1ba78688: Pull complete
318f6e8d20ce: Pull complete
66304ac76846: Pull complete
f6ae1fed6ebd: Pull complete
19e0f588ec44: Pull complete
3b80d32bf8c7: Pull complete
ee116a3b6f67: Pull complete
a4db1235a8aa: Pull complete
Digest: sha256:b4f5fe54c365927eb6d3d6ed5d82336b3e226f2ab192cebbe46a6802b9ffded2
Status: Downloaded newer image for abesnier/guacamole:latest
s6-rc: info: service s6rc-fdholder: starting
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service s6rc-fdholder successfully started
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/30-defaults.sh
cont-init: info: /etc/cont-init.d/30-defaults.sh exited 0
cont-init: info: running /etc/cont-init.d/40-postgres.sh
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /config/postgres ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... s6-rc: fatal: timed out
s6-sudoc: fatal: unable to get exit status from server: Operation timed out
ok

Success. You can now start the database server using:

/usr/lib/postgresql/13/bin/pg_ctl -D /config/postgres -l logfile start

initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
^Cs6-rc: info: service fix-attrs: stopping
s6-rc: info: service s6rc-fdholder: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-fdholder successfully stopped
s6-rc: info: service s6rc-oneshot-runner successfully stopped

I hope you could help me, thank you!

So, the answer is... I don't really know. I have been faced with this issue a few times during testing, and was never able to replicate consistently. What seems to happen is that postgresql server fails to start properly, or at least takes too long to do so, and S6 (an execution overlay) does not get a proper response int time, and aborts the start-up process.

Another thing is that I am an idiot. One way to mitigate how long S6 Overlay waits for an answer is to tell it how long to wait for an answer... All the images (latest-pg14, bullseye, and alpine) do this. All, EXCEPT the main image! (which will be corrected very soon, now that I noticed!)

As for the user, usually, trying to restart the container does indeed work, as postgresql has already created all the files it needs (in your case in the test001/postgres directory), and I believe that is why the Postgresql server starts faster, and S6 overlay does get a response in time.

Cheers

Antoine