Bug 1256062 - Prosody service starts when network is not yet ready
Prosody service starts when network is not yet ready
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: prosody (Show other bugs)
22
x86_64 Linux
unspecified Severity high
: ---
: ---
Assigned To: Robert Scheck
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-23 13:35 EDT by Michael Wermeester
Modified: 2017-03-04 22:23 EST (History)
5 users (show)

See Also:
Fixed In Version: 0.9.8-5.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-31 23:36:02 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
prosody.service (290 bytes, text/plain)
2015-08-23 13:41 EDT, Michael Wermeester
no flags Details

  None (edit)
Description Michael Wermeester 2015-08-23 13:35:02 EDT
Description of problem:
When the Prosody service is set to autostart, the service starts before the network interfaces are up/ready. This results in outgoing Prosody network connections to fail. 

Version-Release number of selected component (if applicable):
Arch        : x86_64
Epoch       : 0
Version     : 0.9.8
Release     : 4.fc22

How reproducible:
Often or always. (Always in my case, tested on different servers and setups)

Steps to Reproduce:
- Install prosody (dnf install prosody)
- Add a virtual host in /etc/prosody/conf.d
- Set prosody to autostart: systemctl enable prosody
- reboot the system: shutdown -r now

Actual results:
Warning appearing in /var/log/prosody/prosody.log:

>> Aug 23 16:40:13 mod_s2s	warn	No local IPv4 or IPv6 addresses detected, outgoing connections may fail

Indeed, outgoing s2s connections are not working. 

Expected results:

Outgoing s2s connections should work as expected and the warning should not appear in the /var/log/prosody/prosody.log file. 

Additional info:

The problem does not occur when starting prosody manually via "systemctl start prosody.service" when the network interfaces are up. 

One possible way to fix this problem is to change "After=network.target" to "After=network-online.target" in the the file /usr/lib/systemd/system/prosody.service.

With this change, Prosody starts up fine (without the warning) and s2s connections work as expected.
Comment 1 Michael Wermeester 2015-08-23 13:41:29 EDT
Created attachment 1066066 [details]
prosody.service

Changed

After=network.target

to

After=network-online.target
Comment 2 Robert Scheck 2015-08-23 15:13:19 EDT
Thank you for your report and the analysis. I contacted upstream for an
opinion regarding this while I consider your suggestion as the way to go.
Comment 3 Matthew Wild (MattJ) 2015-08-28 09:07:47 EDT
Upstream here.

Haven't seen this before, though it makes sense that it would happen if Prosody is started before networking is up.

Based on this, there are a couple of changes we are considering:

  - Delaying this check until the first outgoing s2s connection is attempted

  - Re-scanning local interfaces on SIGHUP

However regardless of these potential changes, I don't think it makes any sense to start a network service daemon when there is no network available. As systemd supports this, I think it's entirely sensible to make the proposed change to prosody.service.
Comment 4 Fedora Update System 2015-08-28 09:30:59 EDT
prosody-0.9.8-5.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-14492
Comment 5 Fedora Update System 2015-08-28 09:31:54 EDT
prosody-0.9.8-5.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-14493
Comment 6 Fedora Update System 2015-08-28 09:32:53 EDT
prosody-0.9.8-5.fc21 has been submitted as an update to Fedora 21. https://bodhi.fedoraproject.org/updates/FEDORA-2015-14494
Comment 7 Fedora Update System 2015-08-28 09:35:42 EDT
prosody-0.9.8-5.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2015-7835
Comment 8 Fedora Update System 2015-08-28 14:53:00 EDT
prosody-0.9.8-5.fc21 has been pushed to the Fedora 21 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update prosody'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-14494
Comment 9 Fedora Update System 2015-08-28 14:57:26 EDT
prosody-0.9.8-5.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update prosody'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-14493
Comment 10 Fedora Update System 2015-08-30 13:47:44 EDT
prosody-0.9.8-5.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update prosody'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2015-7835
Comment 11 Fedora Update System 2015-08-31 14:52:20 EDT
prosody-0.9.8-5.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update prosody'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-14492
Comment 12 Fedora Update System 2015-08-31 23:36:01 EDT
prosody-0.9.8-5.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.
Comment 13 Fedora Update System 2015-09-06 00:49:50 EDT
prosody-0.9.8-5.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.
Comment 14 Fedora Update System 2015-09-06 02:20:22 EDT
prosody-0.9.8-5.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.
Comment 15 Fedora Update System 2015-09-19 13:23:15 EDT
prosody-0.9.8-5.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.
Comment 16 Sébastien Gendre 2017-02-25 10:48:28 EST
I have the same problem.
With After=network-online.target in usr/lib/systemd/system/prosody.service.
Comment 17 Robert Scheck 2017-02-25 11:22:18 EST
Sébastien, which version of Prosody do you use exactly? And what does
"rpm -q prosody" say?
Comment 18 Sébastien Gendre 2017-02-25 11:25:23 EST
$ rpm -q prosody
prosody-0.9.12-1.fc25.x86_64
Comment 19 Robert Scheck 2017-02-25 11:43:33 EST
"systemctl cat prosody.service" should contain "After=network-online.target",
which was the scope of this bug report.
Comment 20 Sébastien Gendre 2017-02-25 11:45:08 EST
$ systemctl cat prosody.service 
# /usr/lib/systemd/system/prosody.service
[Unit]
Description=Prosody XMPP (Jabber) server
After=network-online.target

[Service]
Type=forking
PIDFile=/run/prosody/prosody.pid
ExecStart=/usr/bin/prosodyctl start
ExecReload=/usr/bin/prosodyctl reload
ExecStop=/usr/bin/prosodyctl stop

[Install]
WantedBy=multi-user.target
Comment 21 Robert Scheck 2017-02-25 16:29:07 EST
So "After=network-online.target" exists, which is a point where the network
should be working. Can you describe your network setup? Currently, I am more
tempted to say that this is likely to be a network misconfiguration.
Comment 22 Sébastien Gendre 2017-02-26 14:29:53 EST
# cat /etc/sysconfig/network-scripts/ifcfg-enp2s0 
HWADDR=
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=enp2s0
UUID=
ONBOOT=yes
IPADDR=192.168.1.
PREFIX=24
GATEWAY=192.168.1.1
DNS1=192.168.1.1
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_PRIVACY=no
Comment 23 Sébastien Gendre 2017-03-04 22:23:02 EST
(In reply to Robert Scheck from comment #21)

Any idea?

Note You need to log in before you can comment on or make changes to this bug.