Koozali.org: home of the SME Server

Possible cURL Issue?

Offline bclayton

  • *
  • 137
  • +0/-0
Possible cURL Issue?
« on: November 08, 2018, 03:08:51 PM »
Hello, I have a fully updated 9.2 server  and have recently added a Joomla extension to provide a photo gallery and shopping cart (scl php71).  The cart connects to PayPal for credit card processing. Here's the issue, I have noticed that after a system reboot the cart does not connect to PayPal but gives a curl error 6.

On the command line, I entered the code below and it does not connect.  If I run the same command a second time, it does connect.  Once I have done this, the payments process as they should and PayPal updates the application. Everything works correctly.  I'm running curl 7.19.7.

The PayPal website says that curl error 6 is a problem with curl on my server.  It seems strange to me that it will connect on the second try, but not the first.

Not sure it is a bug. Any suggestions will be appreciated.  Thank you, Brooks

---------
[root@provue-server ~]# curl -I https://www.paypal.com
curl:(6) Couldn't resolve host 'www.paypal.com'

[root@provue-server ~]# curl -I https://www.paypal.com
HTTP/1.1 302 Moved Temporarily
Server: Apache
X-Recruiting: If you are reading this, maybe you should be working at PayPal instead! Check out https://www.paypal.com/us/webapps/mpp/paypal-jobs
Paypal-Debug-Id: 4fb60aa7c4971
Cache-Control: no-cache
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
content-security-policy: default-src 'self' https://*.paypal.com https://*.paypalobjects.com; frame-src 'self' https://*.brighttalk.com https://*.paypal.com https://*.paypalobjects.com https://www.youtube-nocookie.com https://www.xoom.com https://*.pub.247-inc.net https://www.wootag.com; script-src 'nonce-X/DnN+0XFYU9DvII+9A/wvOP9dGc5+n/DhCa2NRt3c7XR9pd' 'self' https://*.paypal.com https://*.paypalobjects.com https://assets-cdn.s-xoom.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' https://nominatim.openstreetmap.org https://*.paypal.com https://*.paypalobjects.com https://*.google-analytics.com https://*.salesforce.com https://*.force.com https://*.eloqua.com https://nexus.ensighten.com https://api.paypal-retaillocator.com https://*.brighttalk.com https://*.sperse.io https://*.dialogtech.com; style-src 'self' https://*.paypal.com https://*.paypalobjects.com https://assets-cdn.s-xoom.com 'unsafe-inline'; font-src 'self' https://*.paypal.com https://*.paypalobjects.com https://assets-cdn.s-xoom.com data:; img-src 'self' https: data:; form-action 'self' https://*.paypal.com https://*.salesforce.com https://*.eloqua.com https://secure.opinionlab.com; base-uri 'self' https://*.paypal.com; object-src 'none'; block-all-mixed-content; report-uri https://www.paypal.com/csplog/api/log/csp
HTTP_X_PP_AZ_LOCATOR: ccg23.lvs
Paypal-Debug-Id: 4fb60aa7c4971
Location: /us/home
Cache-Control: max-age=0, no-cache, no-store, must-revalidate
Pragma: no-cache
Content-Type: text/plain; charset=utf-8
DC: phx-origin-www-1.paypal.com
X-EdgeConnect-MidMile-RTT: 60
X-EdgeConnect-Origin-MEX-Latency: 145
Date: Wed, 07 Nov 2018 14:13:47 GMT
Connection: keep-alive
Set-Cookie: LANG=en_US%3BUS; Max-Age=31; Domain=.paypal.com; Path=/; Expires=Wed, 07 Nov 2018 14:14:19 GMT; HttpOnly; Secure
Set-Cookie: enforce_policy=; Domain=.paypal.com; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT; Secure
Set-Cookie: x-pp-s=eyJ0IjoiMTU0MTYwMDAyNzkyNyIsIm0iOiIwIn0; Domain=.paypal.com; Path=/; HttpOnly; Secure
Set-Cookie: tsrce=mppnodeweb; Domain=.paypal.com; Path=/; Expires=Sat, 10 Nov 2018 14:13:47 GMT; HttpOnly; Secure
Set-Cookie: ts=vr%3Dee85a4cb1660ac80ae606b47ffff45d9%26vreXpYrS%3D1636270804%26vteXpYrS%3D1541601827%26vt%3Dee85a4fb1660ac80ae606b47ffff45d8; Domain=.paypal.com; Path=/; Expires=Sun, 07 Nov 2021 07:40:04 GMT; HttpOnly; Secure
Set-Cookie: nsid=s%3ARHhMk1rOp0on3iyy7rOMakS6hMV30Hvo.j2O51Ys3hv7I9ZiK5eHmRSN97fcKl%2BuE5dSN%2FSFG%2Fhs; Path=/; HttpOnly; Secure
Set-Cookie: X-PP-SILOVER=name%3DLIVE3.WEB.1%26silo_version%3D880%26app%3Dmppnodeweb%26TIME%3D468968027%26HTTP_X_PP_AZ_LOCATOR%3Dccg23.lvs; Expires=Wed, 07 Nov 2018 14:43:47 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT
Set-Cookie: AKDC=phx-origin-www-1.paypal.com; expires=Wed, 07-Nov-2018 14:43:47 GMT; path=/; secure
Set-Cookie: akavpau_ppsd=1541600627~id=95ca99380a266cf2625e782048fcb7c0; Domain=www.paypal.com; Path=/; Secure; HttpOnly
Strict-Transport-Security: max-age=63072000

