Bug 1431368 - noip client fails unless (re)started manually
Summary: noip client fails unless (re)started manually
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: noip
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Sergio Basto
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-11 16:46 UTC by Mark Knoop
Modified: 2017-05-13 02:26 UTC (History)
3 users (show)

Fixed In Version: noip-2.1.9-22.fc26 noip-2.1.9-22.fc25 noip-2.1.9-22.fc24 noip-2.1.9-22.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-02 15:56:33 UTC
Type: Bug


Attachments (Terms of Use)
/var/log/boot.log (9.57 KB, text/plain)
2017-04-05 16:11 UTC, Veteran
no flags Details

Description Mark Knoop 2017-03-11 16:46:23 UTC
Description of problem:

The noip client fails to ascertain the host IP address when started on boot. It continues to try every 30 minutes but always fails. Only when restarted manually does it succeed.

Version-Release number of selected component (if applicable):
noip-2.1.9-20.fc25.x86_64

How reproducible:
100%

Steps to Reproduce:
1. dnf install noip
2. noip2 -C (configure appropriately)
3. systemctl enable noip
4. reboot
5. systemctl status noip.service

Actual results:

# systemctl status noip.service 
● noip.service - No-IP Dynamic DNS Update Client
   Loaded: loaded (/usr/lib/systemd/system/noip.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2017-03-11 15:58:14 GMT; 38min ago
  Process: 781 ExecStart=/usr/sbin/noip2 -c /etc/no-ip2.conf (code=exited, status=0/SUCCESS)
 Main PID: 784 (noip2)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/noip.service
           └─784 /usr/sbin/noip2 -c /etc/no-ip2.conf

Mar 11 15:58:14 host.localhost systemd[1]: Starting No-IP Dynamic DNS Update Client...
Mar 11 15:58:14 host.localhost noip2[784]: v2.1.9 daemon started with NAT enabled
Mar 11 15:58:14 host.localhost noip2[784]: Can't gethostbyname for dynupdate.no-ip.com
Mar 11 15:58:14 host.localhost noip2[784]: Can't get our visible IP address from ip1.dynupdate.no-ip.com
Mar 11 15:58:14 host.localhost systemd[1]: Started No-IP Dynamic DNS Update Client.
Mar 11 16:28:21 host.localhost noip2[784]: Can't gethostbyname for dynupdate.no-ip.com
Mar 11 16:28:21 host.localhost noip2[784]: Can't get our visible IP address from ip1.dynupdate.no-ip.com

Expected results:

The noip client should be able to get the host IP address. However something is blocking access to gethostbyname so it cannot contact dynupdate.no-ip.com. When restarted manually, see below, it is successful.

Additional info:

# systemctl restart noip.service
# systemctl status noip.service 
● noip.service - No-IP Dynamic DNS Update Client
   Loaded: loaded (/usr/lib/systemd/system/noip.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2017-03-11 16:37:29 GMT; 1s ago
  Process: 10337 ExecStart=/usr/sbin/noip2 -c /etc/no-ip2.conf (code=exited, status=0/SUCCESS)
 Main PID: 10338 (noip2)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/noip.service
           └─10338 /usr/sbin/noip2 -c /etc/no-ip2.conf

Mar 11 16:37:29 host.localhost systemd[1]: Starting No-IP Dynamic DNS Update Client...
Mar 11 16:37:29 host.localhost systemd[1]: Started No-IP Dynamic DNS Update Client.
Mar 11 16:37:29 host.localhost noip2[10338]: v2.1.9 daemon started with NAT enabled
Mar 11 16:37:30 host.localhost noip2[10338]: XXXXXXXXX.no-ip.XXX set to XXX.XXX.XXX.XXX

Comment 1 Mark Knoop 2017-03-11 17:01:01 UTC
See here for the same symptoms:

https://archlinuxarm.org/forum/viewtopic.php?f=31&t=8951

Comment 2 Sergio Basto 2017-03-12 02:11:45 UTC
Hi, 
It works for me.  
I think after NetworkManager start in boot, you still not have network therefore you may try edit connections of NetworkManager and check "all users may connect to this network" in general tab, specially if you connect via wifi with password. 
Also we can add in /etc/NetworkManager/dispatcher.d one networkmanager dispatcher after network up it will call the script to restart noip 

cat 40-noip 
#!/bin/sh

case "$2" in
        up|down|vpn-up|vpn-down)
                /bin/systemctl --no-block try-restart noip.service || :
                ;;
esac

copied from 10-sendmail

Comment 3 Mark Knoop 2017-03-12 13:54:26 UTC
Hi, thanks. It's a wired ethernet connection, "Make available to other users" is already checked.

I'll try this dispatcher.d script and report back. Although I can understand that the network might be not fully up for the first try, I don't understand why the noip client still can't connect 30 minutes later unless restarted.

Comment 4 Mark Knoop 2017-03-12 15:31:12 UTC
Yes, the dispatcher script works, I removed the "down" cases though.

cat 40-noip
#!/bin/sh

case "$2" in
        up|vpn-up)
                /bin/systemctl --no-block try-restart noip.service || :
                ;;
