processone / ejabberd

Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
https://www.process-one.net/en/ejabberd/
Other
6.03k stars 1.5k forks source link

mod_mqtt #4052

Closed heelll-boooy closed 1 year ago

heelll-boooy commented 1 year ago

Hello

Errors from error.log

2023-06-26 14:33:28.803360+00:00 [error] <0.470.0>@ejabberd_sql:check_error/2:1314 SQL query 'select name, opts from muc_room where host='conference.localhost'' failed: <<"#42S02Table 'ejabberd.muc_room' doesn't exist">> 2023-06-26 14:33:28.804289+00:00 [error] <0.470.0>@ejabberd_sql:check_error/2:1307 SQL query 'Q48134329' at {mod_muc_sql,{209,23}} failed: <<"#42S02Table 'ejabberd.muc_room' doesn't exist">> 2023-06-26 14:33:29.239403+00:00 [error] <0.471.0>@ejabberd_sql:check_error/2:1314 SQL query 'select topic from mqtt_pub where 0=0' failed: <<"#42S02Table 'ejabberd.mqtt_pub' doesn't exist">> 2023-06-26 14:33:29.239781+00:00 [error] <0.471.0>@ejabberd_sql:check_error/2:1307 SQL query 'Q122189940' at {mod_mqtt_sql,{112,10}} failed: <<"#42S02Table 'ejabberd.mqtt_pub' doesn't exist">> 2023-06-26 14:33:29.240833+00:00 [critical] <0.352.0>@gen_mod:start_module/4:169 Failed to start module mod_mqtt: {error,{db_failure,{child,undefined,mod_mqtt_localhost, {gen_server,start_link, [{local,mod_mqtt_localhost}, mod_mqtt, [<<"localhost">>,

{access_publish => [],

                                      access_subscribe => [],
                                      cache_life_time => 3600000,
                                      cache_missed => true,
                                      cache_size => 1000,db_type => sql,
                                      match_retained_limit => 1000,
                                      max_queue => 5000,
                                      max_topic_aliases => 100,
                                      max_topic_depth => 8,
                                      queue_type => ram,
                                      ram_db_type => mnesia,
                                      session_expiry => 300000,
                                      use_cache => true}],
                                   []]},
                      transient,false,60000,worker,
                      [mod_mqtt]}}}

2023-06-26 14:33:29.241429+00:00 [critical] <0.352.0>@gen_mod:maybe_halt_ejabberd/0:256 ejabberd initialization was aborted because a module start failed. I have installed ejabberd and when adding the mysql database the following error appears and I could not solve it. Can you help me and thank you

prefiks commented 1 year ago

It looks like your database don't have schema imported (there are no tables defined). See https://docs.ejabberd.im/tutorials/mysql/#load-database-schema-into-your-new-database, you can find schema file here: https://github.com/processone/ejabberd/blob/master/sql/mysql.new.sql

heelll-boooy commented 1 year ago

Hello prefiks Thank you, the problem has been resolved