mapcentia / geocloud2

The GC2 framework helps you build a spatial data infrastructure quickly and easily. Powered using open source components for a scalable solution focused on freedom rather than fees.
https://www.osgeo.org/projects/gc2-vidi/
GNU Affero General Public License v3.0
148 stars 67 forks source link

Errors while creating a new user on latest images #137

Closed hrishiballal closed 2 months ago

hrishiballal commented 7 months ago

Hello I just updated the docker images on my side, but when creating a new user, I am seeing errors below. Would appreciate any pointers on how to fix it.

gc2-error

mapcentia commented 7 months ago

Could you check the response from the server in the browser developer consol?

hrishiballal commented 7 months ago

Hello @mapcentia thank you for this, how do you mean? There is no errors, I am using the docket compose script to pull the latest images l.

mapcentia commented 7 months ago

Is in the browser developer tools. When you create a new user, the page will make a POST request. It returns an error in your case. Take a look at the image. Here I got an error because the user already exists. This is an excepted error, but yours is not. I guess the response has some info about the error:

image

hrishiballal commented 7 months ago

screenshot

This happens even I have used docker system prune and also docker volume prune

mapcentia commented 7 months ago

When creating a new user, GC2 will create a database and a role (with the same name). For some reason something went wrong and GC2 tried to clean up by dropping the user role, which was created in the process (or already existing, which may be the cause of the error). But it can't, because the user owns objects in another database?

Is your new user name the same as an already existing user role in the database?

I think I'll take a look on the process of creating the GC2 users. This has happen before and leaves a bit of a mess.

hrishiballal commented 7 months ago

Yes correct the screenshot is when I use a username that is already exists, the error is same when I try to create a new username that does not exist. I had a existing version, I brought it down and updated the images.

mapcentia commented 6 months ago

You get an error even when using a completely new name? As never used before?

hrishiballal commented 6 months ago

Thats correct, I did a totally fresh installation and here is a new error, BTW I am using docker compose down --volumes to ensure that all volumes are also deleted

image

mapcentia commented 6 months ago

I've gone through the Docker images and compose file https://github.com/mapcentia/gc2-vidi-docker-compose

It should work now - I've tested on a freshly installed Ubuntu 24.04.

Remove old images and volumes

docker compose down --volumes should do it

Then docker system prune -a

hrishiballal commented 6 months ago

Thank you for this, I am however getting the same error, fresh install of Ubuntu 24.04 and following your instructions.

image

mapcentia commented 6 months ago

Could you try to pull the image:

docker pull mapcentia/gc2core8

And then docker compose down and docker compose up

hrishiballal commented 6 months ago

Thank you for this, it is still creating an issue for me, sharing steps / screenshots

Step 1

p1

Step 2

p2

Step 3

p3

Step 4

p4

Step 5

p5

Step 6

p6

mapcentia commented 6 months ago

Did you git pull the latest https://github.com/mapcentia/gc2-vidi-docker-compose ?

We're still finding and fixing bugs in the new GC2 Docker, so please pull gc2core again

hrishiballal commented 6 months ago

Hello @mapcentia , I have done it but still encountering the same issue, I am trying to revert to the old docker compose file and see if it works. Thanks again!

hrishiballal commented 6 months ago

I just tested with the latest repo and docker compose on my second machine with Windows + WSL and Docker and it all works no problems. For some reason it is not working on Ubuntu. I will investigate more.

hrishiballal commented 6 months ago

When I run it on linux server the following error is shown

image

and an additional error when launching for the first time (perhaps not relevant at this point) image

mapcentia commented 6 months ago

I see the problem now. Migrations is not run on first startup because of the pg_hba.conf error. Could you check, that the mapcentia/postgis15 image is used? It should have digest: sha256:4cfbacc93cb2564104b0c8d16a6ee0ca73c82c8f8feb24bf2eb59c4b82e28050

hrishiballal commented 6 months ago

Hello @mapcentia I updated the image: image but getting the same error: image

Is there something I should change in the docker compose?

hrishiballal commented 6 months ago

I got it! changing Line 56 to 127.0.0.1 instead of localhost works

image

mapcentia commented 6 months ago

Oh, thanks for keep trying. I've updated the file. It's strange why it works on some systems. Then I look at /etc/hosts inside the postgis15 container I see these lines:

127.0.0.1   localhost
::1 localhost ip6-localhost ip6-loopback

I guess your file is missing the first?

Docker write this file, so maybe it's a Docker thing. I'll keep from using localhost in Docker, because it's not sure it's matched to 127.0.0.1