Bug 1163812
Summary: | Cannot control ejabberd with ejabberdctl | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Juan Orti <jorti> | ||||
Component: | ejabberd | Assignee: | Randy Barlow <randy> | ||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 25 | CC: | cds, chrissharp09, cjs, erlang, frh+fedora, jerry, jkaluza, lemenkov, martin, pwouters, randy, russ+bugzilla-redhat, samuel-rhbugs, stephdl | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | ejabberd-16.09-4.fc26 ejabberd-16.09-4.fc25 | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2016-12-11 00:28:55 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Juan Orti
2014-11-13 14:09:23 UTC
In my case, it's doing *anything* with ejabberdctl - not just registering. My steps on a clean installation of Fedora 21: 1. yum install ejabberd 2. systemctl start ejabberd.service 3. ejabberdctl status [root@localhost ~]# ejabberdctl status Failed RPC connection to the node ejabberd@localhost: nodedown Commands to start an ejabberd node: start Start an ejabberd node in server mode debug Attach an interactive Erlang shell to a running ejabberd node live Start an ejabberd node in live (interactive) mode Optional parameters when starting an ejabberd node: --config-dir dir Config ejabberd: /etc/ejabberd --config file Config ejabberd: /etc/ejabberd/ejabberd.yml --ctl-config file Config ejabberdctl: /etc/ejabberd/ejabberdctl.cfg --logs dir Directory for logs: /var/log/ejabberd --spool dir Database spool dir: /var/lib/ejabberd --node nodename ejabberd node name: ejabberd@localhost /var/log/ejabberd/error.log: 2015-03-07 09:18:31.948 [error] <0.562.0> ** Connection attempt from disallowed node 'ejabberdctl-1@localhost' ** There are hints from possibly related issues from ejabberd support that point to .erlang.cookie mismatches - that's the current rabbit I'm chasing down the hole... Not a fix, but temporary workaround is to 'stop' ejabberd via systemctl and start ejabberd via ejabberdctl. e.g., $ sudo systemctl stop ejabberd $ sudo ejabberdctl start ejabberd $ sudo ejabberdctl register user host pass This bug is also present in Fedora 22. Any progress? upgrading f19 to f22 also caused my jabber server to reject everything ejabberd-14.07-6.fc22.x86_64 my problem was that I ended up with /etc/ejabberd/ejabberd.cfg.rpmnew and /etc/ejabberd/ejabberd.cfg.rpmsave without leaving any /etc/ejabberd/ejabberd.cfg I copied my rpmsave back and then ejabberd started working again. Created attachment 1025103 [details]
ejabberd-ejabberdctl-fix.patch
The problem with ejabberdctl being denied connection seems to be related to the .erlang.cookie file. I made a small change to ejabberdctl that fixed this. See the attached file.
comment 2 didn't work for me comment 5 doesn't even make sense, since the new config format is the yml format editing ejabberdctl as suggested in comment6 worked for me. I did however lose my user database after upgrading and had to re-create all users. it seems my #5 comment was pidgin oddly and false claiming i had logged in. Indeed it never worked. I spend too much time in trying to get the new config file to work. It would never fully start allowing client login. I even ended up installing a fresh new fedora19 server to load the /etc/ejabberd and /var/lib/ejabberd data onto, but that failed as well some error about Error reading Mnesia database so my ejabberd data is no good on old or new versions. I finally gave up and declared a loss of my buddy list and went with the recommend jabber server prosody. Too bad the prosody migration scripts needed a dump made by ejabberctl that it is not able to do on the f22 or the f19 server :P I just upgraded from FC20 (ejabberd-2.1.13-7.fc20.x86_64) to FC22 (ejabberd-14.07-6.fc22.x86_64), which broke ejabberd in the following ways: 1. The configuration file wasn't converted, only saved as /etc/ejabberd/ejabberd.cfg.rpmsave. Possibly connected to #2, since "ejabberdctl convert_to_yaml" is used for converting. 2. .erlang.cookie mismatch. Solved this one by copying /var/lib/ejabberd/.erlang.cookie to my home directory. Converted configuration file as in #1. 3. All users gone. Copied /var/lib/ejabberd/spool to the same directory on another FC20 host, mucked about with hostnames, dumped the data with "ejabberdctl dump", copied it back to the FC22 host, loaded it with "ejabberdctl load" and restarted the service. Using "ejabberdctl backup" and "ejabberdctl restore" didn't work, since the database schema is different. This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle. Changing version to '25'. I submitted a patch that was inspired by Frederik Holden's patch upstream: https://github.com/processone/ejabberd/pull/1395 That patch seems to work on my ejabberd box, so I think I will apply it as is for now while we wait on upstream to decide how they want to proceed with my proposal. A workaround that I've been using is to use sudo to execute ejabberdctl as the ejabberd user. For example: $ sudo -u ejabberd /usr/bin/sh /usr/bin/ejabberdctl <args> It's not pretty, but it does work! ejabberd-16.09-3.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-69b7266f39 ejabberd-16.09-3.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-69b7266f39 I learned that the erlang cookie is a bit like a password (I had thought it was just the id of the node the user wants to connect to). Thus it should not be passed with -set-cookie because we don't want it to appear in the process table. Thus I will have to solve this another way. ejabberd-16.09-4.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-89b50bf88a I fixed this by setting the INSTALLUSER variable in ejabberdctl and patching it to use bash when executing erl with su. ejabberd-16.09-4.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-89b50bf88a ejabberd-16.09-4.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report. I hit this big on centos7 and ejabberd-18.06, I solved it in my case by this systemd script : # /usr/lib/systemd/system/ejabberd.service [unit] Description=XMPP Server After=network.target [Service] Type=forking User=ejabberd Group=ejabberd LimitNOFILE=65536 Restart=on-failure RestartSec=5 Environment=LOGS_DIR=/var/log/ejabberd Environment=EJABBERD_CONFIG_PATH=/etc/ejabberd/ejabberd.yml Environment=SPOOL_DIR=/var/lib/ejabberd ExecStart=/bin/sh -c '/opt/ejabberd-18.06/bin/ejabberdctl start && /opt/ejabberd-18.06/bin/ejabberdctl started' ExecStop=/bin/sh -c '/opt/ejabberd-18.06/bin/ejabberdctl stop && /opt/ejabberd-18.06/bin/ejabberdctl stopped' ExecReload=/bin/sh -c '/opt/ejabberd-18.06/bin/ejabberdctl reload_config' PrivateDevices=true [Install] WantedBy=multi-user.target I can control now ejabberd by systemd and ejabberdctl |