-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[QUESTION] muc_room not getting saved in mysql via API create_room_with_opts #4263
Comments
First of all, you didn't show your full configuration file, maybe some other parts of it are relevant. For example, remember that ejabberd by default stores persistent data in its internal Mnesia database Did you setup db_type mod_muc option ? modules:
mod_muc:
db_type: sql Or did you setup the toplevel default_db option ? default_db: sql
Sometimes you get that error, the room exists, but the room is not stored in MySQL database? Maybe the room existed before you create it? And what happens other times? Other times the room didn't exist first, you run the API and you don't get that error, the room is created correctly, and the room is stored correctly in the MySQL database? I tried ejabberd 24.02 with your configuration, tried your query, and it works correctly. Of course, I only tried a few times, maybe the problem appears with many many requests...
Please try with ejabberd 24.7, as it includes some fixes in the create_room_with_opts API: 06675e4 |
Thanks @badlop, sorry, let me update ejabberd version: 24.2.0 I has updated full configuration.
I has configured
Yes, the room is created correctly and saved to MySQL. Sometime i get an error "Room already exists" although it was not existed before. By the way I have a question. I don't have mod_offline configured at the moment. However, users still receive the messages when they are back to online. |
Once you update to ejabberd 24.7, let's see if the problem gets solved.
Aha, then all modules will try to use sql for their persistent storage, including mod_muc. No need to configure db_type.
Maybe you accidentally call the API two times to create the same room? Or maybe the API client fails and sends again the same query? Check the ejabberd logs for recent API calls...
That is rare. Maybe the module is enabled in some of the included config files? Or maybe the module is not really enabled, and users just get some other messages from MAM storage (which is different to Offline storage). When a user sends a message to an offline user, in what SQL table is the message stored: in spool (using mod_offline) or in archive (using mod_mam)? |
Hi @badlop,
How can i check it?
both of them (spool and archive tables) are storing the messages. |
ejabberd first reads its configuration file If that file contains the option include_config_file, then those additional files are read. Additionally, if there are contribution modules installed, it reads their configuration files, see step 5. of The question now is, how to know in your specific server what are the options being used, and what files are being read by ejabberd? View options with dump_config commandThis commands dumps the consolidated options that are really being used by ejabberd:
Now view You said that you don't have mod_offline enabled in your configuration file, then... why is mod_offline enabled in ejabberd? Maybe ejabberd reads other configuration file, or some additional files that enabled it. Config file pathsLet's see what configuration files are read by ejabberd. Open an interactive erlang shell attached to your ejabberd node, so you can execute erlang functions and get their result. This is an example in my test server:
Now check all those files. Does any of those files enable mod_offline? Install mod_webadmin_configAlternatively to the previous methods, you can install mod_webadmin_config. That module adds a page to ejabberd's WebAdmin that shows the configuration files that are read and also shows the options being used. |
Environment
ejabberd version: 24.2.40
Using the ejabberd/ecs docker container
Configuration
Bug Description
I call Admin Api: https://docs.ejabberd.im/developer/ejabberd-api/admin-api/#create_room_with_opts
Sometime i get an error
"Room already exists"
I can see it created by command
ejabberdctl get_room_options order_53772 conference.localhost
but it not getting saved in muc_room and muc_room_subscribers tables in mysql.
Please help. Thanks.!
The text was updated successfully, but these errors were encountered: