DmitryZagr / guacamole-docker-compose

32 stars 11 forks source link

ERROR: relation "guacamole_user" does not exist at character 505 #4

Closed Starli0n closed 6 years ago

Starli0n commented 6 years ago

Hi,

The project does not work out of the box anymore

After a docker-compose up -d, I have the following error while trying to connect to the url:

http://ip-server:8080/guacamole

$ docker logs postgres_guacamole_compose -f
2018-11-13 14:51:13.309 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2018-11-13 14:51:13.309 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2018-11-13 14:51:13.387 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2018-11-13 14:51:13.418 UTC [20] LOG:  database system was shut down at 2018-11-13 14:50:37 UTC
2018-11-13 14:51:13.562 UTC [1] LOG:  database system is ready to accept connections
2018-11-13 14:52:34.566 UTC [29] ERROR:  relation "guacamole_user" does not exist at character 505
2018-11-13 14:52:34.566 UTC [29] STATEMENT:  SELECT
                    guacamole_user.user_id,
                    guacamole_user.username,
                    password_hash,
                    password_salt,
                    password_date,
                    disabled,
                    expired,
                    access_window_start,
                    access_window_end,
                    valid_from,
                    valid_until,
                    timezone,
                    full_name,
                    email_address,
                    organization,
                    organizational_role,
                    MAX(start_date) AS last_active
                FROM guacamole_user
                LEFT JOIN guacamole_user_history ON guacamole_user_history.user_id = guacamole_user.user_id
                WHERE
                    guacamole_user.username = $1
                GROUP BY guacamole_user.user_id

Nevertheless, I have the correct Apache Tomcat home page at the address:

http://ip-server:8080

Could you please advice on the subject ?

Thank you in advance

DmitryZagr commented 6 years ago
  1. Give me please the output of docker version and docker-compose version

  2. Did you execute this commands?

I tested this project with different versions of the docker on 16 and 18 Ubuntu and on mac os x

DmitryZagr commented 6 years ago

@Starli0n I reproduce the bug! I will try to solve it

Starli0n commented 6 years ago

I made another test by not generating the initdb.sql and I have the exact same issue.

It seems that the last version of postgres does not take into account the script.

I do not know how to initiate the database then.

DmitryZagr commented 6 years ago

@Starli0n Try again. It seems that postgres reads init script again.

  1. pull repository again with new postres tag (9.6.11)
  2. Clear data folder and remove initdb.sql 2.1 sudo rm -r data 2.2 rm init/initdb.sql
  3. Run again 3.1 cd init 3.2 docker run --rm guacamole/guacamole:0.9.14 /opt/guacamole/bin/initdb.sh --postgres > initdb.sql 3.3 cd ..
  4. Run 4.1 docker-compose down && docker-compose up

I think this helps you

Starli0n commented 6 years ago

Unfortunately, it does not work for me and I still have the same error :-(

I paid attention to remove every postgres and guacamole images I had before pulling with the images with the right tags

Also I change the tag of postgres in the docker-compose file

(Besides, the volume 'data' seems to not be used in your docker-compose file)

DmitryZagr commented 6 years ago

@Starli0n Did you delete the data folder? try this

  1. At the root of the repository docker-compose down
  2. Delete the repository folder
  3. Clone repository again
  4. Initialize according to Readme

What OS and version of docker, docker-compose do you use?

Starli0n commented 6 years ago

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:

Thank you so much for your help