matrix-org / matrix-bifrost

General purpose bridging with a variety of backends including libpurple and xmpp.js
Apache License 2.0
162 stars 31 forks source link

Failed to add account: Protocol does not let you create new accounts #231

Open Zenuncl opened 3 years ago

Zenuncl commented 3 years ago

Using Docker + XMPP.js, spend few days and I assume it's setup correctly. I can invite bot into a room on Matrix network now.

Own a matrix homeserver and a XMPP server.

I tried to link one account so all message can be bridged, but seems like doesn't work:

accounts add xmpp-js xmpp_username@xmpp_server.tld

Failed to add account:Protocol does not let you create new accounts

Looked through entire issue and documentations, including the config file, I didn't see anywhere mention how xmpp.js link account works?.

Either:

Logs:

Feb-10 18:40:54.753 INFO cli Loading config file /data/config.yaml
Feb-10 18:40:54.799 INFO Program Starting appservice listener on port 9555
Feb-10 18:40:54.989 INFO Program Selecting xmpp-js as a backend
Feb-10 18:40:54.990 INFO Program Enabling metrics
Feb-10 18:40:55.000 WARN NeDBStore Starting integrity check
Feb-10 18:40:55.001 WARN NeDBStore Check WILL modify database
Feb-10 18:40:55.003 INFO NeDBStore Found 0 room entries, 0 of which are invalid
Feb-10 18:40:55.004 INFO NeDBStore Found 0 user entries, 0 of which have no type
Feb-10 18:40:55.004 INFO NeDBStore Also found 0 invalid ghosts
Feb-10 18:40:55.004 INFO Program Checking if homeserver is up
Feb-10 18:40:55.049 INFO Program Ensuring bot is registered
Feb-10 18:40:55.084 WARN bridge [-] POST https://my-matrix-server.tld/_matrix/client/r0/register (AS) HTTP 400 Error: "{\"errcode\":\"M_USER_IN_USE\",\"error\":\"User ID already taken.\"}"
Feb-10 18:40:55.227 INFO RoomAliasSet Loaded 1 regexes
Feb-10 18:40:55.228 INFO Program Bridge has started.
Feb-10 18:40:55.229 INFO XmppJsInstance Starting new XMPP component instance to xmpp://xmpp-docker-hostname-or-ip:5347 using domain my-xmpp-component-domain.tld
Feb-10 18:40:55.229 INFO XMPP-conn status: connecting
Feb-10 18:40:55.236 INFO XMPP-conn status: connect
Feb-10 18:40:55.237 INFO XMPP-conn status: opening
Feb-10 18:40:55.256 INFO XMPP-conn status: open
Feb-10 18:40:55.267 INFO XMPP-conn status: online
Feb-10 18:40:55.268 INFO XMPP-conn gone online as my-xmpp-component-domain.tld
Feb-10 18:40:55.268 INFO XmppJsInstance flushing 0 buffered messages
Feb-10 18:40:55.269 INFO RoomSync Beginning sync
Feb-10 18:40:55.269 INFO RoomSync Got 0 group rooms
Feb-10 18:40:55.270 INFO RoomSync Finished sync
Feb-10 18:40:55.271 INFO Program Initiation of bridge complete
Feb-10 18:43:11.204 INFO MatrixEventHandler Got invite from @me:homeserver-domain.tld to !random-room-id:homeserver-domain.tld
Feb-10 18:43:11.790 INFO NeDBStore Storing remote room (user-admin) !random-room-id:homeserver-domain.tld
Feb-10 18:43:11.792 INFO MatrixEventHandler Created new 1 to 1 admin room

PS: It's really good if we can provide a better docker documentations, so user need this bridge don't need (like me) search around. Here is some suggestion:

Then run following two commands to generate the file and move it to /data

node /app/lib/Program.js -r -c /data/config.yaml -u http://your-docker-ip-or-hostname:9555 mv /app/bifrost-registration.yaml /data/registration.yaml


(There really should an auto generate `registration.yaml` file process in docker)
Zenuncl commented 3 years ago

Update:

Tried this which added account:

accounts add-existing xmpp-js xmpp_username@xmpp_server.tld

Now accounts shows:

Linked accounts:
    - undefined [Protocol not enabled] (xmpp_username@xmpp_server.tld)

Can't enable, I assume xmpp-js can't link to any existing XMPP accounts. It doesn't seem register any new components account either.

Based on this 2 years old issue XMPP.js (in 2019 at least) doesn't support using existing account option.

# Cannot enable it either
accounts enable xmpp-js xmpp_username@xmpp_server.tld

Failed to enable account:Protocol does not let you create new accounts

In case developers and maintainers haven't notice:

monofox commented 3 years ago

Took me a while, stumpled upon the same issue. For xmpp-js there is no direct accounting linking. Its automatically solved due to registration as separate component. Got it working with manual / step-by-step at https://wiki.calculate-linux.org/matrix_xmpp_bridge Its indeed working. You may want to try as well @SharkIng Even interacting with bot is not required.

Only issue is: if you regular jid is abc@im.jabberhost.org it would be e.g. abc@matrix.im.jabberhost.org

Zenuncl commented 3 years ago

I tried it but it didn't work when I set it up a few months ago. I'll take a look again

On Mon, Apr 12, 2021 at 3:21 PM Lukas Schreiner @.***> wrote:

Took me a while, stumpled upon the same issue. For xmpp-js there is no direct accounting linking. Its automatically solved due to registration as separate component. Got it working with manual / step-by-step at https://wiki.calculate-linux.org/matrix_xmpp_bridge Its indeed working. You may want to try as well @SharkIng https://github.com/SharkIng

Only issue is: if you regular jid is @. it would be e.g. @.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/matrix-org/matrix-bifrost/issues/231#issuecomment-818070403, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZJSXXA5GVSUNA6P4PG5JDTINB2PANCNFSM4XNQQ3WQ .