esac

But this does seem quite "wasteful": noip is now started and stopped 4 times in the boot process. Is there no way in all of systemd's features to wait for available hostname resolution?

Comment 5 Sergio Basto 2017-03-14 00:56:24 UTC
It works for me without dispatcher, can you post "cat boot.log | grep ... [1] ? 
See mine, noip just start after "Network Name Resolution", so at time of starting no-ip , we should already have network. 



[1] 

cat /var/log/boot.log  | grep -iP "no-ip|net"
[  OK  ] Reached target Network (Pre).
         Starting Network Manager...
[  OK  ] Started Network Manager.
[  OK  ] Reached target Network.
         Starting Network Name Resolution...
         Starting Network Manager Script Dispatcher Service...
[  OK  ] Started Network Name Resolution.
         Starting No-IP Dynamic DNS Update Client...
[  OK  ] Started Network Manager Script Dispatcher Service.
[  OK  ] Started No-IP Dynamic DNS Update Client.

Comment 6 Mark Knoop 2017-03-14 09:17:00 UTC
No info in my boot.log, but this excerpt from the journal shows that it is starting after "Network Name Resolution", but is still unable to gethostbyname.

Mar 12 15:00:33 localhost systemd[1]: Started Network Name Resolution.
Mar 12 15:00:33 localhost systemd[1]: Starting No-IP Dynamic DNS Update Client...
Mar 12 15:00:33 localhost noip2[793]: v2.1.9 daemon started with NAT enabled
Mar 12 15:00:33 localhost noip2[793]: Can't gethostbyname for dynupdate.no-ip.com
Mar 12 15:00:33 localhost systemd[1]: Started No-IP Dynamic DNS Update Client.
Mar 12 15:00:33 localhost noip2[793]: Can't get our visible IP address from ip1.dynupdate.no-ip.com

