ejabberd 和 "call to undefined function pgsql:squery"
ejabberd and "call to undefined function pgsql:squery"
我在 debian 9 和 postgresql 上使用 ejabberd 18.04。我可以创建一个用户并在用户 table 中看到它。我可以通过客户端登录,也可以通过 webadmin 登录。因此 ejabberd 和 postgresql 工作。但是当我尝试将用户添加到花名册时(模块 mod_roster 已连接),我得到以下输出:
...
11:49:35.760 [error] gen_fsm <0.397.0> in state session_established terminated with reason: call to undefined function pgsql:squery(<0.418.0>, [<<"begin;">>], 59000)
11:49:35.760 [error] CRASH REPORT Process <0.397.0> with 0 neighbours exited with reason: call to undefined function pgsql:squery(<0.418.0>, [<<"begin;">>], 59000) in p1_fsm:terminate/8 line 760
11:49:35.761 [error] Supervisor 'ejabberd_sql_sup_192.168.56.111' had child 6 started with ejabberd_sql:start_link(<<"192.168.56.111">>, 30000) at <0.397.0> exit with reason call to undefined function pgsql:squery(<0.418.0>, [<<"begin;">>], 59000) in context child_terminated
11:49:35.761 [error] gen_fsm <0.401.0> in state session_established terminated with reason: call to undefined function pgsql:squery(<0.422.0>, [<<"begin;">>], 59000)
11:49:35.765 [error] CRASH REPORT Process <0.401.0> with 0 neighbours exited with reason: call to undefined function pgsql:squery(<0.422.0>, [<<"begin;">>], 59000) in p1_fsm:terminate/8 line 760
11:49:35.776 [error] Supervisor 'ejabberd_sql_sup_192.168.56.111' had child 10 started with ejabberd_sql:start_link(<<"192.168.56.111">>, 30000) at <0.401.0> exit with reason call to undefined function pgsql:squery(<0.422.0>, [<<"begin;">>], 59000) in context child_terminated
...
这是什么意思?
我想,错误有答案:
terminated with reason: call to undefined function pgsql:squery
这意味着你调用了未定义的函数。您需要检查:
- 在您的项目
中包含模块或应用程序 pgsql
- 在应用程序或模块中 pgsql 尝试查找函数 squery
- 此外,需要检查应用 pgsql 的文档,可能该功能已被弃用或已从您尝试使用的版本中删除。
也许这个函数在 pgsql 中,但它被错误地使用了,例如:假设 squery[ 有一个导出函数=28=] 有 2 个参数,但在你的项目中它是用 3 个参数调用的,在这种情况下你也会得到一个错误,比如 - 终止原因:调用未定义的函数 pgsql:squery.
我在我的 Debian Stretch 机器上遇到了同样的问题。结果是我使用的 Ejabberd 版本与安装的 erlang-p1-pgsql
包不兼容。
ejabberd
软件包来自 Debian stretch-backports 而 erlang-p1-pgsql
软件包来自主仓库。从 backports repo 快速更新/安装就可以了:
apt-get install -t stretch-backports erlang-p1-pgsql
然后重启 Ejabberd,错误应该被修复:-)
(我正在写一个更完整的答案,以防有人遇到和我一样的问题)
我在 debian 9 和 postgresql 上使用 ejabberd 18.04。我可以创建一个用户并在用户 table 中看到它。我可以通过客户端登录,也可以通过 webadmin 登录。因此 ejabberd 和 postgresql 工作。但是当我尝试将用户添加到花名册时(模块 mod_roster 已连接),我得到以下输出:
...
11:49:35.760 [error] gen_fsm <0.397.0> in state session_established terminated with reason: call to undefined function pgsql:squery(<0.418.0>, [<<"begin;">>], 59000)
11:49:35.760 [error] CRASH REPORT Process <0.397.0> with 0 neighbours exited with reason: call to undefined function pgsql:squery(<0.418.0>, [<<"begin;">>], 59000) in p1_fsm:terminate/8 line 760
11:49:35.761 [error] Supervisor 'ejabberd_sql_sup_192.168.56.111' had child 6 started with ejabberd_sql:start_link(<<"192.168.56.111">>, 30000) at <0.397.0> exit with reason call to undefined function pgsql:squery(<0.418.0>, [<<"begin;">>], 59000) in context child_terminated
11:49:35.761 [error] gen_fsm <0.401.0> in state session_established terminated with reason: call to undefined function pgsql:squery(<0.422.0>, [<<"begin;">>], 59000)
11:49:35.765 [error] CRASH REPORT Process <0.401.0> with 0 neighbours exited with reason: call to undefined function pgsql:squery(<0.422.0>, [<<"begin;">>], 59000) in p1_fsm:terminate/8 line 760
11:49:35.776 [error] Supervisor 'ejabberd_sql_sup_192.168.56.111' had child 10 started with ejabberd_sql:start_link(<<"192.168.56.111">>, 30000) at <0.401.0> exit with reason call to undefined function pgsql:squery(<0.422.0>, [<<"begin;">>], 59000) in context child_terminated
...
这是什么意思?
我想,错误有答案:
terminated with reason: call to undefined function pgsql:squery
这意味着你调用了未定义的函数。您需要检查:
- 在您的项目 中包含模块或应用程序 pgsql
- 在应用程序或模块中 pgsql 尝试查找函数 squery
- 此外,需要检查应用 pgsql 的文档,可能该功能已被弃用或已从您尝试使用的版本中删除。
也许这个函数在 pgsql 中,但它被错误地使用了,例如:假设 squery[ 有一个导出函数=28=] 有 2 个参数,但在你的项目中它是用 3 个参数调用的,在这种情况下你也会得到一个错误,比如 - 终止原因:调用未定义的函数 pgsql:squery.
我在我的 Debian Stretch 机器上遇到了同样的问题。结果是我使用的 Ejabberd 版本与安装的 erlang-p1-pgsql
包不兼容。
ejabberd
软件包来自 Debian stretch-backports 而 erlang-p1-pgsql
软件包来自主仓库。从 backports repo 快速更新/安装就可以了:
apt-get install -t stretch-backports erlang-p1-pgsql
然后重启 Ejabberd,错误应该被修复:-)
(我正在写一个更完整的答案,以防有人遇到和我一样的问题)