[OBM Admin] OMM

Bán Miklós banm at vocs.unideb.hu
Fri Nov 11 14:33:00 CET 2016


Hi Gabor, 

Here is a step-by-step debug guide: how to search for problems and repair them.


So, I've logged in into your server using ssh.

First I opened two consoles for the messages log and for the web server
error log:

tail -f /var/log/messages
tail -f /var/log/httpd/openmammalmaps_error_log

After I loaded your new project the openmammalmaps.ro page

I got several error messages in the httpd.log:


PHP Warning:  pg_query(): Query failed: ERROR:  column d.uploading_id
does not exist\nLINE 1: ...der_id FROM uploadings u LEFT JOIN mammalia
d ON
(d.uploadin...\n
^ in /var/www/html/biomaps-2.0/projects/mammalia/modules/mainpage.php
on line 146

Oks, it is simple. The column name is obm_uploading_id instead of
uploading_id. 

The next error is the following:

PHP Warning:  pg_query(): Query failed: ERROR:  permission denied for
relation milvus_programs
in /var/www/html/biomaps-2.0/projects/mammalia/modules/mainpage.php on
line 161

I'm not sure that you really want to use the milvus_programs table,
nevertheless I gave "select right" to mammalia_admin on milvus_programs



Ok, no more errors. At this point I have logged in the web app, but
first I've opened the mapserver log file:

tail
-f /tmp/systemd-private-1438a1cbb7434ccba3dbfd7d9032c053-httpd.service-SgFKHa/tmp/mammalia_private_ms_error.txt

When I loaded your map in the browser window I saw pink squares and
error messages in the ..ms_error.txt:
msPostGISLayerWhichShapes(): Query error. Error executing query:
ERROR:  cannot determine type of empty array
LINE 4:         CASE WHEN 'admin'='admin' OR ARRAY[] && "group" THEN...
                                             ^
HINT:  Explicitly cast to the desired type, for example
ARRAY[]::integer[].

It means that the query is wrong or more precisely there is a wrong
variable substitution which causing the empty array.

Where is this query?
You can find it in the phppgadmin interface:
biomaps2-0->projects_queries

OR 

in the OBM web interface->project administration-> Query definitions

Here is the problematic part:
ARRAY[%grp%] && "group"

This a special access right handling problem. This query needs the
logged users to be member of a group. So I put my logged user into a
group for the further testing.

Ok, it works now, a can see the points on the map. Let's see how the
text and spatial queries work:

I've tried a spatial query and I got an error message
pg_query(): Query failed: ERROR:  permission denied for sequence
query_buff_id_seq in /var/www/html/biomaps-2.0/libs/common_pg_funcs.php
on line 744, referer: http://openmammalmaps.ro/index.php

It happened because you made your project manually instead of
using the the project creator.

So I gave the missing rights on the query_buff_id_seq to the
mammalia_admin sql user.

Now everything is fine I can query data!

Best wishes,

Miki



On Thu, 10 Nov 2016 14:26:29 +0200
Bóné Gábor <gabor.bone at milvus.ro> wrote:

> Szia Miki,
> 
> Sajnos nem tudok rájönni, hogy a query miért nem működik ha be vagyok 
> jelentkezve. Légyszives próbáld meg megjavítani.
> 
> Köszi,
> 
> Gábor
> 



-- 
Miklós Bán, PhD
MTA-DE "Lendület" Behavioural Ecology Research Group
Department of Evolutionary Zoology, University of Debrecen
H-4010 Debrecen, Egyetem tér 1.
Phone:  +36 52 512-900 ext. 62356
http://zoology.unideb.hu/?m=Miklos_Ban
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


More information about the Administrator mailing list