matrix-org / matrix-org/matrix-bifrost
Bot don't answer to any message
Open
Nobody has claimed this yet.
T-Documentation
- Dominant language
- TypeScript
- Stars
- 187
- Forks
- 38
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I've tried to setup this bridge. The bridge don't answer to any command. I've tried the command explained here but nothing.
Here is my log of the bridge:
root@hostname:/opt/matrix-bifrost# bash start.sh
> matrix-bifrost@0.1.8 build /opt/matrix-bifrost
> tsc
> matrix-bifrost@0.1.8 start /opt/matrix-bifrost
> node build/src/Program.js -c config.yaml "--port" "3642"
Jul-26 23:32:35.525 INFO cli Loading config file %s /opt/matrix-bifrost/config.yaml
Jul-26 23:32:35.982 INFO Program Starting purple bridge on port 29320
Jul-26 23:32:36.149 INFO Program Selecting node-purple as a backend
Jul-26 23:32:37.221 INFO Program Enabling metrics
Jul-26 23:32:37.330 INFO PgDatstore Starting postgres database engine
Jul-26 23:32:37.836 INFO PgDatstore Database schema is at version v2
Jul-26 23:32:38.195 WARN bridge [-] POST http://localhost:8008/_matrix/client/r0/register (AS) HTTP 400 Error: "{\"errcode\":\"M_USER_IN_USE\",\"error\":\"User ID already taken.\"}"
Jul-26 23:32:38.305 INFO RoomAliasSet Loaded 1 regexes
Jul-26 23:32:38.309 INFO Program Bridge has started.
Jul-26 23:32:38.313 INFO PurpleInstance Starting purple instance
Jul-26 23:32:38.315 INFO PurpleInstance Plugin search path is set to /opt/matrix-bifrost/node_modules/node-purple/deps/libpurple
(process:25382): GLib-CRITICAL **: 23:32:38.318: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed
(process:25382): GLib-CRITICAL **: 23:32:38.319: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed
** (process:25382): CRITICAL **: 23:32:38.320: purple_dbus_register_pointer: assertion 'map_node_id' failed
Jul-26 23:32:38.886 INFO PurpleInstance Started purple instance
Jul-26 23:32:38.891 INFO PurpleInstance Got supported protocols: prpl-aim prpl-gg prpl-novell prpl-icq prpl-irc prpl-simple prpl-threepl prpl-jabber prpl-zephyr
Jul-26 23:32:38.896 INFO RoomSync Beginning sync
Jul-26 23:32:38.913 INFO RoomSync Got 0 group rooms
Jul-26 23:32:38.915 INFO RoomSync Finished sync
Jul-26 23:32:38.917 INFO Program Initiation of bridge complete
Jul-27 18:08:22.702 INFO MatrixEventHandler Got invite from @user:domain.tld to !vHIDGIDxMIsozmRnEC:domain.tld
Jul-27 18:08:23.863 INFO MatrixEventHandler Created new 1 to 1 admin room
(node:24343) UnhandledPromiseRejectionWarning: error: il n'existe aucune contrainte unique ou contrainte d'exclusion correspondant à la spécification ON CONFLICT
at Connection.parseE (/opt/matrix-bifrost/node_modules/pg/lib/connection.js:604:11)
at Connection.parseMessage (/opt/matrix-bifrost/node_modules/pg/lib/connection.js:401:19)
at Socket.<anonymous> (/opt/matrix-bifrost/node_modules/pg/lib/connection.js:121:22)
at Socket.emit (events.js:198:13)
at addChunk (_stream_readable.js:288:12)
at readableAddChunk (_stream_readable.js:269:11)
at Socket.Readable.push (_stream_readable.js:224:10)
at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
(node:24343) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:24343) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
My registration config file:
id: purple-bridge
hs_token: TOKEN
as_token: OTHER_TOKEN
namespaces:
users:
- exclusive: true
regex: '@purple_.+'
aliases:
- exclusive: true
regex: '#purple_.+'
rooms: []
url: 'http://localhost:29320'
sender_localpart: purplebot
rate_limited: true
protocols: null
My bitfrost config.yaml file:
bridge:
# Your homeserver server_name.
domain: "domain.tld"
# A internally reachable endpoint for the CS api of the homeserver.
homeserverUrl: "http://localhost:8008"
# Prefix of all users of the bridge.
userPrefix: "purple_"
# If homeserverUrl is not reachable publically, the public address that media can be reached on.
# mediaserverUrl: "http://example.com:8008"
# Set this to the port you want the bridge to listen on.
appservicePort: 29320
datastore:
# The datastore engine to use, either "nedb" or "postgres"
engine: "postgres"
# For NeDB:
# Location of the user and room database files, by default will be stored in the working directory.
# For Postgres:
# A postgres style connection string, e.g. "postgres://postgres:pass@localhost/bifrost"
connectionString: "postgres://bifrost:pwd@localhost/bifrost"
purple:
# For selecting a specific backend. One of "node-purple", "xmpp.js". Defaults to "node-purple"
backend: "node-purple"
# -- For xmpp.js - You need an existing xmpp server for this to work.
backendOpts:
# endpoint to reach the component on. The default port is 5347
service: "xmpp://localhost:5347"
# domin assigned to the component.
domain: "matrix.localhost"
# password needed by the component.
password: "jam"
enableGateway: false
# Matrix forwards room aliases join requests matching a regex in the
# registration file to the owner's bridge, if the room doesn't exist.
# The following options allow you to configure how the purple bridge may
# match those aliases to remote rooms.
portals:
# Enable gateway support for protocols that support them, e.g. xmpp.js
enableGateway: false
# List of regexes to match a alias that can be turned into a bridge.
aliases:
# This matches _purple_ followed by anything
"/^_purple_(.+)$/":
# Use the prpl-jabber protocol.
protocol: "prpl-jabber"
properties:
# Set room to the first regex match
room: "regex:1"
# Set the server to be conf.localhost
server: "conf.localhost"
# For xmpp.js, please use:
# Automatically register users with accounts if they join/get invited
# a room with a protocol they are not bound to.
# This is REQUIRED for xmpp.js to work.
autoRegistration:
enabled: true
protocolSteps:
# For xmpp.js, please use:
xmpp-js:
type: "implicit"
parameters:
username: "<T_LOCALPART>@matrix.localhost"
# Set up access controls for the bridge
# access:
# accountCreation:
# whitelist:
# - "^@.*:yourdomain$"
# Available subsitution variables for parameters:
# <T_MXID> - The users mxid.
# <T_MXID_SANE> - The users mxid, with an : replaced with _ and the @ discarded.
# <T_DOMAIN> - The users domain.
# <T_LOCALPART> - The users localpart.
# <T_DISPLAYNAME> - The users displayname, or localpart if not set.
# <T_GENERATEPWD> - Generates a 32 char password
# <T_AVATAR> - The MXC url of the users avatar, if available.
## This is how to autoregister folks with prosody (xmpp)
## with the included lua script in extras. This applies to node-purple (NOT xmpp.js)
# protocolSteps:
# prpl-jabber:
# type: "http"
# path: "http://localhost:5280/register_account/"
# opts:
# method: "post"
# usernameResult: null
# parameters:
# username: "m_<T_LOCALPART>"
# nick: "<T_DISPLAYNAME>"
# password: "<T_GENERATEPWD>"
# auth_token: "bridge-token"
# ip: "127.0.0.1"
# paramsToStore:
# - password
# Enable prometheus metrics reporting.
# This will report metrics on /metrics on the same port as the bridge.
metrics:
enabled: true
provisioning:
# Can users use ""!purple" in a room to bridge it to a group.
enablePlumbing: false
# Required power level to bridge a room into a group.
requiredUserPL: 100
logging:
# Set the logging level for stdout.
# Lower levels are inclusive of higher levels e.g. info will contain warn and error logging.
console: "info" # "debug", "info", "warn", "error", "off"
# A list of files and their associated logging levels.
files:
"./info.log": "info"
"./error.log": "error"
"./warn.log": "warn"
# "./debug.log": "debug"
# These are specific flags or values to tune the bridge to different setups.
# The defaults are usually fine, but adjust as needed.
tuning:
# Do not send a message or join a room before setting a users profile for
# the first time. This should help clients hide ugly mxids better behind
# displaynames.
waitOnProfileBeforeSend: true
# A nasty hack to check the domain for conf* to see if the PM is coming from a MUC.
# This is only really needed for legacy clients that don't implement xmlns.
# This is specific to the XMPP.js bridge.
# conferencePMFallbackCheck: false
# Don't send messages from the remote protocol until we have seen them join.
# A list of prefixes to check for a userId.
# This is useful for talking to remote IRC users who might not see a message
# until after they have joined.
# waitOnJoinBeforePM: string[];
My synapse log when I send a message to the bot:
2020-07-26 23:47:28,252 - synapse.access.http.8008 - 312 - INFO - OPTIONS-69- 2a0a:db40:101:0:cc4:aeaa:7b9f:8182 - 8008 - {None} Processed request: 0.004sec/-0.000sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 2B 200 "OPTIONS /_matrix/client/r0/presence/%40username%3Adomain.tld/status HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" [0 dbevts]
2020-07-26 23:47:28,308 - synapse.access.http.8008 - 312 - INFO - PUT-70- 2a0a:db40:101:0:cc4:aeaa:7b9f:8182 - 8008 - {@username:domain.tld} Processed request: 0.007sec/0.002sec (0.007sec, 0.000sec) (0.000sec/0.000sec/0) 2B 200 "PUT /_matrix/client/r0/presence/%40username%3Adomain.tld/status HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" [0 dbevts]
2020-07-26 23:47:31,214 - synapse.access.http.8008 - 312 - INFO - OPTIONS-71- 2a0a:db40:101:0:cc4:aeaa:7b9f:8182 - 8008 - {None} Processed request: 0.003sec/-0.000sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 2B 200 "OPTIONS /_matrix/client/r0/rooms/!sfJOrQuulmtfCdetIq%3Adomain.tld/typing/%40username%3Adomain.tld HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" [0 dbevts]
2020-07-26 23:47:31,304 - synapse.access.http.8008 - 312 - INFO - PUT-72- 2a0a:db40:101:0:cc4:aeaa:7b9f:8182 - 8008 - {@username:domain.tld} Processed request: 0.064sec/0.003sec (0.015sec, 0.000sec) (0.000sec/0.000sec/0) 2B 200 "PUT /_matrix/client/r0/rooms/!sfJOrQuulmtfCdetIq%3Adomain.tld/typing/%40username%3Adomain.tld HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" [1 dbevts]
2020-07-26 23:47:31,386 - synapse.access.http.8008 - 312 - INFO - GET-64- 2a0a:db40:101:0:cc4:aeaa:7b9f:8182 - 8008 - {@username:domain.tld} Processed request: 24.033sec/0.003sec (0.054sec, 0.006sec) (0.014sec/0.034sec/3) 1000B 200 "GET /_matrix/client/r0/sync?filter=27&timeout=30000&since=s379287_6872553_0_216397_79939_3_687_96875_23 HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" [0 dbevts]
2020-07-26 23:47:31,565 - synapse.access.http.8008 - 312 - INFO - OPTIONS-73- 2a0a:db40:101:0:cc4:aeaa:7b9f:8182 - 8008 - {None} Processed request: 0.004sec/-0.000sec (0.001sec, 0.000sec) (0.000sec/0.000sec/0) 2B 200 "OPTIONS /_matrix/client/r0/sync?filter=27&timeout=30000&since=s379287_6872555_1_216397_79939_3_687_96875_23 HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" [0 dbevts]
2020-07-26 23:47:31,777 - synapse.access.http.8008 - 312 - INFO - GET-74- 2a0a:db40:101:0:cc4:aeaa:7b9f:8182 - 8008 - {@username:domain.tld} Processed request: 0.156sec/0.010sec (0.025sec, 0.000sec) (0.000sec/0.000sec/0) 719B 200 "GET /_matrix/client/r0/sync?filter=27&timeout=30000&since=s379287_6872555_1_216397_79939_3_687_96875_23 HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" [0 dbevts]
2020-07-26 23:47:31,781 - synapse.access.http.8008 - 312 - INFO - PUT-75- 2a0a:db40:101:0:cc4:aeaa:7b9f:8182 - 8008 - {@username:domain.tld} Processed request: 0.063sec/0.007sec (0.023sec, 0.000sec) (0.000sec/0.000sec/0) 2B 200 "PUT /_matrix/client/r0/rooms/!sfJOrQuulmtfCdetIq%3Adomain.tld/typing/%40username%3Adomain.tld HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" [0 dbevts]
2020-07-26 23:47:31,797 - synapse.access.http.8008 - 312 - INFO - OPTIONS-76- 2a0a:db40:101:0:cc4:aeaa:7b9f:8182 - 8008 - {None} Processed request: 0.003sec/-0.000sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 2B 200 "OPTIONS /_matrix/client/r0/rooms/!sfJOrQuulmtfCdetIq%3Adomain.tld/send/m.room.message/m1595800051613.9 HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" [0 dbevts]
2020-07-26 23:47:31,988 - synapse.access.http.8008 - 312 - INFO - OPTIONS-78- 2a0a:db40:101:0:cc4:aeaa:7b9f:8182 - 8008 - {None} Processed request: 0.024sec/-0.001sec (0.002sec, 0.000sec) (0.000sec/0.000sec/0) 2B 200 "OPTIONS /_matrix/client/r0/sync?filter=27&timeout=30000&since=s379287_6872555_2_216397_79939_3_687_96875_23 HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" [0 dbevts]
2020-07-26 23:47:32,003 - synapse.access.http.8008 - 312 - INFO - OPTIONS-79- 2a0a:db40:101:0:cc4:aeaa:7b9f:8182 - 8008 - {None} Processed request: 0.035sec/-0.000sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 2B 200 "OPTIONS /_matrix/client/r0/publicised_groups HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" [0 dbevts]
2020-07-26 23:47:32,085 - twisted - 192 - INFO - - Timing out client: IPv6Address(type='TCP', host='::ffff:163.172.170.122', port=33356, flowInfo=0, scopeID=0)
2020-07-26 23:47:32,104 - synapse.access.http.8008 - 312 - INFO - POST-81- 2a0a:db40:101:0:cc4:aeaa:7b9f:8182 - 8008 - {@username:domain.tld} Processed request: 0.040sec/0.002sec (0.008sec, 0.000sec) (0.006sec/0.025sec/1) 34B 200 "POST /_matrix/client/r0/publicised_groups HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" [0 dbevts]
2020-07-26 23:47:32,494 - synapse.access.http.8008 - 312 - INFO - PUT-77- 2a0a:db40:101:0:cc4:aeaa:7b9f:8182 - 8008 - {@username:domain.tld} Processed request: 0.631sec/0.004sec (0.105sec, 0.008sec) (0.039sec/0.086sec/10) 60B 200 "PUT /_matrix/client/r0/rooms/!sfJOrQuulmtfCdetIq%3Adomain.tld/send/m.room.message/m1595800051613.9 HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" [2 dbevts]
2020-07-26 23:47:32,537 - synapse.metrics - 545 - INFO - - Collecting gc 1
2020-07-26 23:47:32,641 - synapse.appservice.scheduler - 78 - INFO - as_scheduler-0- Starting appservice scheduler
2020-07-26 23:47:32,683 - synapse.access.http.8008 - 312 - INFO - GET-80- 2a0a:db40:101:0:cc4:aeaa:7b9f:8182 - 8008 - {@username:domain.tld} Processed request: 0.635sec/0.002sec (0.064sec, 0.006sec) (0.007sec/0.049sec/3) 1227B 200 "GET /_matrix/client/r0/sync?filter=27&timeout=30000&since=s379287_6872555_2_216397_79939_3_687_96875_23 HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" [1 dbevts]
2020-07-26 23:47:32,906 - synapse.http.client - 281 - INFO - as-sender-purple-bridge-0- Sending request PUT http://localhost:29320/transactions/1?access_token=<redacted>
2020-07-26 23:47:33,096 - synapse.access.http.8008 - 312 - INFO - OPTIONS-82- 2a0a:db40:101:0:cc4:aeaa:7b9f:8182 - 8008 - {None} Processed request: 0.034sec/-0.001sec (0.006sec, 0.000sec) (0.000sec/0.000sec/0) 2B 200 "OPTIONS /_matrix/client/r0/profile/%40username%3Adomain.tld HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" [0 dbevts]
2020-07-26 23:47:33,124 - synapse.access.http.8008 - 312 - INFO - OPTIONS-83- 2a0a:db40:101:0:cc4:aeaa:7b9f:8182 - 8008 - {None} Processed request: 0.055sec/-0.000sec (0.002sec, 0.000sec) (0.000sec/0.000sec/0) 2B 200 "OPTIONS /_matrix/client/r0/keys/query HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" [0 dbevts]
2020-07-26 23:47:33,133 - synapse.access.http.8008 - 312 - INFO - OPTIONS-84- 2a0a:db40:101:0:cc4:aeaa:7b9f:8182 - 8008 - {None} Processed request: 0.022sec/-0.000sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 2B 200 "OPTIONS /_matrix/client/r0/sync?filter=27&timeout=30000&since=s379288_6872555_2_216397_79939_3_687_96875_23 HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" [0 dbevts]
2020-07-26 23:47:33,167 - synapse.http.client - 318 - INFO - as-sender-purple-bridge-0- Received response to PUT http://localhost:29320/transactions/1?access_token=<redacted>: 200
2020-07-26 23:47:33,234 - synapse.access.http.8008 - 312 - INFO - GET-85- 2a0a:db40:101:0:cc4:aeaa:7b9f:8182 - 8008 - {None} Processed request: 0.085sec/0.003sec (0.011sec, 0.002sec) (0.014sec/0.047sec/2) 29B 200 "GET /_matrix/client/r0/profile/%40username%3Adomain.tld HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" [0 dbevts]
2020-07-26 23:47:33,241 - synapse.access.http.8008 - 312 - INFO - POST-86- 2a0a:db40:101:0:cc4:aeaa:7b9f:8182 - 8008 - {@username:domain.tld} Processed request: 0.074sec/0.011sec (0.022sec, 0.000sec) (0.007sec/0.028sec/2) 5732B 200 "POST /_matrix/client/r0/keys/query HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" [0 dbevts]
2020-07-26 23:47:33,358 - synapse.access.http.8008 - 312 - INFO - OPTIONS-88- 2a0a:db40:101:0:cc4:aeaa:7b9f:8182 - 8008 - {None} Processed request: 0.003sec/-0.000sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 2B 200 "OPTIONS /_matrix/client/unstable/room_keys/version HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" [0 dbevts]
2020-07-26 23:47:33,596 - synapse.access.http.8008 - 312 - INFO - GET-89- 2a0a:db40:101:0:cc4:aeaa:7b9f:8182 - 8008 - {@username:domain.tld} Processed request: 0.048sec/0.002sec (0.017sec, 0.000sec) (0.008sec/0.029sec/2) 783B 200 "GET /_matrix/client/unstable/room_keys/version HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0" [0 dbevts]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with start.sh and config.yaml, then trace the PostgreSQL error reported when the MatrixEventHandler creates the admin room. Confirm the bridge can process a bot command without the constraint or unhandled-rejection failure, and verify that the bot replies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, postgresql, typescript
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100