/services_dyndns_edit.php: phpDynDNS: (Unknown Response)
-
@plfinch
Thanks for the tip. I'll check the patch and apply. -
That patch is in the 'recommended patches' list in the new System Patches package so it's one click to apply it.
Steve
-
@stephenw10 I was very pleasantly surprised this morning when I updated package patches and saw the list of recommended patches with Redmine numbers listed. This is great!
Peter
-
@stephenw10
Hi, I have the same problem. The response from namecheap is not correctly parsed. I applied the patch for Redmine #12816 to pfSense 2.6.0-RELEASE, but the response is still not parsed. The cached IP still says 0.0.0.0. I have also rebooted the router. -
What is namecheap responding with?
Does it correctly update from a different dyndns client?
Steve
-
<?xml version="1.0" encoding="utf-16"?>
<interface-response>
<Command>SETDNSHOST</Command>
<Language>eng</Language>
<IP>xxx.yyy.zzz.aaa</IP> <---- the IP from my external gateway
<ErrCount>0</ErrCount>
<errors/>
<ResponseCount>0</ResponseCount>
<responses/>
<Done>true</Done>
<debug><![CDATA[]]></debug>
</interface-response>I'm only using namecheap for dynamic dns.
-
I removed the .cache file generated for namecheap, and now when I save the settings for its client, the .cache file contains "0.0.0.0|1661343037", and in the UI it's displayed "0.0.0.0".
I also added a freeDNS API Version 2 client, which corectly registers and caches the dynamic IP. -
Hmm, looks OK. Are you actually seeing the 'Unknown Response' error logged?
-
Yes, this is the log generated after I saved the settings for namecheap:
Aug 24 16:23:04 php-fpm 11484 /services_dyndns_edit.php: phpDynDNS (home): (Unknown Response) Aug 24 16:23:04 php-fpm 11484 /services_dyndns_edit.php: phpDynDNS (home): PAYLOAD: <?xml version="1.0" encoding="utf-16"?><interface-response><Command>SETDNSHOST</Command><Language>eng</Language><IP>xxx.yyy.zzz.aaa</IP><ErrCount>0</ErrCount><errors /><ResponseCount>0</ResponseCount><responses /><Done>true</Done><debug><![CDATA[]]></debug></interface-response> Aug 24 16:23:04 php-fpm 11484 /services_dyndns_edit.php: Dynamic DNS namecheap (home.XMX.net): _checkStatus() starting. Aug 24 16:23:04 php-fpm 11484 /services_dyndns_edit.php: Response Data: <?xml version="1.0" encoding="utf-16"?><interface-response><Command>SETDNSHOST</Command><Language>eng</Language><IP>xxx.yyy.zzz.aaa</IP><ErrCount>0</ErrCount><errors /><ResponseCount>0</ResponseCount><responses /><Done>true</Done><debug><![CDATA[]]></debug></interface-response> Aug 24 16:23:04 php-fpm 11484 /services_dyndns_edit.php: Response Header: Aug 24 16:23:04 php-fpm 11484 /services_dyndns_edit.php: Response Header: Aug 24 16:23:04 php-fpm 11484 /services_dyndns_edit.php: Response Header: alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400 Aug 24 16:23:04 php-fpm 11484 /services_dyndns_edit.php: Response Header: cf-ray: 73fc6680cbc5c1af-BUD Aug 24 16:23:04 php-fpm 11484 /services_dyndns_edit.php: Response Header: server: cloudflare Aug 24 16:23:04 php-fpm 11484 /services_dyndns_edit.php: Response Header: expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" Aug 24 16:23:04 php-fpm 11484 /services_dyndns_edit.php: Response Header: cf-cache-status: DYNAMIC Aug 24 16:23:04 php-fpm 11484 /services_dyndns_edit.php: Response Header: strict-transport-security: max-age=16000000; includeSubDomains Aug 24 16:23:04 php-fpm 11484 /services_dyndns_edit.php: Response Header: strict-transport-security: max-age=16000000; includeSubDomains Aug 24 16:23:04 php-fpm 11484 /services_dyndns_edit.php: Response Header: set-cookie: .s=3b275e1f0d8248488011fad0e6fa3ad4; domain=.www.namecheap.com; path=/; httponly Aug 24 16:23:04 php-fpm 11484 /services_dyndns_edit.php: Response Header: vary: Accept-Encoding Aug 24 16:23:04 php-fpm 11484 /services_dyndns_edit.php: Response Header: content-type: application/json Aug 24 16:23:04 php-fpm 11484 /services_dyndns_edit.php: Response Header: date: Wed, 24 Aug 2022 13:23:04 GMT Aug 24 16:23:04 php-fpm 11484 /services_dyndns_edit.php: Response Header: HTTP/2 200 Aug 24 16:23:04 php-fpm 11484 /services_dyndns_edit.php: Dynamic DNS namecheap (home.XMX.net): _update() starting. Aug 24 16:23:04 php-fpm 11484 /services_dyndns_edit.php: Dynamic DNS (home.XMX.net): running get_failover_interface for wan. found igb0 Aug 24 16:23:04 php-fpm 11484 /services_dyndns_edit.php: Dynamic DNS namecheap (home.XMX.net): xxx.yyy.zzz.aaa extracted from Check IP Service Aug 24 16:23:03 php-fpm 11484 /services_dyndns_edit.php: Dynamic DNS namecheap (home.XMX.net): _checkIP() starting. Aug 24 16:23:03 php-fpm 11484 /services_dyndns_edit.php: Dynamic DNS: updatedns() starting
-
Hmm, looks exactly like what that patch should correct.
Does it show as applied? Is the change actually present in /etc/inc/dyndns.class?
-
This is the namecheap section in the /etc/inc/dyndns.class file:
-
-
Hmm, sure looks like the response is correct.
-
@stephenw10
With my limited php experience I was able to find out the problem.
The response is an xml sent on one line, with the encoding set to utf-16, so line$ncresponse = xml2array(substr($tmp, strpos($tmp, "\n") + 1));
gets executed, and $ncresponse is actually empty.
Which means that $ncresponse does not match any of the ifs. so it ends up in the lastelse
. -
I just added this line
$tmp = str_replace("utf-16", "utf-8", $data);
under line
$tmp = str_replace("^M", "", $data);
.It's rather crude, but it works :))
edit:
This could work too:$tmp = str_replace("utf-16\"?>", "utf-16\"?>\n", $data);