Comment 7 Sergio Basto 2017-03-14 09:58:44 UTC
(In reply to Mark Knoop from comment #6)
> No info in my boot.log

could you send all boot.log instead , very weird , but doesn't seems to me a noip problem .
Have you selinux enabled , if yes disable and try again , send me boot.log with or without grep , please .

Comment 8 Mark Knoop 2017-03-14 10:21:05 UTC
Selinux in permissive mode makes no difference. boot.log is empty - is it not deprecated in favour of journalctl now? I do not have rsyslog installed.

Comment 9 Sergio Basto 2017-03-16 22:10:14 UTC
> boot.log is empty - is it not deprecated in favour of journalctl now? 

no , you should have /var/log/boot.log ... I have and the computers that I had check have . I use:

syslog-ng-3.6.2-5.fc24.x86_64
syslog-ng-geoip-3.6.2-5.fc24.x86_64
syslog-ng-json-3.6.2-5.fc24.x86_64
syslog-ng-libdbi-3.6.2-5.fc24.x86_64
syslog-ng-redis-3.6.2-5.fc24.x86_64
syslog-ng-smtp-3.6.2-5.fc24.x86_64

Comment 10 Veteran 2017-04-05 00:24:14 UTC
I have also had the same problem, exact same indications. Someone on Archlinux list thought it was maybe a firewall rule so I tried his solution and added an outgoing direct rule:

# firewall-cmd --direct --get-all-rules
ipv4 filter OUTPUT 0 -o enp2s8 -p tcp --dport 8245 -j ACCEPT

but that has not made a difference.

I also tried a 5 second sleep in the startup but that also makes no difference.

Comment 11 Sergio Basto 2017-04-05 10:05:26 UTC
may you attach the /var/log/boot.log ?

Comment 12 Veteran 2017-04-05 16:11:55 UTC
Created attachment 1269027 [details]
/var/log/boot.log

Added /var/log/boot.log (md5: a046fd4852ede1693c50f55cf842feb7) per Sergio Monteiro Basto's request. I have removed the ANSI codes.

Comment 13 Veteran 2017-04-05 16:12:31 UTC
(In reply to Sergio Monteiro Basto from comment #11)
> may you attach the /var/log/boot.log ?

Done, Sergio

Comment 14 Veteran 2017-04-05 16:35:29 UTC
I added the following to the [UNIT} section and now it works at boot:

[UNIT]
...<stuff>
BindsTo=NetworkManager.service
After=NetworkManager.service

Comment 15 Veteran 2017-04-05 16:46:21 UTC
Here is a diff
$ diff /usr/lib/systemd/system/noip.service noip.service.orig 
4,5c4
< BindsTo=NetworkManager.service
< After=network.target systemd-resolved.service NetworkManager.service
---
> After=network.target systemd-resolved.service

Comment 16 Sergio Basto 2017-04-06 10:04:56 UTC
(In reply to Veteran from comment #15)
> Here is a diff
> $ diff /usr/lib/systemd/system/noip.service noip.service.orig 
> 4,5c4
> < BindsTo=NetworkManager.service
> < After=network.target systemd-resolved.service NetworkManager.service
> ---
> > After=network.target systemd-resolved.service

Hello , to show this correctly is:  
 
   diff noip.service.orig /usr/lib/systemd/system/noip.service -up 

(first .orig file and with -up switches ) 

I thinking systemd-resolved.service may confuse this service because you don't haveit enabled and if you try just with After=network.target ?  

- After=network.target systemd-resolved.service
+ After=network.target

Comment 17 Veteran 2017-04-06 20:14:15 UTC
$ diff noip.service.orig /usr/lib/systemd/system/noip.service -up
--- noip.service.orig	2017-04-05 12:43:59.016024216 -0400
+++ /usr/lib/systemd/system/noip.service	2017-04-05 12:44:19.913146203 -0400
@@ -1,7 +1,8 @@
 [Unit]
 Description=No-IP Dynamic DNS Update Client
 Requires=systemd-resolved.service
-After=network.target systemd-resolved.service
+BindsTo=NetworkManager.service
+After=network.target systemd-resolved.service NetworkManager.service
 
 [Service]
 Type=forking

Comment 18 Veteran 2017-04-06 20:17:47 UTC
Sergio, I don't understand your comment. What don't I have enabled?

$ systemctl status noip
● noip.service - No-IP Dynamic DNS Update Client
   Loaded: loaded (/usr/lib/systemd/system/noip.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2017-04-05 12:47:59 EDT; 1 day 3h ago
 Main PID: 1191 (noip2)
   CGroup: /system.slice/noip.service
           └─1191 /usr/sbin/noip2 -c /etc/no-ip2.conf

Apr 05 12:47:59 backrow systemd[1]: Starting No-IP Dynamic DNS Update Client...
Apr 05 12:47:59 backrow systemd[1]: Started No-IP Dynamic DNS Update Client.
Apr 05 12:47:59 backrow noip2[1191]: v2.1.9 daemon started with NAT enabled
Apr 05 12:48:00 backrow noip2[1191]: xxxxxxx.ddns.net was already set to 68.228.xxx.xx.

Comment 19 Veteran 2017-04-06 20:33:11 UTC
# systemctl status systemd-resolved.service
● systemd-resolved.service - Network Name Resolution
   Loaded: loaded (/usr/lib/systemd/system/systemd-resolved.service; disabled; vendor preset: disabled)
   Active: active (running) since Wed 2017-04-05 12:47:59 EDT; 1 day 3h ago
     Docs: man:systemd-resolved.service(8)
           http://www.freedesktop.org/wiki/Software/systemd/resolved
           http://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
           http://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
 Main PID: 1174 (systemd-resolve)
   Status: "Processing requests..."
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/systemd-resolved.service
           └─1174 /usr/lib/systemd/systemd-resolved

Apr 05 12:47:59 backrow systemd[1]: Starting Network Name Resolution...
Apr 05 12:47:59 backrow systemd-resolved[1174]: Positive Trust Anchors:
Apr 05 12:47:59 backrow systemd-resolved[1174]: . IN DS 19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5
Apr 05 12:47:59 backrow systemd-resolved[1174]: Negative trust anchors: [...stuff...]
Apr 05 12:47:59 backrow systemd-resolved[1174]: Switching to system DNS server 8.8.8.8.
Apr 05 12:47:59 backrow systemd[1]: Started Network Name Resolution.

Comment 20 Sergio Basto 2017-04-06 22:44:18 UTC
Veteran, I meant the attach file /var/log/boot.log don't have reference to  "Starting Network Name Resolution" [1] like I see in my /var/log/boot.log 

[1]
cat /var/log/boot.log | grep -iP "no-ip|net|Reso"

but systemd-resolved.service is not enabled at startup (vendor preset: disabled) but somehow now it started in yours computer I guess. In my case, the same, not marked as enabled but appears in boot log ... 
Anyway could be enough start noip after Reached target Network. 
I don't want add more rules to noip.service, from man systemd.unit, BindsTo= doesn't seems a good option. 

Thanks for yours reports, ah and thanks for explicitly give the feed back that you haven't understand what I wrote, let me know if happens again.
Best regards

Comment 21 David 2017-04-08 12:32:02 UTC
I have the same issue and found this report while searching for solutions.  I tried modifying /usr/lib/systemd/system/noip.service as mentioned by Veteran and still have same result. Adding /etc/NetworkManager/dispatcher.d does work. Thanks Sergio for that suggestion.

Comment 22 Sergio Basto 2017-04-09 18:18:28 UTC
could you edit /usr/lib/systemd/system/noip.service 

and set after with just : 

After=network.target

run  systemctl daemon-reload and reboot

Comment 23 David 2017-04-09 22:47:32 UTC
Thanks for quick reply. I tried editing /usr/lib/systemd/system/noip.service as suggested. I actually tried that first. I did not do the "systemctl daemon-reload" after I made the change, so I removed the "40-noip" file from /etc/NetworkManager/dispatcher.d and tried that and rebooted. Still same result.

● noip.service - No-IP Dynamic DNS Update Client
   Loaded: loaded (/usr/lib/systemd/system/noip.service; enabled; vendor preset: disabled)
   Active: active (running) since Sun 2017-04-09 17:32:58 CDT; 3min 20s ago
  Process: 812 ExecStart=/usr/sbin/noip2 -c /etc/no-ip2.conf (code=exited, status=0/SUCCESS)
 Main PID: 821 (noip2)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/noip.service
           └─821 /usr/sbin/noip2 -c /etc/no-ip2.conf

Apr 09 17:32:57 server4.localdomain noip2[821]: v2.1.9 daemon started with NAT enabled
Apr 09 17:32:57 server4.localdomain systemd[1]: Starting No-IP Dynamic DNS Update Client...
Apr 09 17:32:57 server4.localdomain noip2[821]: Can't gethostbyname for dynupdate.no-ip.com
Apr 09 17:32:57 server4.localdomain noip2[821]: Can't get our visible IP address from ip1.dynupdate.no-ip.com
Apr 09 17:32:58 server4.localdomain systemd[1]: Started No-IP Dynamic DNS Update Client.

I do have another question.  Even though it appears to fail when the service starts, how can you tell that subsequent attempts are failing?  Whenever the status is returned using systemctl, the timestamp still shows the first failed attempt.

Comment 24 Sergio Basto 2017-04-10 09:51:33 UTC
David, many thanks for your test , unfortunately this service was forced to changed to systemd which doesn't work correctly !

Comment 25 Sergio Basto 2017-04-11 22:18:48 UTC
David and replace /usr/lib/systemd/system/noip.service  unit section with : 

[Unit]
Description=No-IP Dynamic DNS Update Client
PartOf=NetworkManager.service
After=network.target


the requires=systemd-resolved.service could be the problem ...

Comment 26 David 2017-04-12 03:01:29 UTC
Thanks Sergio. I removed the "requires=systemd-resolved.service" from /usr/lib/systemd/system/noip.service. 

$ cat /usr/lib/systemd/system/noip.service
[Unit]
Description=No-IP Dynamic DNS Update Client
After=network.target

[Service]
Type=forking
TimeoutStartSec=30
ExecStart=/usr/sbin/noip2 -c /etc/no-ip2.conf
Restart=on-failure
RestartSec=30

[Install]
WantedBy=multi-user.target


Still getting same result.

● noip.service - No-IP Dynamic DNS Update Client
   Loaded: loaded (/usr/lib/systemd/system/noip.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2017-04-11 21:30:06 CDT; 11min ago
  Process: 808 ExecStart=/usr/sbin/noip2 -c /etc/no-ip2.conf (code=exited, status=0/SUCCESS)
 Main PID: 812 (noip2)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/noip.service
           └─812 /usr/sbin/noip2 -c /etc/no-ip2.conf

Apr 11 21:30:05 server4.localdomain systemd[1]: Starting No-IP Dynamic DNS Update Client...
Apr 11 21:30:06 server4.localdomain noip2[812]: v2.1.9 daemon started with NAT enabled
Apr 11 21:30:06 server4.localdomain noip2[812]: Can't gethostbyname for dynupdate.no-ip.com
Apr 11 21:30:06 server4.localdomain noip2[812]: Can't get our visible IP address from ip1.dynupdate.no-ip.com
Apr 11 21:30:06 server4.localdomain systemd[1]: Started No-IP Dynamic DNS Update Client.

Comment 27 Sergio Basto 2017-04-23 00:01:06 UTC
David and others could you test if /usr/lib/systemd/system/noip.service with [1]  , works for you ? probably I'm fix the package with it but if you caould test it before will be nice ? 

to test :
edit /usr/lib/systemd/system/noip.service 
systemctl daemon-reload
reboot 


Thanks, 

[1] 
[Unit]
Description=No-IP Dynamic DNS Update Client
Wants=network-online.target
After=network-online.target

Comment 28 David 2017-04-23 01:21:21 UTC
Thanks much Sergio, I added the [1] at the very beginning and that seemed to resolve the issue. Just to be clear, I did not make any other changes so mine does not match the sample you sent exactly.

[1]
[Unit]
Description=No-IP Dynamic DNS Update Client
After=network.target

In any case, this seemed to resolve the issue, for me at least.

Thanks again.

Dave

Comment 29 Mark Knoop 2017-04-23 10:21:30 UTC
Thanks Sergio,

Yes, this works now, without the NetworkManager dispatcher script. network-online is clearly the appropriate target. Although https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ (last section) suggests that the client should really be able to handle this better.

My complete unit file for clarity:

# cat /usr/lib/systemd/system/noip.service
[Unit]
Description=No-IP Dynamic DNS Update Client
Wants=network-online.target
After=network-online.target

[Service]
Type=forking
TimeoutStartSec=30
ExecStart=/usr/sbin/noip2 -c /etc/no-ip2.conf
Restart=on-failure
RestartSec=30

[Install]
WantedBy=multi-user.target

Comment 30 Fedora Update System 2017-04-23 11:18:46 UTC
noip-2.1.9-22.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-edfadd40b4

Comment 31 Fedora Update System 2017-04-23 11:19:12 UTC
noip-2.1.9-22.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-8442b739dd

Comment 32 Fedora Update System 2017-04-23 11:19:40 UTC
noip-2.1.9-22.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-f2ffbabc49

Comment 33 Fedora Update System 2017-04-23 11:20:12 UTC
noip-2.1.9-22.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-947d317c65

Comment 34 Fedora Update System 2017-04-25 03:53:04 UTC
noip-2.1.9-22.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-2017-8442b739dd

Comment 35 Fedora Update System 2017-04-25 19:25:10 UTC
noip-2.1.9-22.fc24 has been pushed to the Fedora 24 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-2017-f2ffbabc49

Comment 36 Fedora Update System 2017-04-25 21:27:27 UTC
noip-2.1.9-22.fc26 has been pushed to the Fedora 26 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-2017-edfadd40b4

Comment 37 Fedora Update System 2017-04-25 23:18:04 UTC
noip-2.1.9-22.el7 has been pushed to the Fedora EPEL 7 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-EPEL-2017-947d317c65

Comment 38 Fedora Update System 2017-05-02 15:56:33 UTC
noip-2.1.9-22.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 39 Fedora Update System 2017-05-02 23:14:43 UTC
noip-2.1.9-22.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 40 Fedora Update System 2017-05-04 18:23:54 UTC
noip-2.1.9-22.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 41 Fedora Update System 2017-05-13 02:26:28 UTC
noip-2.1.9-22.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.


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