Fehler beim Aufruf der Raumverwaltung

Hast du einen Fehler in der aktuellen Version gefunden ? Diesen kannst du uns hier mitteilen und uns bei der Fehlersuche helfen.
Antworten
naneby
Beiträge: 3
Registriert: 23. Aug 2022, 17:57

Fehler beim Aufruf der Raumverwaltung

Beitrag von naneby »

Hallo liebe Community,

seit der Installation des Servers funktioniert der Aufruf der Raumverwaltung leider nicht.

Wir bekommen folgende Meldung:
<Server> is currently unable to handle this request. (HTTP error 500)

Weiß jemand, wie wir das Problem beheben könnten?

Danke!

Edit: Wir nutzen Admidio Version 4.1.13
Benutzeravatar
fasse
Administrator
Beiträge: 6182
Registriert: 12. Nov 2005, 16:06

Re: Fehler beim Aufruf der Raumverwaltung

Beitrag von fasse »

Hallo,

dieses Problem kann ich leider weder lokal noch auf unserer Demo-Seite nachvollziehen. Hier kann ich problemlos die Raumverwaltung öffnen.

Hast du evtl. ein PHP errorlog-Datei in die man mal schauen kann. Wobei Http error 500 eigentlich heißt, dass er keine Seite unter der aufzurufenden URL findet. Kannst du mal schauen, wie bei dir die URL hinter dem Link heißt der dir zur Raumverwaltung angezeigt wird. Ist das ein sinnvoller Link zu deiner Seite?

Gruß
Fasse
bakudan
Beiträge: 3
Registriert: 29. Aug 2022, 15:37

Re: Fehler beim Aufruf der Raumverwaltung

Beitrag von bakudan »

Hallo,

an fasse, ich bin mit Naneby gemeinsam im Verein und hab mir das jetzt etwas genauer angesehen. Und den "Debug Button" gefunden.

Den habe ich aber erst nach dem aufsetzen einer Test Umgebung zuhause gefunden. Aber hier habe ich den gleichen Fehler:
Das kommt beim Aufruf von:
http://10.4.0.81/admidio//adm_program/m ... /rooms.php

Code: Alles auswählen

Datenbankfehler
Zurück
S Q L - E R R O R
CODE: 42S22
1054
Unknown column 'cre_username.usr_id' in 'on clause'
B A C K T R A C E
FILE: adm_program/system/classes/Database.php
LINE: 706
CALL: Database->showError()

FILE: adm_program/modules/rooms/rooms.php
LINE: 88
CALL: Database->queryPrepared()
Das sagt das Log:

Code: Alles auswählen

