esl / MongooseDocs

Documentation for MongooseIM, in this repo's gh-pages: https://esl.github.io/MongooseDocs/latest/
https://esl.github.io/MongooseDocs/latest/
2 stars 3 forks source link

New user and documentation not tracking to success #1

Open michaelwa opened 1 year ago

michaelwa commented 1 year ago

I am not able to navigate multiple issues. I assume the product is okay and that as a first-time user of the product it is likely something that I am not doing correctly but the documentation should have guided me to success.

I am trying to learn about MongooseIM and I am following the documentation. My first goal is to setup a server and connect a gajim client.

My setup:

docker pull mongooseim/mongooseim docker run -d -t -h mongooseim-1 --name mongooseim-1 -p 5222:5222 mongooseim/mongooseim:latest

My Test:

telnet localhost 5222

This worked as expected. If I shut down the container and test again the telnet session hangs. Then when I start the container back up I get the desired results again.

My interactive session:

docker exec -i -t mongooseim-1 /bin/bash

/usr/lib/mongooseim/bin/mongooseimctl account registerUser --username alice --domain localhost --password qwerty /usr/lib/mongooseim/bin/mongooseimctl account registerUser --username bob --domain localhost --password 12345678 /usr/lib/mongooseim/bin/mongooseimctl account registerUser --username carol --domain localhost --password abc123 /usr/lib/mongooseim/bin/mongooseimctl account registerUser --username dan --domain localhost --password dan

/usr/lib/mongooseim/bin/mongooseimctl account listUsers --domain localhost

All commands listed in the documentation work up to "add_contact".

/usr/lib/mongooseim/bin/mongooseimctl roster addContact --user alice@localhost --contact bob@localhost --groups '["friends"]' --name Bobby { "errors" : [ { "path" : [ "roster", "addContact" ], "message" : "Unexpected RosterAdminMutation resolver crash", "extensions" : { "code" : "resolver_crash" } } ], "data" : { "roster" : { "addContact" : null } } }

I don't know if I need this command to succeed in order to connect gajim to my server but it does appear in the documentation before the instructions on setting up gajim. All my attempts to connect to gajim as outlined in the documentation have failed. Is this because of the "addContact" failure?

I am able to add users to gajim but it is not able to communicate with the server in any capacity.

Are there better beginner guides or tutorials for me to be following?

arcusfelis commented 1 year ago

Hi, if unexpected crash happens, do:

docker logs mongooseim-1

Could you repeat on your machine and check?

michaelwa commented 1 year ago

Hello,

Thank you for the reply!!

MongooseIM is not actually crashing. It is always running but I cannot perform the addContact step as outlined in the documentation and the second item of concern is the gajim application is not able to connect with the MongooseIM server at all.

The command:

mongooseimctl roster addContact --user @. --contact @. --groups '["friends"]' --name Bobby

Fails with the following:

{ "errors" : [ { "path" : [ "roster", "addContact" ], "message" : "Unexpected RosterAdminMutation resolver crash", "extensions" : { "code" : "resolver_crash" } } ], "data" : { "roster" : { "addContact" : null } } }

The tail of logs after executing addContact command follow:

when=2022-12-06T17:35:17.161872+00:00 level=error what=graphql_crash pid=<0.9006.1> at=mongoose_graphql_errors:crash/2:27 type=RosterAdminMutation stack="[{persistent_term,get,[{backend_module,<<\"localhost\">>,mod_roster}],[{error_info,#{module => erl_erts_errors}}]},{mongoose_backend,get_backend_module,2,[{file,\"/home/circleci/project/src/mongoose_backend.erl\"},{line,74}]},{mongoose_backend,call,4,[{file,\"/home/circleci/project/src/mongoose_backend.erl\"},{line,88}]},{mod_roster,set_roster_item,5,[{file,\"/home/circleci/project/src/mod_roster.erl\"},{line,414}]},{mod_roster_api,add_contact,4,[{file,\"/home/circleci/project/src/mod_roster_api.erl\"},{line,29}]},{mongoose_graphql_roster,add_contact,4,[{file,\"/home/circleci/project/src/graphql/mongoose_graphql_roster.erl\"},{line,23}]},{graphql_execute,resolve_field_value,7,[{file,\"/home/circleci/project/_build/default/lib/graphql/src/graphql_execute.erl\"},{line,538}]},{graphql_execute,execute_field,5,[{file,\"/home/circleci/project/_build/default/lib/graphql/src/graphql_execute.erl\"},{line,394}]}]" field=addContact error=badarg

There is no evidence in the logs for gajim contacting the server. I am not sure how to troubleshoot this at all.

I do know that the telnet test works for 'localhost' and 'mongooseim-1'. Though I did put in an entry in my hosts file to the docker container ip address.

Success with localhost:

❯ telnet localhost 5222 Trying ::1... Connected to localhost. Escape character is '^]'. ^ <?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream=' http://etherx.jabber.org/streams' id='e1efaf4745975387' from='localhost' version='1.0'><xml-not-well-formed xmlns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error></stream:stream>Connection closed by foreign host.

Success with mongooseim-1:

❯ telnet mongooseim-1 5222 Trying 172.17.0.2... Connected to mongooseim-1. Escape character is '^]'. ^ <?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream=' http://etherx.jabber.org/streams' id='eb41961c22244d3d' from='localhost' version='1.0'><xml-not-well-formed xmlns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error></stream:stream>Connection closed by foreign host.

Host file entry:

❯ cat /etc/hosts 127.0.0.1 localhost ::1 localhost 127.0.1.1 pop-os.localdomain pop-os 127.0.0.1 cedars-sinai.localhost.test 127.0.0.1 uofmhealth.localhost.test

172.17.0.2 mongooseim-1

Thanks again!

~-=Michael=-~

On Tue, Dec 6, 2022 at 1:42 AM Michael Uvarov @.***> wrote:

Hi, if unexpected crash happens, do:

docker logs mongooseim-1

Could you repeat on your machine and check?

— Reply to this email directly, view it on GitHub https://github.com/esl/MongooseDocs/issues/1#issuecomment-1339043399, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAZX3SJ7VKFIDTNB6ODTJ3WL4DCFANCNFSM6AAAAAASSK72AA . You are receiving this because you authored the thread.Message ID: @.***>

arcusfelis commented 1 year ago

you need to enable mod_roster in your mongooseim.toml config :) (We probably would patch the default config too)

(according to these log entries)

 when=2022-12-06T17:35:17.161872+00:00 level=error what=graphql_crash
 pid=<0.9006.1> at=mongoose_graphql_errors:crash/2:27
 type=RosterAdminMutation
 stack="[{persistent_term,get,[{backend_module,<<\"localhost\">>,mod_roster}],[{error_info,#{module
 =>
 erl_erts_errors}}]},{mongoose_backend,get_backend_module,2,
mahmadmujtaba commented 2 months ago

@arcusfelis Please update on this docs page that mod_roster needs to be added within toml file. Docs