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

Error 500 accessing admin page #112

Closed malajunk closed 2 years ago

malajunk commented 2 years ago

Hello, i'm trying to test this software and following the guides i've been using the latest docker images with this compose

version: '3.3'

networks:
  internal:
    external: false

services:
  gc2core:
    image: mapcentia/gc2core
    privileged: true
    networks:
      - internal
      - default
    ports:
      - "8080:80"
    environment:
      - POSTGIS_HOST=postgis
      - POSTGIS_DB=postgres
      - POSTGIS_USER=gc2
      - POSTGIS_PORT=5432
      - POSTGIS_PW=1234
      - POSTGIS_PGBOUNCER=false
  redis:
    image: redis
    networks:
      - internal

  postgis:
    image: mapcentia/postgis
    volumes:
      - postgis_var_lib_postgresql:/var/lib/postgresql
      - postgis_var_log:/var/log
      - postgis_etc_postgresql:/etc/postgresql
      - postgis_etc_pgbouncer:/etc/pgbouncer
    networks:
      - internal

    environment:
      - GC2_USER=gc2
      - GC2_PASSWORD=1234
      - GC2_LOCALE=da_DK.UTF-8
  vidi:
    image: mapcentia/vidi
    networks:
      - internal
      - default
    ports:
      - "3000:3000"
    environment:
      - GC2_HOST=http://gc2core

volumes:
  postgis_var_log:
  postgis_etc_postgresql:
  postgis_var_lib_postgresql:
  postgis_etc_pgbouncer:

I register a new user and i'm able to login to the dashboard, from which if i then click on the link to the admin page of the public schema another page onpens up and the console start spamming this error :

all.min.js?84afc5cf0dc3be4c:2 GET http://localhost:8080/controllers/layer/records 500 (Internal Server Error)

and the page show this error:

Uncaught TypeError: Argument 1 passed to app\inc\Model::fetchRow() must be an instance of PDOStatement, null given, called in /var/www/geocloud2/app/models/Table.php on line 382 and defined in /var/www/geocloud2/app/inc/Model.php:102 Stack trace: #0 /var/www/geocloud2/app/models/Table.php(382): app\inc\Model->fetchRow(NULL) #1 /var/www/geocloud2/app/controllers/Layer.php(44): app\models\Table->getRecords(true) #2 /var/www/geocloud2/app/inc/Route.php(80): app\controllers\Layer->get_records(Array) #3 /var/www/geocloud2/public/index.php(339): app\inc\Route::add('controllers/Lay...') #4 {main} thrown

That compose lead to (i guess) the same version of this swarm.gc2.io.

I switched postgres users to md5 auth method to avoid the scram error changing pg_gba.conf and postgresql.conf

The workshop proposed is not much in line with what i can see in the swarm.gc2.io app, i cannot follow points 01 and 02 for instance, is there a more recent documentation around?

I'm on windows 10 pro, and i've tested this behaviour on Brave and Edge.

malajunk commented 2 years ago

Looking at the postgis docker logs seems that this statement fails SELECT * FROM settings.getColumns

2022-07-11 08:42:12.158 UTC [176] gc2@asd STATEMENT:  SELECT * FROM settings.getColumns('f_table_schema=''subasd''','raster_columns.r_table_schema=''subasd''') ORDER BY sort_id ASC
2022-07-11 08:42:12.220 UTC [178] gc2@asd ERROR:  function settings.getcolumns(unknown, unknown) does not exist at character 15
2022-07-11 08:42:12.220 UTC [178] gc2@asd HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
malajunk commented 2 years ago

Postgis Dockerfile can't copy those two files

app/conf/App.php
app/conf/Connection.php
mapcentia commented 2 years ago

Sorry for the late answer - Please use this for local install https://github.com/mapcentia/gc2-vidi-docker-compose