[2022-08-29 15:41:17.679238] Admidio.INFO: ##################################################################################################  {"file":"/var/www/html/admidio/adm_program/system/bootstrap/logging.php","line":68,"class":null,"function":"initLogging"}
[2022-08-29 15:41:17.679415] Admidio.INFO: URL: http://10.4.0.81/admidio//adm_program/modules/rooms/rooms.php  {"file":"/var/www/html/admidio/adm_program/system/bootstrap/logging.php","line":69,"class":null,"function":"initLogging"}
[2022-08-29 15:41:17.679494] Admidio.INFO: CONSTANTS: URLS & PATHS & FOLDERS {"VERSIONS":{"ADMIDIO":"4.1.14","PHP":"7.4.30"},"SCHEME":"http","HTTPS":false,"PORT":80,"HOST":"10.4.0.81","DOMAIN":"10.4.0.81","ADMIDIO_URL_PATH":"/admidio/","URLS":{"ADMIDIO_URL":"http://10.4.0.81/admidio/","FILE_URL":"http://10.4.0.81/admidio/adm_program/modules/rooms/rooms.php","CURRENT_URL":"http://10.4.0.81/admidio//adm_program/modules/rooms/rooms.php"},"PATHS":{"SERVER_PATH":"/var/www/html","ADMIDIO_PATH":"/var/www/html/admidio","CURRENT_PATH":"/var/www/html/admidio/adm_program/modules/rooms/rooms.php"}} {"file":"/var/www/html/admidio/adm_program/system/bootstrap/logging.php","line":94,"class":null,"function":"initLogging"}
[2022-08-29 15:41:17.679698] Admidio.DEBUG: DATABASE: Create DB-Instance with default params! {"engine":"mysql","host":"localhost","port":null,"name":"admidio","username":"admdiodb","password":"jTEWQPmiK5"} {"file":"/var/www/html/admidio/adm_program/system/classes/Database.php","line":139,"class":"Database","function":"createDatabaseInstance"}
[2022-08-29 15:41:17.679770] Admidio.DEBUG: DATABASE: DSN-String: "mysql:host=localhost;dbname=admidio;charset=utf8"!  {"file":"/var/www/html/admidio/adm_program/system/classes/Database.php","line":798,"class":"Database","function":"setDSNString"}
[2022-08-29 15:41:17.680123] Admidio.INFO: SQL: SET SQL_MODE = 'ANSI'  {"file":"/var/www/html/admidio/adm_program/system/classes/Database.php","line":683,"class":"Database","function":"queryPrepared"}
[2022-08-29 15:41:17.680551] Admidio.DEBUG: SQL: Execution time 0.200987 ms  {"file":"/var/www/html/admidio/adm_program/system/classes/Database.php","line":698,"class":"Database","function":"queryPrepared"}
[2022-08-29 15:41:17.680656] Admidio.INFO: SQL: SET SQL_BIG_SELECTS = 1  {"file":"/var/www/html/admidio/adm_program/system/classes/Database.php","line":683,"class":"Database","function":"queryPrepared"}
[2022-08-29 15:41:17.680886] Admidio.DEBUG: SQL: Execution time 0.114918 ms  {"file":"/var/www/html/admidio/adm_program/system/classes/Database.php","line":698,"class":"Database","function":"queryPrepared"}
[2022-08-29 15:41:17.680979] Admidio.DEBUG: DATABASE: connected!  {"file":"/var/www/html/admidio/adm_program/system/classes/Database.php","line":172,"class":"Database","function":"__construct"}
[2022-08-29 15:41:17.682327] Admidio.INFO: Session Started! {"name":"ADMIDIO_AniLAN_admidio_adm_SESSION_ID","limit":0,"path":"/admidio//","domain":"10.4.0.81","secure":false,"httpOnly":true,"sameSite":"lax","sessionId":"5586e8qhsbcce7e6g5nksbfr19"} {"file":"/var/www/html/admidio/adm_program/system/classes/Session.php","line":549,"class":"Session","function":"start"}
[2022-08-29 15:41:17.682420] Admidio.INFO: SQL: SELECT * FROM adm_sessions WHERE ses_id = ? [164] {"file":"/var/www/html/admidio/adm_program/system/classes/Database.php","line":683,"class":"Database","function":"queryPrepared"}
[2022-08-29 15:41:17.682838] Admidio.INFO: SQL: Found rows: 1  {"file":"/var/www/html/admidio/adm_program/system/classes/Database.php","line":694,"class":"Database","function":"queryPrepared"}
[2022-08-29 15:41:17.682910] Admidio.DEBUG: SQL: Execution time 0.416040 ms  {"file":"/var/www/html/admidio/adm_program/system/classes/Database.php","line":698,"class":"Database","function":"queryPrepared"}
[2022-08-29 15:41:17.683174] Admidio.INFO: SQL: UPDATE adm_sessions SET ses_timestamp = ?, ses_reload = ? WHERE ses_id = ? ["2022-08-29 15:41:17",0,164] {"file":"/var/www/html/admidio/adm_program/system/classes/Database.php","line":683,"class":"Database","function":"queryPrepared"}
[2022-08-29 15:41:17.701661] Admidio.DEBUG: SQL: Execution time 18.418074 ms  {"file":"/var/www/html/admidio/adm_program/system/classes/Database.php","line":698,"class":"Database","function":"queryPrepared"}
[2022-08-29 15:41:17.702063] Admidio.INFO: SQL: SELECT room.*, cre_user.usr_login_name AS create_name, cha_user.usr_login_name AS change_name, cre_user.usr_uuid AS create_uuid, cha_user.usr_uuid AS change_uuid FROM adm_rooms AS room LEFT JOIN adm_users AS cre_user ON cre_username.usr_id = room_usr_id_create LEFT JOIN adm_users AS cha_user ON cha_username.usr_id = room_usr_id_change ORDER BY room_name  {"file":"/var/www/html/admidio/adm_program/system/classes/Database.php","line":683,"class":"Database","function":"queryPrepared"}
[2022-08-29 15:41:17.702300] Admidio.DEBUG: SQL: Execution time 0.157833 ms  {"file":"/var/www/html/admidio/adm_program/system/classes/Database.php","line":702,"class":"Database","function":"queryPrepared"}
[2022-08-29 15:41:17.702346] Admidio.CRITICAL: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'cre_username.usr_id' in 'on clause'  {"file":"/var/www/html/admidio/adm_program/system/classes/Database.php","line":705,"class":"Database","function":"queryPrepared"}
[2022-08-29 15:41:17.702509] Admidio.CRITICAL: 42S22: 1054 | Unknown column 'cre_username.usr_id' in 'on clause'  {"file":"/var/www/html/admidio/adm_program/system/classes/Database.php","line":855,"class":"Database","function":"showError"}
[2022-08-29 15:41:17.703343] Admidio.INFO: SHUTDOWN {"execution_time":"25.397062 ms","memory_usage":"1.783 MiB"} {"file":"/var/www/html/admidio/adm_program/system/bootstrap/shutdown.php","line":21,"class":null,"function":"admShutdown"}
[2022-08-29 15:41:17.703432] Admidio.DEBUG: DATABASE: sleep/serialize!  {"file":"/var/www/html/admidio/adm_program/system/classes/Database.php","line":185,"class":"Database","function":"__sleep"}
Datenbank Inhalt ist bei meinem "Testsystem" und dort wo der Fehler auftrat gleich.

