https://bugzilla.redhat.com/show_bug.cgi?id=1163812
Bug ID: 1163812 Summary: Cannot control ejabberd with ejabberdctl Product: Fedora Version: 21 Component: ejabberd Assignee: lemenkov@gmail.com Reporter: juan.orti@miceliux.com QA Contact: extras-qa@fedoraproject.org CC: erlang@lists.fedoraproject.org, jkaluza@redhat.com, lemenkov@gmail.com, martin@laptop.org
Description of problem: After a clean install of ejabberd in Fedora 21, I cannot use the ejabberdctl utility to register users, etc.
I run: # ejabberdctl register admin localhost password 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
And I see this in the log /var/log/ejabberd/ejabberd.log:
2014-11-13 14:57:30.188 [info] <0.7.0> Application lager started on node ejabberd@localhost 2014-11-13 14:57:30.257 [info] <0.7.0> Application sasl started on node ejabberd@localhost 2014-11-13 14:57:30.286 [info] <0.7.0> Application crypto started on node ejabberd@localhost 2014-11-13 14:57:30.354 [info] <0.7.0> Application asn1 started on node ejabberd@localhost 2014-11-13 14:57:30.354 [info] <0.7.0> Application public_key started on node ejabberd@localhost 2014-11-13 14:57:30.421 [info] <0.7.0> Application ssl started on node ejabberd@localhost 2014-11-13 14:57:30.450 [info] <0.7.0> Application p1_yaml started on node ejabberd@localhost 2014-11-13 14:57:30.482 [info] <0.7.0> Application p1_tls started on node ejabberd@localhost 2014-11-13 14:57:30.492 [info] <0.7.0> Application p1_xml started on node ejabberd@localhost 2014-11-13 14:57:30.498 [info] <0.7.0> Application p1_stringprep started on node ejabberd@localhost 2014-11-13 14:57:30.508 [info] <0.7.0> Application p1_zlib started on node ejabberd@localhost 2014-11-13 14:57:30.515 [info] <0.7.0> Application p1_cache_tab started on node ejabberd@localhost 2014-11-13 14:57:31.015 [info] <0.7.0> Application mnesia started on node ejabberd@localhost 2014-11-13 14:57:33.259 [info] <0.37.0>@cyrsasl_digest:start:57 FQDN used to check DIGEST-MD5 SASL authentication: charm.miceliux.com 2014-11-13 14:57:33.423 [info] <0.7.0> Application p1_iconv started on node ejabberd@localhost 2014-11-13 14:57:42.556 [info] <0.564.0>@ejabberd_listener:listen_tcp:194 Reusing listening port for 5222 2014-11-13 14:57:42.556 [info] <0.565.0>@ejabberd_listener:listen_tcp:194 Reusing listening port for 5269 2014-11-13 14:57:42.557 [info] <0.566.0>@ejabberd_listener:listen_tcp:194 Reusing listening port for 5280 2014-11-13 14:57:42.557 [info] <0.37.0>@ejabberd_app:start:69 ejabberd community is started in the node ejabberd@localhost 2014-11-13 14:57:42.557 [info] <0.7.0> Application ejabberd started on node ejabberd@localhost 2014-11-13 14:59:18.926 [error] <0.567.0> ** Connection attempt from disallowed node 'ejabberdctl-1@charm' **
Version-Release number of selected component (if applicable): ejabberd-14.07-3.fc21.x86_64
How reproducible: Always
Steps to Reproduce: 1. yum install ejabberd 2. systemctl start ejabberd 3. ejabberdctl register admin localhost password
Actual results: Cannot register a user.
Expected results: Register a user.
Additional info:
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
--- Comment #1 from Chris Sharp chrissharp09@comcast.net --- 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...
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
--- Comment #2 from cds@goofyfootlabs.com --- 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
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
Michael Tremer michael.tremer@ipfire.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC|michael.tremer@ipfire.org |
Juan Orti juan.orti@miceliux.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|21 |22
--- Comment #3 from Juan Orti juan.orti@miceliux.com --- This bug is also present in Fedora 22. Any progress?
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
Paul Wouters pwouters@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |pwouters@redhat.com
--- Comment #4 from Paul Wouters pwouters@redhat.com --- upgrading f19 to f22 also caused my jabber server to reject everything
ejabberd-14.07-6.fc22.x86_64
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
--- Comment #5 from Paul Wouters pwouters@redhat.com --- 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.
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
--- Comment #6 from Frederik Holden frederik+fedora@frh.no --- Created attachment 1025103 --> https://bugzilla.redhat.com/attachment.cgi?id=1025103&action=edit 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.
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
--- Comment #7 from Jerry C jerry@jtcloe.net --- 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.
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
--- Comment #8 from Paul Wouters pwouters@redhat.com --- 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
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
--- Comment #9 from Carl-Johan Schenström cjs@bluebox.pp.se --- 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.
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
Peter Lemenkov lemenkov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |FutureFeature Version|22 |rawhide
Red Hat Bugzilla bugzilla@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Doc Type|Bug Fix |Enhancement
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
Peter Lemenkov lemenkov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|FutureFeature |
Red Hat Bugzilla bugzilla@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Doc Type|Enhancement |Bug Fix
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
Randy Barlow randy@electronsweatshop.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|lemenkov@gmail.com |randy@electronsweatshop.com
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
--- Comment #11 from Randy Barlow randy@electronsweatshop.com --- 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.
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
--- Comment #12 from Randy Barlow randy@electronsweatshop.com --- 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!
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
--- Comment #13 from Fedora Update System updates@fedoraproject.org --- ejabberd-16.09-3.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-69b7266f39
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
Fedora Update System updates@fedoraproject.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |MODIFIED
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
Randy Barlow randy@electronsweatshop.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed In Version| |ejabberd-16.09-3.fc26
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
Fedora Update System updates@fedoraproject.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|MODIFIED |ON_QA
--- Comment #14 from Fedora Update System updates@fedoraproject.org --- 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
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
Randy Barlow randy@electronsweatshop.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|ON_QA |ASSIGNED
--- Comment #15 from Randy Barlow randy@electronsweatshop.com --- 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.
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
--- Comment #16 from Fedora Update System updates@fedoraproject.org --- ejabberd-16.09-4.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-89b50bf88a
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
Fedora Update System updates@fedoraproject.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |MODIFIED
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
Randy Barlow randy@electronsweatshop.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed In Version|ejabberd-16.09-3.fc26 |ejabberd-16.09-4.fc26
--- Comment #17 from Randy Barlow randy@electronsweatshop.com --- I fixed this by setting the INSTALLUSER variable in ejabberdctl and patching it to use bash when executing erl with su.
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
Fedora Update System updates@fedoraproject.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|MODIFIED |ON_QA
--- Comment #18 from Fedora Update System updates@fedoraproject.org --- 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
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
Fedora Update System updates@fedoraproject.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|ON_QA |CLOSED Fixed In Version|ejabberd-16.09-4.fc26 |ejabberd-16.09-4.fc26 | |ejabberd-16.09-4.fc25 Resolution|--- |ERRATA Last Closed| |2016-12-10 19:28:55
--- Comment #19 from Fedora Update System updates@fedoraproject.org --- 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.
https://bugzilla.redhat.com/show_bug.cgi?id=1163812
stephane de Labrusse stephdl@de-labrusse.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |stephdl@de-labrusse.fr
--- Comment #20 from stephane de Labrusse stephdl@de-labrusse.fr --- 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
erlang@lists.fedoraproject.org