[root@provue-server ~]#

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Possible cURL Issue?
« Reply #1 on: November 08, 2018, 07:25:00 PM »
It's not a curl issue per se, but a DNS lookup issue - possibly something dnscache is not handling well because of the complexity of the paypal DNS configuration. See:

https://bugs.contribs.org/show_bug.cgi?id=8362

Offline bclayton

  • *
  • 137
  • +0/-0
Re: Possible cURL Issue?
« Reply #2 on: November 08, 2018, 07:59:24 PM »
Hi Charlie,
Thank you very much for the help1  I had searched Google and the forum, but did not come across this bug report.  The bug report mentions SME 10.x.  I assume it also works with 9.2?  I see the installation instructions in the report and I'll try that this evening.  Again, thanks. Brooks

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: Possible cURL Issue?
« Reply #3 on: November 09, 2018, 12:04:32 AM »
Yes, an updated rpm for sme9.2 was verified as well as the sme10a3 one. There are other bugs that also refer..
--
qui scribit bis legit

Offline bclayton

  • *
  • 137
  • +0/-0
Re: Possible cURL Issue?
« Reply #4 on: November 09, 2018, 03:41:26 PM »
I installed the new dnscache from the testing repo, but it did not solve my problem.  After rebooting, on the first attempt to connect to PayPal it fails with the same curl error 6, but connects on the second attempt.  Any further suggestions?  Thanks, Brooks

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: Possible cURL Issue?
« Reply #5 on: November 09, 2018, 10:01:11 PM »
Ok from my end, My system,

# rpm -qa djbdns
djbdns-1.05-11.el6.sme.x86_64
# time dnsqr a  www.paypal.com
1 www.paypal.com:
144 bytes, 1+4+0+0 records, response, noerror
query: 1 www.paypal.com
answer: www.paypal.com 300 CNAME www.glb.paypal.com
answer: www.glb.paypal.com 3600 CNAME www.paypal.com.edgekey.net
answer: www.paypal.com.edgekey.net 120 CNAME e16973.a.akamaiedge.net
answer: e16973.a.akamaiedge.net 20 A 23.210.80.233

real    0m2.023s
user    0m0.001s
sys     0m0.002s
 
--
qui scribit bis legit

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: Possible cURL Issue?
« Reply #6 on: November 09, 2018, 10:17:44 PM »
See Bug 10381 for further discussion
--
qui scribit bis legit

Offline bclayton

  • *
  • 137
  • +0/-0
Re: Possible cURL Issue?
« Reply #7 on: November 09, 2018, 11:23:56 PM »
Thank you.
I ran the commands and got the same results that you did:

[root@provue-server ~]# rpm -qa djbdns
djbdns-1.05-11.el6.sme.x86_64
[root@provue-server ~]# time dnsqr a  www.paypal.com
1 www.paypal.com:
144 bytes, 1+4+0+0 records, response, noerror
query: 1 www.paypal.com
answer: www.paypal.com 4 CNAME www.glb.paypal.com
answer: www.glb.paypal.com 3304 CNAME www.paypal.com.edgekey.net
answer: www.paypal.com.edgekey.net 120 CNAME e16973.a.akamaiedge.net
answer: e16973.a.akamaiedge.net 20 A 23.46.200.219

real    0m0.042s
user    0m0.001s
sys     0m0.000s
[root@provue-server ~]#

So, that appears to be correct.  I take a look at the bug that you referenced.