esl / MongooseIM

MongooseIM is Erlang Solutions' robust, scalable and efficient XMPP server, aimed at large installations. Specifically designed for enterprise purposes, it is fault-tolerant and can utilise the resources of multiple clustered machines.
Other
1.67k stars 427 forks source link

Unable to invite user through muc-light rest API. Getting Caught error:{badmatch,undefined} #1401

Closed simmibadhan closed 6 years ago

simmibadhan commented 7 years ago

MongooseIM version: 2.0.1 Installed from: source Erlang/OTP version: 19.3.6

User1 has created a muc room with id group_user_1 when User1 tries to invite User2 with below params, I get a 500 error: Error: 2017-07-18 05:48:49.278 [error] <0.5875.0>@mongoose_commands:execute_command:357 Caught error:{badmatch,undefined} while executing invite_to_room

Rest API: POST http://xxx.xx.xxx.xx:8088/api/muc-lights/host_name/group_user_1/participants {:sender=>"user1@host_name", :recipient=>"user2@host_name"}

Also I'm not able to open the swagger link http://mongooseim.readthedocs.io/en/latest/swagger/index.html It shows error: failed to parse JSON/YAML response

Please help.

simmibadhan commented 7 years ago

I accessed the swagger link like this - http://mongooseim.readthedocs.io/en/2.0.1/swagger/index.html and it works. The documentation says I have to add group name in the API. However, the API response is nil now and the number of occupants in the room is still one.

fenek commented 6 years ago

Hi @simmibadhan

I apologise for a late response. If your issue is still valid:

We've fixed the Swagger frames in our docs but the fix does not affect 2.0.1 version. Please take a look at current master:

http://mongooseim.readthedocs.io/en/latest/rest-api/Client-frontend/ http://mongooseim.readthedocs.io/en/latest/rest-api/Administration-backend/

Does your problem with MUC Light API persist? If so, can you please share your ejabberd.cfg with us? Feel free to remove the passwords from the uploaded file.

fenek commented 6 years ago

Closing due to inactivity. Please reopen if the problem persists.

jeanparpaillon commented 5 years ago

I experiment (quite) the same issue with MongooseIM 3.2.0:

[error] Caught error:{badmatch,none} while executing invite_to_room stacktrace=[{mod_muc_light_commands,muc_light_room_name_to_jid_and_aff,3,[{file,"/home/travis/build/esl/MongooseIM/_build/prod/lib/mongooseim/src/muc_light/mod_muc_light_commands.erl"},{line,264}]},{mod_muc_light_commands,invite_to_room,4,[{file,"/home/travis/build/esl/MongooseIM/_build/prod/lib/mongooseim/src/muc_light/mod_muc_light_commands.erl"},{line,169}]},{mongoose_commands,check_and_execute,3,[{file,"/home/travis/build/esl/MongooseIM/_build/prod/lib/mongooseim/src/mongoose_commands.erl"},{line,401}]},{mongoose_commands,execute_command,3,[{file,"/home/travis/build/esl/MongooseIM/_build/prod/lib/mongooseim/src/mongoose_commands.erl"},{line,346}]},{mongoose_api_common,execute_command,3,[{file,"/home/travis/build/esl/MongooseIM/_build/prod/lib/mongooseim/src/mongoose_api_common.erl"},{line,221}]},{mongoose_api_common,handle_request,5,[{file,"/home/travis/build/esl/MongooseIM/_build/prod/lib/mongooseim/src/mongoose_api_common.erl"},{line,128}]},{cowboy_rest,call,3,[{file,"/home/travis/build/esl/MongooseIM/_build/default/lib/cowboy/src/cowboy_rest.erl"},{line,1182}]},{cowboy_rest,process_content_type,3,[{file,"/home/travis/build/esl/MongooseIM/_build/default/lib/cowboy/src/cowboy_rest.erl"},{line,986}]}]

Maybe something related to bare id vs full jid ?

fenek commented 5 years ago

Hi @jeanparpaillon

This issue is different, as your error is {badmatch, none}. Can you please create a new issue for your problem and paste the request that has triggered this crash?

jeanparpaillon commented 5 years ago

@fenek thank you for your answer. My problem was I because I was using room id instead of room name