Coder Social home page Coder Social logo

Comments (15)

Xachman avatar Xachman commented on August 16, 2024 2

changing to postgress:9.6.9

and running ./reset.sh then ./prepare.sh has fixed the issue. I also set 777 permissions on the init folder.

This seems to still be an issue and some solution should be applied to the repo.

from guacamole-docker-compose.

boschkundendienst avatar boschkundendienst commented on August 16, 2024 1

Hi,

this error has nothing to do with the previous bug here. Please open a separate one if needed.

The error you get is from

docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh --postgres > ./init/initdb.sql

where docker pulls the guacamole image and starts a container to init the database. I would assume something is wrong with running a container or downloading images from the internet.

from guacamole-docker-compose.

tablatronix avatar tablatronix commented on August 16, 2024 1

The end error is similar in logs, role guacamole does not exist.. I will investigate more, I think the image I was using was wrong, i had trouble finding a guac client for armv8, not an all in one image.

from guacamole-docker-compose.

boschkundendienst avatar boschkundendienst commented on August 16, 2024

Hi,

could you try to specify the Postgres Image like this to force using of 9.6.9?

...
  # postgres
  postgres:
    container_name: postgres_guacamole_compose
    environment:
      PGDATA: /var/lib/postgresql/data/guacamole
      POSTGRES_DB: guacamole_db
      POSTGRES_PASSWORD: ChooseYourOwnPasswordHere1234
      POSTGRES_USER: guacamole_user
    image: postgres:9.6.9
    networks:
      guacnetwork_compose:
    restart: always
    volumes:
    - ./init:/docker-entrypoint-initdb.d:ro
    - ./data:/var/lib/postgresql/data:rw
...

So effectively change image: postgres to image: postgres:9.6.9 and retry?

Also be aware, that if the containers are rebuilt with updated images it might be necessary to update the SQL Schema as described here (adopt to your installation):

Regards

Peter

from guacamole-docker-compose.

Starli0n avatar Starli0n commented on August 16, 2024

Hi,

I retried with the specific version of postgres 9.6.9 but it changed nothing as I still have the same error.

I made a reset before, deleted all the files that were generated.

I am not sure what to do with the link you provided with, knowing that I am starting from scratch.

In the same way, what are the tags I should use for the two other images ?

  • guacamole/guacd
  • guacamole/guacamole

from guacamole-docker-compose.

Starli0n avatar Starli0n commented on August 16, 2024

I made another test by skipping the generation of the initdb.sql and I also have the same error.

So it seems that the postgres image does not take into account the script at the first run.

I do not know what to do to initiate the database with the script.

from guacamole-docker-compose.

Starli0n avatar Starli0n commented on August 16, 2024

Actually, it was a permission issue and so /docker-entrypoint-initdb.d was skipped in the first place

I had a umask initially set to 077 and I set it to 0022 like the one defined inside the postgres image

This solved my issue

umask 0022

So the init folder and initdb.sql were set with the right permissions before starting the container

I tested with the last tags:

  • GUACD_TAG=0.9.14
  • GUACAMOLE_TAG=0.9.14
  • POSTGRES_TAG=11.1

Thank you so much for your help

from guacamole-docker-compose.

Xachman avatar Xachman commented on August 16, 2024

Im getting this too while following the instructions

from guacamole-docker-compose.

Xachman avatar Xachman commented on August 16, 2024

umask for me is 0022

from guacamole-docker-compose.

Xachman avatar Xachman commented on August 16, 2024
postgres_guacamole_compose | PostgreSQL Database directory appears to contain a database; Skipping initialization

this seems to be the related error in the logs

from guacamole-docker-compose.

boschkundendienst avatar boschkundendienst commented on August 16, 2024

The prepare.sh script does not create a database, it just creates a "database setup script" using the commands from /opt/guacamole/bin/initdb.sh.

/opt/guacamole/bin/initdb.sh is shipped with guacamole and prepare.sh just calls it.

The result is ./init/initdb.sql

The official documentation for the postgresql docker image explains how to initialize a database when postgres ist started by placing initialization scripts in /docker-entrypoint-initdb.d.

The prepare.sh script uses an official script from guacamole (/opt/guacamole/bin/initdb.sh) to create initdb.sql. initdb.sql is then located in ./init/initdb.sql.

In docker-compose.yml, the folder ./init is mounted read-only into the postgres container as /docker-entrypoint-initdb.d.

When postgres starts, it recognizes the initalization scripts and creates the database in /var/lib/postgresql/data inside the container (./data outside of the container)

As also stated in the official documentation for the postgresql docker image:

Quote:
scripts in /docker-entrypoint-initdb.d are only run if you start the container with a data directory that is empty; any pre-existing database will be left untouched on container startup

So I assume somehow you tried setting up guacamole using my scripts, a database has been created in ./data and that causes the error and of course using reset.sh will remove the database and things will work.

I hope I could clarify things and my assumptions were correct.

So this then is not a problem with this repo but with your local setup.

If you still have this problem (on a brand new system with a working docker environment, where the scripts never ran before), feel free to contact me again.

from guacamole-docker-compose.

tablatronix avatar tablatronix commented on August 16, 2024

So whats this then when running prepare ?

ifelse: fatal: unable to exec /opt/guacamole/bin/initdb.sh: No such file or directory

from guacamole-docker-compose.

connwork avatar connwork commented on August 16, 2024

I'm dealing with this same issue.

I deleted all docker containers, completely cleared out the persistent volumes, and am getting this on reinstall.

I'm not sure how deleting all persistent data, dockers, everything, can still lead to some leftover database issue that prevents seamless reinstall.

Is it possibly related to this line in the postgres docker?
/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*

from guacamole-docker-compose.

starnutoditopo avatar starnutoditopo commented on August 16, 2024

If it can help, I just deleted the data and init directories, so that PostgreSql could recreate its files, then restarted the whole environment with docker compose ... up

from guacamole-docker-compose.

boschkundendienst avatar boschkundendienst commented on August 16, 2024

I'm dealing with this same issue.

I deleted all docker containers, completely cleared out the persistent volumes, and am getting this on reinstall.

I'm not sure how deleting all persistent data, dockers, everything, can still lead to some leftover database issue that prevents seamless reinstall.

Is it possibly related to this line in the postgres docker? /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*

That's absolutely right.
The database handling is as follows (from my understanding of the guacamole containers and postgres containers):

Guacamole needs a database that has a specific scheme. That's why they created the initdb.sh file which is included in the guacamole container. My prepare.sh script executes this initdb.sh file to create initdb.sql as a result.

The posgres container looks for an initdb.sql file in /docker-entrypoint-initdb.d/ folder. If it finds one, it executes it at startup (if no databse is present). With this mechanism the postgres database is ready for Guacamole.
When the database has been created, postgres no longer executes the initdb.sql at startup, since a database is already present.
So if you "initialized" the database once restarting Guacamole with docker-compose would not delete/overwrite/re-initialize the database. That's absolutely perfect since you don't want to overwrite an existing database that might already have connections and users configured. Even re-running prepare.sh would not harm the database since even the initdb.sql file is recreated postgres will not initialize the database again since it is already present.

If you want to start from scratch (lose everything) and you used the original version of my project you only have to

  • stop the containers (docker-compose down)
  • execute reset.sh

But be careful! reset.sh will completely remove the folder ./init (that holds the initdb.sql) and also the folders ./data/, ./record/ and ./nginx/ssl so the entire database, existing recordings and the SSL certificates will be deleted.

To start again after running reset.sh you have to re-run prepare.sh. After that when starting up with docker-compose up -d you would have a fresh installation of Guacamole.

from guacamole-docker-compose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.