matrix-org / matrix-appservice-discord

A bridge between Matrix and Discord.
Apache License 2.0
785 stars 148 forks source link

errno: -111 ECONNREFUSED starting up discord bridge #879

Open tedwardd opened 1 year ago

tedwardd commented 1 year ago

Server is set up using the matrix-docker-ansible-deploy project. The appservice-discord is enabled through this as well. The bot is setup and configured on the Discord side and has successfully been joined to the Discord server. When trying to start up the appservice-discord service on the Matrix server side I get the following:

Mar 10 21:56:06 jupiter systemd[1]: Starting Matrix Appservice Discord bridge...
Mar 10 21:56:11 jupiter systemd[1]: Started Matrix Appservice Discord bridge.
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]: Mar-10 21:56:13.822 [bot-sdkMatrixHttpClient] error: [
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:   '(REQ-1)',
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:   Error: connect ECONNREFUSED 127.0.0.1:443
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:       at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:     errno: -111,
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:     code: 'ECONNREFUSED',
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:     syscall: 'connect',
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:     address: '127.0.0.1',
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:     port: 443
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:   }
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]: ]
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]: Mar-10 21:56:13.823 [bot-sdkAppservice] error: [ 'Encountered error registering user: ' ]
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]: Mar-10 21:56:13.823 [bot-sdkAppservice] error: [
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:   Error: connect ECONNREFUSED 127.0.0.1:443
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:       at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:     errno: -111,
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:     code: 'ECONNREFUSED',
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:     syscall: 'connect',
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:     address: '127.0.0.1',
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:     port: 443
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:   }
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]: ]
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]: Mar-10 21:56:13.824 [DiscordAS] error: A fatal error occurred during startup: Error: connect ECONNREFUSED 127.0.0.1:443
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:   errno: -111,
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:   code: 'ECONNREFUSED',
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:   syscall: 'connect',
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:   address: '127.0.0.1',
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]:   port: 443
Mar 10 21:56:13 jupiter matrix-appservice-discord[3813863]: }
Mar 10 21:56:14 jupiter systemd[1]: matrix-appservice-discord.service: Main process exited, code=exited, status=1/FAILURE
Mar 10 21:56:14 jupiter systemd[1]: matrix-appservice-discord.service: Failed with result 'exit-code'.

The relevant configs are below:

# cat config.yaml
auth:
  botToken: XXXXXXX
  clientID: 'XXXXXXX'
  usePrivilegedIntents: false
bridge:
  adminMxid: ''
  determineCodeLanguage: false
  disableDeletionForwarding: false
  disableInviteNotifications: false
  disableJoinLeaveNotifications: false
  disablePortalBridging: false
  disablePresence: false
  disableReadReceipts: false
  disableRoomTopicNotifications: false
  disableTypingNotifications: false
  domain: techmachine.net
  enableSelfServiceBridging: true
  homeserverUrl: https://matrix.<redacted>.net
  invalidTokenMessage: Your Discord bot token seems to be invalid, and the bridge cannot function. Please update it in your bridge settings and restart the bridge
  presenceInterval: 500
channel:
  deleteOptions:
    disableMessaging: false
    ghostsLeave: true
    setInviteOnly: true
    unlistFromDirectory: true
    unsetRoomAlias: true
  namePattern: '[Discord] :guild :name'
database:
  connString: postgresql://matrix_appservice_discord:xxxxxxxx-b0c2-5417-xxxx-ba99d13fxxxx@matrix-postgres:5432/matrix_appservice_discord
ghosts:
  nickPattern: :nick
  usernamePattern: :username#:tag
limits:
  discordSendDelay: 1500
  roomGhostJoinDelay: 6000
logging:
  console: warn
  lineDateFormat: MMM-D HH:mm:ss.SSS
metrics:
  enable: false
  host: 127.0.0.1
  port: 9001
room:
  defaultVisibility: public
  # cat registration.yaml
as_token: <redacted>
hs_token: <redacted>
id: appservice-discord
namespaces:
  aliases:
  - exclusive: true
    regex: '#_discord_.*:<redacted>\.net'
  users:
  - exclusive: true
    regex: '@_discord_.*:<redacted>\.net'
protocols:
- discord
rate_limited: false
sender_localpart: snekbridge
url: http://matrix-appservice-discord:9005

This is an otherwise functioning Matrix server so I'm not quite sure what's going on.

Mrs-Feathers commented 5 months ago

looks like you've put in possibly the wrong port