3liz / lizmap-web-client

Transfer a QGIS project on a server, Lizmap is providing the web interface to browse it
https://www.lizmap.com
Mozilla Public License 2.0
259 stars 143 forks source link

Can't edit PostGIS layer #4335

Closed katagen closed 7 months ago

katagen commented 7 months ago

What is the question? (in English)

I have a PostGIS layer that is present in QGIS, connected via a pg_service file. I can edit it without any problem. It is the point layer. proprio It also has a primary key. primary In the plugin, I set the edition part like that: plugin In the panel of LWC, I the set permission for the "admins" (and others). lwc_auto As you can see, in the browser, the layer is here, so the .pg_service is OK. I can see the popup of the layer. But when I start the edition, the panel is loading the form with no end... web I don't understand what is wrong here?!?

Versions, safeguards, check summary etc

LWC 3.7.6 Lizmap plugin 4.3.3

Check Lizmap plugin

Operating system

Ubuntu 22.04

Browsers

Firefox, Chrome, Safari

Browsers version

LTR

Relevant log output

No response

nboisteault commented 7 months ago

What are the messages in the console?

katagen commented 7 months ago

I have no error log in the console of the LWC panel! But if I inspect the webpage as soon as I click on add, I have this error: Capture d’écran 2024-03-28 à 20 53 13

nboisteault commented 7 months ago

Now in admin => Lizmap logs?

katagen commented 7 months ago

Do you mean in ${APACHE_LOG_DIR}/error_lizmap.log ? If yes, I'll have access to it only next week :-(

nboisteault commented 7 months ago

I mean in https://yourwebsite/admin.php/admin/logs but it might be the same as in error_lizmap.log, I don't remember.

katagen commented 7 months ago

So I have no error in the admin control... Capture d’écran 2024-03-29 à 11 40 04

nworr commented 7 months ago

usually "Error 500" php error aren't logged in lizmap-admin (displayed in admin panel), but in /<LizmapDir>/var/log/errors.log

katagen commented 7 months ago

OK, here it is:

2024-03-29 10:40:13 [2] pg_connect(): Unable to connect to PostgreSQL server: definition of service "drosera_db" not found /var/www/lizmap-web-client/lizmap/vendor/jelix/jelix/lib/jelix/plugins/db/pgsql/pgsql.dbconnection.php 168

2024-03-29 10:40:13 [402] Impossible de se connecter sur drosera_db (mauvais host, login ou mot de passe ?) /var/www/lizmap-web-client/lizmap/vendor/jelix/jelix/lib/jelix/plugins/db/pgsql/pgsql.dbconnection.php 184

2024-03-29 10:40:36 [2] pg_connect(): Unable to connect to PostgreSQL server: definition of service "drosera_db" not found /var/www/lizmap-web-client/lizmap/vendor/jelix/jelix/lib/jelix/plugins/db/pgsql/pgsql.dbconnection.php 168

2024-03-29 10:40:36 [402] Impossible de se connecter sur drosera_db (mauvais host, login ou mot de passe ?) /var/www/lizmap-web-client/lizmap/vendor/jelix/jelix/lib/jelix/plugins/db/pgsql/pgsql.dbconnection.php 184

So, how the "definition of service" can be wrong, and being able to load the data, and even check the value of the entities (popup)?

katagen commented 7 months ago

Do I need a pg_connect file??? I only use a .pg_service file... I never use a pg_connect file before?

nworr commented 7 months ago

Rendering the map, popup info retrieving is performed by QGIS through php but edition is performed by php only

Your pg_service file need to be available for php, can you try to copy it in /etc/postgresql-common/

see : https://github.com/3liz/lizmap-web-client/issues/620#issuecomment-459751585

katagen commented 7 months ago

OK, I don't have access to the server until next week... except on FTP, but I can't load data in this directory! So I'll try it next week, and give you a feedback! Just to be sure, the group/permission must be www-data:www-data? If I understand it correctly, I can also point my QGIS server PGSERVICEFILE env to /etc/postgresql-common/.pg_service.conf, so that I have only one pg_service file on my system? Correct? Thank you very much for your help!

katagen commented 7 months ago

Perfect... it works!!!

nworr commented 7 months ago

refs #1638