I am trying to set up the ejabberd XMPP server on the VPS server (Digital Ocean, FreeBSD droplet). I had started the ejabberd service and was able to log into the developer console, register a user and log in. The problem that I right now have is that I cannot "add buddy" or start any s2s connections whatsoever as I get a 503-service unavailable error.
This is the debug output of me trying to send a Buddy request to my friends account (I replaced his real handle with "HANDLE"):
(ejabberd@localhost)1> 13:46:03.468 [debug] Received XML on stream = <<"<presence to='HANDLE@jabb3r.org' type='subscribe'/>">>
13:46:03.471 [debug] sending to process <0.1148.0>
13:46:03.473 [debug] route
from {jid,<<"admin">>,<<"vsydorov.me">>,<<>>,<<"admin">>,<<"vsydorov.me">>,<<>>}
to {jid,<<"admin">>,<<"vsydorov.me">>,<<"12836165211442403246588688">>,<<"admin">>,<<"vsydorov.me">>,<<"12836165211442403246588688">>}
packet {xmlel,<<"iq">>,[{<<"id">>,<<"push4236684536">>},{<<"type">>,<<"set">>}],[{xmlel,<<"query">>,[{<<"xmlns">>,<<"jabber:iq:roster">>}],[{xmlel,<<"item">>,[{<<"ask">>,<<"subscribe">>},{<<"subscription">>,<<"none">>},{<<"jid">>,<<"HANDLE@jabb3r.org">>}],[{xmlel,<<"group">>,[],[{xmlcdata,<<"Buddies">>}]}]}]}]}
13:46:03.473 [debug] local route
from {jid,<<"admin">>,<<"vsydorov.me">>,<<>>,<<"admin">>,<<"vsydorov.me">>,<<>>}
to {jid,<<"admin">>,<<"vsydorov.me">>,<<"12836165211442403246588688">>,<<"admin">>,<<"vsydorov.me">>,<<"12836165211442403246588688">>}
packet {xmlel,<<"iq">>,[{<<"id">>,<<"push"...>>},{<<"type">>,<<...>>}],[{xmlel,<<...>>,...}]}
13:46:03.473 [debug] session manager
from {jid,<<"admin">>,<<"vsydorov.me">>,<<>>,<<"admin">>,<<"vsydorov.me">>,<<>>}
to {jid,<<"admin">>,<<"vsydorov.me">>,<<"12836165211442403246588688">>,<<"admin">>,<<"vsydorov.me">>,<<"12836165211442403246588688">>}
packet {xmlel,<<"iq">>,[{<<"id">>,<<"push"...>>},{<<"type">>,<<...>>}],[{xmlel,<<...>>,...}]}
13:46:03.473 [debug] sending to process <0.1148.0>
13:46:03.473 [debug] route
from {jid,<<"admin">>,<<"vsydorov.me">>,<<>>,<<"admin">>,<<"vsydorov.me">>,<<>>}
to {jid,<<"HANDLE">>,<<"jabb3r.org">>,<<>>,<<"HANDLE">>,<<"jabb3r.org">>,<<>>}
packet {xmlel,<<"presence">>,[{<<"to">>,<<"HANDLE@jabb3r.org">>},{<<"type">>,<<"subscribe">>}],[]}
13:46:03.474 [debug] s2s manager
from {jid,<<"admin">>,<<"vsydorov.me">>,<<>>,<<"admin">>,<<"vsydorov.me">>,<<>>}
to {jid,<<"HANDLE">>,<<"jabb3r.org">>,<<>>,<<"HANDLE">>,<<"jabb3r.org">>,<<>>}
packet {xmlel,<<"presence">>,[{<<"to">>,<<"blac"...>>},{<<"type">>,<<...>>}],[]}
13:46:03.474 [debug] Finding connection for {<<"vsydorov.me">>,<<"jabb3r.org">>}
13:46:03.474 [debug] route
from {jid,<<"HANDLE">>,<<"jabb3r.org">>,<<>>,<<"HANDLE">>,<<"jabb3r.org">>,<<>>}
to {jid,<<"admin">>,<<"vsydorov.me">>,<<>>,<<"admin">>,<<"vsydorov.me">>,<<>>}
packet {xmlel,<<"presence">>,[{<<"type">>,<<"error">>},{<<"from">>,<<"HANDLE@jabb3r.org">>}],[{xmlel,<<"error">>,[{<<"code">>,<<"503">>},{<<"type">>,<<"cancel">>}],[{xmlel,<<"service-unavailable">>,[{<<"xmlns">>,<<"urn:ietf:params:xml:ns:xmpp-stanzas">>}],[]}]}]}
13:46:03.475 [debug] local route
from {jid,<<"HANDLE">>,<<"jabb3r.org">>,<<>>,<<"HANDLE">>,<<"jabb3r.org">>,<<>>}
to {jid,<<"admin">>,<<"vsydorov.me">>,<<>>,<<"admin">>,<<"vsydorov.me">>,<<>>}
packet {xmlel,<<"presence">>,[{<<"type">>,<<"erro"...>>},{<<"from">>,<<...>>}],[{xmlel,<<...>>,...}]}
13:46:03.475 [debug] session manager
from {jid,<<"HANDLE">>,<<"jabb3r.org">>,<<>>,<<"HANDLE">>,<<"jabb3r.org">>,<<>>}
to {jid,<<"admin">>,<<"vsydorov.me">>,<<>>,<<"admin">>,<<"vsydorov.me">>,<<>>}
packet {xmlel,<<"presence">>,[{<<"type">>,<<"erro"...>>},{<<"from">>,<<...>>}],[{xmlel,<<...>>,...}]}
13:46:03.475 [debug] session manager
from {jid,<<"HANDLE">>,<<"jabb3r.org">>,<<>>,<<"HANDLE">>,<<"jabb3r.org">>,<<>>}
to {jid,<<"admin">>,<<"vsydorov.me">>,<<"12836165211442403246588688">>,<<"admin">>,<<"vsydorov.me">>,<<"12836165211442403246588688">>}
packet {xmlel,<<"presence">>,[{<<"type">>,<<"erro"...>>},{<<"from">>,<<...>>}],[{xmlel,<<...>>,...}]}
13:46:03.475 [debug] sending to process <0.1148.0>
13:46:03.476 [debug] broadcast
{item,{<<"HANDLE">>,<<"jabb3r.org">>,<<>>},none}
13:46:03.476 [debug] roster changed for <<"admin">>
13:46:03.476 [debug] Send XML on stream = <<"<iq from='admin@vsydorov.me' to='admin@vsydorov.me/12836165211442403246588688' id='push4236684536' type='set'><query xmlns='jabber:iq:roster'><item ask='subscribe' subscription='none' jid='HANDLE@jabb3r.org'><group>Buddies</group></item></query></iq>">>
13:46:03.477 [debug] Send XML on stream = <<"<presence from='HANDLE@jabb3r.org' to='admin@vsydorov.me/12836165211442403246588688' type='error'><error code='503' type='cancel'><service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></presence>">>
13:46:03.512 [debug] Received XML on stream = <<"<iq type='result' id='push4236684536'/>">>
13:46:03.513 [debug] route
from {jid,<<"admin">>,<<"vsydorov.me">>,<<"12836165211442403246588688">>,<<"admin">>,<<"vsydorov.me">>,<<"12836165211442403246588688">>}
to {jid,<<"admin">>,<<"vsydorov.me">>,<<>>,<<"admin">>,<<"vsydorov.me">>,<<>>}
packet {xmlel,<<"iq">>,[{<<"type">>,<<"result">>},{<<"id">>,<<"push4236684536">>}],[]}
13:46:03.513 [debug] local route
from {jid,<<"admin">>,<<"vsydorov.me">>,<<"12836165211442403246588688">>,<<"admin">>,<<"vsydorov.me">>,<<"12836165211442403246588688">>}
to {jid,<<"admin">>,<<"vsydorov.me">>,<<>>,<<"admin">>,<<"vsydorov.me">>,<<>>}
packet {xmlel,<<"iq">>,[{<<"type">>,<<"resu"...>>},{<<"id">>,<<...>>}],[]}
13:46:03.513 [debug] session manager
from {jid,<<"admin">>,<<"vsydorov.me">>,<<"12836165211442403246588688">>,<<"admin">>,<<"vsydorov.me">>,<<"12836165211442403246588688">>}
to {jid,<<"admin">>,<<"vsydorov.me">>,<<>>,<<"admin">>,<<"vsydorov.me">>,<<>>}
packet {xmlel,<<"iq">>,[{<<"type">>,<<"resu"...>>},{<<"id">>,<<...>>}],[]}
At first I though my DNS table was wrong, but I check and rechecked it again and againt - it's correct.
_xmpp-client._tcp.vsydorov.me. 1800 IN SRV 5 0 5222 vsydorov.me.
_xmpp-server._tcp.vsydorov.me. 1800 IN SRV 5 0 5269 vsydorov.me.
_jabber._tcp.vsydorov.me. 1800 IN SRV 5 0 5269 vsydorov.me.
Here is the .yml configuration of the ejabberd server:
loglevel: 5
log_rotate_size: 10485760
log_rotate_date: ""
log_rotate_count: 1
log_rate_limit: 100
hosts:
route_subdomains: s2s
listen:
-
port: 5222
module: ejabberd_c2s
certfile: "/usr/local/etc/ejabberd/ejabberd.pem"
starttls: true
max_stanza_size: 65536
shaper: c2s_shaper
access: c2s
-
port: 5269
module: ejabberd_s2s_in
-
port: 8888
module: ejabberd_service
access: all
shaper_rule: fast
ip: "127.0.0.1"
hosts:
"icq.example.org":
password: "secret"
"sms.example.org":
password: "secret"
-
port: 3478
transport: udp
module: ejabberd_stun
-
port: 4560
module: ejabberd_xmlrpc
-
port: 5280
module: ejabberd_http
request_handlers:
"/websocket": ejabberd_http_ws
web_admin: true
http_bind: true
captcha: true
s2s_use_starttls: optional
s2s_certfile: "/usr/local/etc/ejabberd/ejabberd.pem"
host_config:
"vsydorov.me":
domain_certfile: "/usr/local/etc/ejabberd/ejabberd.pem"
s2s_access: s2s
outgoing_s2s_families:
- ipv4
- ipv6
outgoing_s2s_timeout: 10000
auth_method: internal
auth_password_format: scram
shaper:
normal: 1000
fast: 50000
max_fsm_queue: 1000
acl:
admin:
user:
- "admin": "vsydorov.me"
local:
user_regexp: ""
loopback:
ip:
- "127.0.0.0/8"
access:
max_user_sessions:
all: 10
max_user_offline_messages:
admin: 5000
all: 100
local:
local: allow
c2s:
blocked: deny
all: allow
c2s_shaper:
admin: none
all: normal
s2s_shaper:
all: fast
announce:
admin: allow
configure:
admin: allow
muc_admin:
admin: allow
muc_create:
local: allow
muc:
all: allow
pubsub_createnode:
local: allow
register:
all: allow
trusted_network:
loopback: allow
language: "en"
modules:
mod_adhoc: {}
mod_announce: # recommends mod_adhoc
access: announce
mod_blocking: {} # requires mod_privacy
mod_caps: {}
mod_carboncopy: {}
mod_client_state:
drop_chat_states: true
queue_presence: false
mod_configure: {} # requires mod_adhoc
mod_disco: {}
mod_irc: {}
mod_http_bind: {}
mod_last: {}
mod_muc:
access: muc
access_create: muc_create
access_persistent: muc_create
access_admin: muc_admin
mod_offline:
access_max_user_messages: max_user_offline_messages
mod_ping: {}
mod_privacy: {}
mod_private: {}
mod_pubsub:
access_createnode: pubsub_createnode
ignore_pep_from_offline: true
last_item_cache: false
plugins:
- "flat"
- "hometree"
- "pep" # pep requires mod_caps
mod_register:
welcome_message:
subject: "Welcome!"
body: |-
Hi.
Welcome to Vlad's XMPP server.
ip_access: trusted_network
access: register
mod_roster: {}
mod_shared_roster: {}
mod_stats: {}
mod_time: {}
mod_vcard: {}
mod_version: {}
I fixed it. I had to
I fixed it. I had to uncomment for lines in the configuration
access:
s2s:
bad_servers: deny
all: allow