Datenbank Analyse kommt gleich.
bakudan
Beiträge: 3
Registriert: 29. Aug 2022, 15:37

Re: Fehler beim Aufruf der Raumverwaltung

Beitrag von bakudan »

Hier die DB:

Code: Alles auswählen

MariaDB [admidio]> SELECT * FROM adm_rooms AS room LEFT JOIN adm_users AS cre_user ON cre_username.usr_id = room_usr_id_create LEFT JOIN adm_users AS cha_user ON cha_username.usr_id = room_usr_id_change LIMIT 0;
ERROR 1054 (42S22): Unknown column 'cre_username.usr_id' in 'on clause'

MariaDB [admidio]> SELECT * FROM adm_rooms AS room LIMIT 1;
+---------+--------------------------------------+------------------+--------------------------------------------------------------------------------------------------------------+---------------+---------------+--------------------+-----------------------+--------------------+-----------------------+
| room_id | room_uuid                            | room_name        | room_description                                                                                             | room_capacity | room_overhang | room_usr_id_create | room_timestamp_create | room_usr_id_change | room_timestamp_change |
+---------+--------------------------------------+------------------+--------------------------------------------------------------------------------------------------------------+---------------+---------------+--------------------+-----------------------+--------------------+-----------------------+
|       1 | c79673ce-aa5f-4dce-82b3-c709edc0e39e | Besprechungsraum | Hier können Besprechungen stattfinden. Der Raum muss vorher reserviert werden. Beamer steht zur Verfügung.   |            15 |          NULL |                  1 | 2022-08-18 10:17:58   |               NULL | NULL                  |
+---------+--------------------------------------+------------------+--------------------------------------------------------------------------------------------------------------+---------------+---------------+--------------------+-----------------------+--------------------+-----------------------+
1 row in set (0.000 sec)

