nginx 在Davical中添加组会导致错误

zi8p0yeb  于 2023-04-29  发布在  Nginx
关注(0)|答案(1)|浏览(114)

嗨,我正在尝试安装Davical旁边的Nextcloud与Postgres,nginx和php 8。1,它已经部分工作(添加用户或资源工作正常),但当我想创建组时,我会收到以下错误消息:
我可以在管理面板中创建组,但是当我调用组页面(https://calendar.example.de/admin.php?action=edit&t=principal&id=1019)时,我在“组成员”下得到了这个错误消息:

Exception [42601] SQLSTATE[42601]: Syntax error: 7 FEHLER:  Müll folgt auf numerische Konstante bei »1019O«
ZEILE 1: ...member WHERE group_id = 1019) AND principal_id != 1019ORDER ...
                                                              ^
At line 95 of /usr/share/awl/inc/AwlDatabase.php
================= Stack Trace ===================
/usr/share/davical/htdocs/admin.php[50] Browser->Render()
/usr/share/awl/inc/classBrowser.php[852] edit_group_row()
/usr/share/davical/inc/ui/principal-edit.php[591] Editor->Render()
/usr/share/awl/inc/classEditor.php[669] preg_replace_callback()
[0] Editor->ReplaceEditorPart()
/usr/share/awl/inc/classEditor.php[597] EntryField::BuildOptionList()
/usr/share/awl/inc/DataEntry.php[306] AwlQuery->Exec()
/usr/share/awl/inc/AwlQuery.php[585] AwlQuery->Execute()
/usr/share/awl/inc/AwlQuery.php[396] AwlDatabase->query()
/usr/share/awl/inc/AwlDatabase.php[95] PDO->query()

我无法将用户添加到组。
Davical错误日志中还有以下错误消息

2023/04/26 11:38:59 [error] 330989#330989: *17 FastCGI sent in stderr: "PHP message: PHP Early Exception: [42601] SQLSTATE[42601]: Syntax error: 7 FEHLER:  Müll folgt auf numerische Konstante bei »1019O«
ZEILE 1: ...member WHERE group_id = 1019) AND principal_id != 1019ORDER ...
 ^ at /usr/share/awl/inc/AwlDatabase.php:95" while reading upstream, client: 192.168.100.2, server: calendar.example.de, request: "GET /admin.php?action=edit&t=principal&id=1019 HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.1-fpm.sock:", host: "calendar.example.de"

postgresql error log说:

2023-04-26 11:59:29.228 CEST [333501] davical_app@davical ANWEISUNG:  SELECT principal_id, coalesce(displayname,fullname,username) FROM dav_principal WHERE principal_id NOT IN (SELECT member_id FROM group_member WHERE group_id = 1019) AND principal_id != 1019ORDER BY 2

使用ubuntu 22.04,php8.1,postgresql 15,Davical 1.1.11-1,libawl-php 0.63-1全部
我查了一下php 8。1-fpm.sock,都在www.conf和相应的nginx配置中到socket的链接是正确的。php8.1-fpm.sock可用,用户权限和所有者似乎设置正确。也许我错过了什么,或者在postgresql数据库中有一个错误?有人能帮我吗?
谢谢!

gr8qqesn

gr8qqesn1#

这段代码是错误的:

$sql = 'SELECT principal_id, coalesce(displayname,fullname,username) FROM dav_principal ';
  $sql .= 'WHERE principal_id NOT IN (SELECT member_id FROM group_member WHERE group_id = '.$id.') ';
  $sql .= 'AND principal_id != '.$id;
  $sql .= 'ORDER BY 2';

ORDERBY在$id之后卡住了,导致您看到的错误消息。
修正:在ORDER BY之前有额外的空格:

$sql .= ' ORDER BY 2';

该文件可以在here,principal-edit中找到。PHP

相关问题