MariaDB [admidio]> SELECT * FROM adm_users AS cre_user LIMIT 1;
+--------+--------------------------------------+----------------+--------------+-----------+----------+-----------------+------------------------+----------------+------------------+------------------+------------------+--------------------+-------------------+----------------------+-------------------+----------------------+-----------+
| usr_id | usr_uuid                             | usr_login_name | usr_password | usr_photo | usr_text | usr_pw_reset_id | usr_pw_reset_timestamp | usr_last_login | usr_actual_login | usr_number_login | usr_date_invalid | usr_number_invalid | usr_usr_id_create | usr_timestamp_create | usr_usr_id_change | usr_timestamp_change | usr_valid |
+--------+--------------------------------------+----------------+--------------+-----------+----------+-----------------+------------------------+----------------+------------------+------------------+------------------+--------------------+-------------------+----------------------+-------------------+----------------------+-----------+
|      1 | 66c39e14-f86b-45ce-b2ee-721f6472dde9 | System         | NULL         | NULL      | NULL     | NULL            | NULL                   | NULL           | NULL             |                0 | NULL             |                  0 |              NULL | 2022-08-18 10:17:58  |              NULL | NULL                 |         0 |
+--------+--------------------------------------+----------------+--------------+-----------+----------+-----------------+------------------------+----------------+------------------+------------------+------------------+--------------------+-------------------+----------------------+-------------------+----------------------+-----------+
1 row in set (0.000 sec)

Hab hier wahrscheinlich den Fehler gefunden:

Code: Alles auswählen

Aus dem Log:
SELECT room.*, cre_user.usr_login_name AS create_name, cha_user.usr_login_name AS change_name, cre_user.usr_uuid AS create_uuid, cha_user.usr_uuid AS change_uuid FROM adm_rooms AS room LEFT JOIN adm_users AS cre_user ON cre_username.usr_id = room_usr_id_create LEFT JOIN adm_users AS cha_user ON cha_username.usr_id = room_usr_id_change ORDER BY room_name;

Korrigiert (cre_username => cre_user, cha_username => cha_user):
SELECT room.*, cre_user.usr_login_name AS create_name, cha_user.usr_login_name AS change_name, cre_user.usr_uuid AS create_uuid, cha_user.usr_uuid AS change_uuid FROM adm_rooms AS room LEFT JOIN adm_users AS cre_user ON cre_user.usr_id = room_usr_id_create LEFT JOIN adm_users AS cha_user ON cha_user.usr_id = room_usr_id_change ORDER BY room_name;

Ich suche das jetzt nun noch "schnell" im src. Ist schon lange her das ich was mit php getan habe.
bakudan
Beiträge: 3
Registriert: 29. Aug 2022, 15:37

Re: Fehler beim Aufruf der Raumverwaltung

Beitrag von bakudan »

Fehler gefunden:

Code: Alles auswählen

bakudan@admidio-dev:/var/www/html/admidio$ git diff adm_program/modules/rooms/rooms.php
diff --git a/adm_program/modules/rooms/rooms.php b/adm_program/modules/rooms/rooms.php
index a2807b679..b0c6ff810 100644
--- a/adm_program/modules/rooms/rooms.php
+++ b/adm_program/modules/rooms/rooms.php
@@ -74,9 +74,9 @@ if ((int) $gSettingsManager->get('system_show_create_edit') === 1) {
         cre_user.usr_uuid AS create_uuid, cha_user.usr_uuid AS change_uuid ';
     $additionalTables = '
         LEFT JOIN '. TBL_USERS .' AS cre_user
-               ON cre_username.usr_id = room_usr_id_create
+               ON cre_user.usr_id = room_usr_id_create
         LEFT JOIN '. TBL_USERS .' AS cha_user
-               ON cha_username.usr_id = room_usr_id_change ';
+               ON cha_user.usr_id = room_usr_id_change ';
     $queryParams = array();
 }
So jetzt muss ich "nur" noch raus finden wie ich einen "contribute" bei euch machen. Das habe ich noch nie getan.
Benutzeravatar
fasse
Administrator
Beiträge: 6182
Registriert: 12. Nov 2005, 16:06

Re: Fehler beim Aufruf der Raumverwaltung

Beitrag von fasse »

Hallo Bakudan,

vielen Dank für eine ausführliche Beschreibung. Damit kann ich es auch lösen. Aber du darst auch gerne eine Korrektur beisteuern. Mir ist jetzt auch klar, wieso ich das Problem nicht nachvollziehen konnte. Der Fehler tritt nur auf, wenn man den Loginnamen bei "Angelegt von" und "zuletzt geändert" anzeigen lässt.

Viele Grüße
Fasse
Antworten