Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
exception ‘Exception’ with message ‘PayPal IPN postback failure. See paypal_unknown_ipn.log for details.’ in /app/code/core/Mage/Paypal/Model/Ipn.php: 
 
Tuppi Sau
Member
 
Total Posts:  34
Joined:  2010-01-18
 

Hello Magento Team,

Seems everyone is getting this error and whole magento team is silent. The IPN POST back was working perfectly previously at version 1.4.0.1 but after my upgrade it to 1.4.2.0 the order is processed using PayPal Standard but there is no transaction no. shown at the order “payment Information” and the payment status at the “Comments History” remained Pending Payment. I’ve looked at the paypal_unkonwn_ipn.log and it says:

2011-01-06T20:37:46+00:00 DEBUG (7): Array
(
[ipn] => Array
(
[address_city] => [omitted]
[address_country] => [omitted]
[address_country_code] => [omitted]
[address_name] => [omitted]
[address_state] => [omitted]
[address_status] => unconfirmed
[address_street] => [omitted]
[address_zip] => [omitted]
[business] => [omitted]
[charset] => windows-1252
[custom] =>
[first_name] => [omitted]
[invoice] => [omitted]
[item_name1] => [omitted]
[item_name2] => [omitted]
[item_name3] => [omitted]
[item_name4] => [omitted]
[item_name5] => [omitted]
[item_name6] => [omitted]
[item_number1] => [omitted]
[item_number2] => [omitted]
[item_number3] => [omitted]
[item_number4] => [omitted]
[item_number5] => [omitted]
[item_number6] => [omitted]
[last_name] => [omitted]
[mc_currency] => [omitted]
[mc_fee] => 3.27
[mc_gross] => 123.90
[mc_gross_1] => 23.52
[mc_gross_2] => 22.24
[mc_gross_3] => 19.07
[mc_gross_4] => 22.24
[mc_gross_5] => 19.07
[mc_gross_6] => 6.50
[mc_handling] => 0.00
[mc_handling1] => 0.00
[mc_handling2] => 0.00
[mc_handling3] => 0.00
[mc_handling4] => 0.00
[mc_handling5] => 0.00
[mc_handling6] => 0.00
[mc_shipping] => 0.00
[mc_shipping1] => 0.00
[mc_shipping2] => 0.00
[mc_shipping3] => 0.00
[mc_shipping4] => 0.00
[mc_shipping5] => 0.00
[mc_shipping6] => 0.00
[notify_version] => 3.0
[num_cart_items] => 6
[payer_email] => [omitted]
[payer_id] => [omitted]
[payer_status] => unverified
[payment_date] => [omitted]
[payment_fee] =>
[payment_gross] =>
[payment_status] => Completed
[payment_type] => instant
[protection_eligibility] => Ineligible
[quantity1] => 1
[quantity2] => 1
[quantity3] => 1
[quantity4] => 1
[quantity5] => 1
[quantity6] => 1
[receiver_email] => [omitted]
[receiver_id] => [omitted]
[residence_country] => [omitted]
[tax] => 11.26
[transaction_subject] => Shopping Cart
[txn_id] => 13Y15457Y4430400H
[txn_type] => cart
[verify_sign] => Ai1PaghZh5FmBLCDCTQpwG8jB264AZfYKbP9fP6IYXV90jQxdUgWjm.8
)

[postback] => invoice=400000741&first;_name=[omitted]&mc;_shipping=0.00&mc;_currency=[omitted]&payer;_status=unverified&payment;_fee=&address;_status=unconfirmed&payment;_gross=&address;_zip=[omitted]&address;_country_code=[omitted]&txn;_type=cart#_cart_items=6&mc;_handling=0.00&verify;_sign=Ai1PaghZh5FmBLCDCTQpwG8jB264AZfYKbP9fP6IYXV90jQxdUgWjm.8&payer;_id=[omitted]&charset;=windows-1252&receiver;_id=[omitted]&mc;_handling1=0.00&mc;_handling2=0.00&mc;_handling3=0.00&mc;_handling4=0.00&mc;_handling5=0.00&item;_name1=[omitted]&mc;_handling6=0.00&tax;=11.26&item;_name2=[omitted]&item;_name3=[omitted]&item;_name4=[omitted]&payment;_type=instant&item;_name5=[omitted]&item;_name6=Shipping&address;_street=[omitted]&mc;_shipping1=0.00&mc;_shipping2=0.00&mc;_shipping3=0.00&txn;_id=[omitted]&mc;_shipping4=0.00&mc;_shipping5=0.00&mc;_shipping6=0.00&mc;_gross_1=23.52&quantity1;=1&mc;_gross_2=22.24&quantity2;=1&item;_number1=[omitted]&protection;_eligibility=Ineligible&mc;_gross_3=19.07&quantity3;=1&item;_number2=[omitted]&mc;_gross_4=22.24&quantity4;=1&item;_number3=[omitted]&mc;_gross_5=19.07&quantity5;=1&custom;=&item;_number4=[omitted]&mc;_gross_6=6.50&quantity6;=1&item;_number5=[omitted]&item;_number6=[omitted]&business;=[omitted]&residence;_country=[omitted]&last;_name=[omitted]&address;_state=[omitted]&payer;_email=[omitted]&address;_city=[omitted]&payment;_status=Completed&payment;_date=[omitted]&transaction;_subject=Shopping+Cart&receiver;_email=[omitted]&mc;_fee=3.27&notify;_version=3.0&address;_country=[omitted]&mc;_gross=123.90&address;_name=[omitted]&cmd;=_notify-validate
[postback_to] => https://www.paypal.com/webscr
[postback_result] => HTTP/1.1 200 OK
Date: Thu, 06 Jan 2011 20:37:45 GMT
Server: Apache
Set-Cookie: cwrClyrK4LoCV1fydGbAxiNL6iG=ud-XBUyAsABBv3OcFneex7zbaNtsBrqydUNxHehEG-FHE2KXIJBD-Z8sc70T8bPmLSzO57D3roUgtiNL-szyrOY0j3D5GRrBmu1ORA8EqlpY85CsLlMfvTb1sWhOpwGDEYM2sG|-PfvRfW07ks_3JEXK1QdgT8g7jvFTSxlx3X40sfj-PWDAcggDUsNbKDZ_I30D4M4X7wR20|DgaEUkGoX9TCoz8cRg-fM7qKlfch2IfpwVkzzpHOJeijV7qOXJiIRi6vIaLTlsv3dfqSJW|1294346266; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: cookie_check=yes; expires=Sun, 03-Jan-2021 20:37:46 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: navcmd=_notify-validate; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: navlns=0.0; expires=Wed, 01-Jan-2031 20:37:46 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: Apache=10.190.9.185.1294346265755565; path=/; expires=Sat, 29-Dec-40 20:37:45 GMT
Vary: Accept-Encoding
Strict-Transport-Security: max-age=500
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

INVALID
[exception] => PayPal IPN postback failure. See paypal_unknown_ipn.log for details.
[__pid] => 11627
)

At the exception.log it says:

#20 {main}
2011-01-06T20:37:46+00:00 ERR (3):
exception ‘Exception’ with message ‘PayPal IPN postback failure. See paypal_unknown_ipn.log for details.’ in /app/code/core/Mage/Paypal/Model/Ipn.php:155
Stack trace:
#0 /app/code/core/Mage/Paypal/Model/Ipn.php(112): Mage_Paypal_Model_Ipn->_postBack(Object(Varien_Http_Adapter_Curl))
#1 /app/code/core/Mage/Paypal/controllers/IpnController.php(43): Mage_Paypal_Model_Ipn->processIpnRequest(Array, Object(Varien_Http_Adapter_Curl))
#2 /app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Paypal_IpnController->indexAction()
#3 /app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(253): Mage_Core_Controller_Varien_Action->dispatch(’index’)
#4 /app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#5 /app/code/core/Mage/Core/Model/App.php(304): Mage_Core_Controller_Varien_Front->dispatch()
#6 /app/Mage.php(596): Mage_Core_Model_App->run(Array)
#7 /index.php(78): Mage::run(’’, ‘store’)

I’ve set the new IPN URL at the PayPal Account Center as suggested at this post:
http://www.magentocommerce.com/boards/viewthread/196048/#t251913

and re-triggered the IPN but still the it creates no effect at the order status but logs the same errors again. I’ve tried searching to many forum posts but with no luck :(. Can anyone really make some contribution to this issue. I don’t think Magento team have any time to see this issue but they have lot of time to upgrade their buggy versions.

Any help would be very helpful. Thanx in advance. I know there are lot of experts out there to solve this issue rasberry.

Cheers!!!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
bcp_vps
Jr. Member
 
Total Posts:  10
Joined:  2010-12-05
 

I just ran into this problem today.  Interestingly, the orders are still going through just fine and I don’t see any problems, but exceptions always scare me.  Any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikonratm
Sr. Member
 
Total Posts:  84
Joined:  2009-03-18
 

Me too. Magento, sigh.

 
Magento Community Magento Community
Magento Community
Magento Community
 
albertjooger
Jr. Member
 
Total Posts:  10
Joined:  2011-04-08
 

I’m not understanding this coding as you share with us above, can you please also explain it ???

 
Magento Community Magento Community
Magento Community
Magento Community
 
tobillo
Member
 
Avatar
Total Posts:  46
Joined:  2008-04-07
Germany
 

Hi everyone… we have the same problem with a shop. we use version 1.4.2.0 and get alyways the “PayPal IPN postback failure” exeption. Anyone has a solution in the meantime?

 
Magento Community Magento Community
Magento Community
Magento Community
 
tobillo
Member
 
Avatar
Total Posts:  46
Joined:  2008-04-07
Germany
 

UPDATE: in our case we had the wrong cURL Version. Also it\’s nessesary to complie cURL with OpenSSL.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ryanharne
Jr. Member
 
Total Posts:  3
Joined:  2012-03-20
 

I had same issue, but manually patch by

http://www.magentocommerce.com/bug-tracking/issue/?issue=13515#30

See my comment #30.

hope this helps
cheers

 
Magento Community Magento Community
Magento Community
Magento Community
 
wikilab
Jr. Member
 
Total Posts:  1
Joined:  2011-11-07
 

Hi ryanharne thank you for your solution. But now I have another problem. Some order payed with paypal print this error on system.log file:

Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /var/www/clients/client3/web24/web/app/code/core/Mage/Paypal/Model/Ipn.php on line 145
Warning: file_get_contents(https://www.paypal.com/webscr?mc_gross=50.00&invoice;=949&protection;_eligibility=Eligible&address;_status=unconfirmed&paye;..... (the url of paypal user information) &shipping;=0.00&ipn;_track_id=1fd8d8a3cfb5b&cmd;=_notify-validate): failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /var/www/clients/client3/web24/web/app/code/core/Mage/Paypal/Model/Ipn.php on line 145

Now my Ipn.php file is:
protected function _postBack(Zend_Http_Client_Adapter_Interface $httpAdapter)
{

//$httpAdapter->write(Zend_Http_Client::POST, $this->_config->getPaypalUrl(), ‘1.1’, array(), $sReq);
try {
//$response = $httpAdapter->read();
$response = trim(file_get_contents($this->_config->getPaypalUrl() . “?” . $sReq));
} catch (Exception $e) {
$this->_debugData[’http_error’] = array(’error’ => $e->getMessage(), ‘code’ => $e->getCode());
throw $e;
}
$this->_debugData[’postback_result’] = $response;

$resp = preg_split(’/^\r?$/m’, $response, 2);
if( (is_array($resp)) && (!empty($resp[1])) )
{
$response = trim($resp[1]);
}
if ($response != ‘VERIFIED’) {
throw new Exception(’PayPal IPN postback failure. See ‘ . self::DEFAULT_LOG_FILE . ‘ for details.’);
}
....
}

If you have suggest it will be appreciate. Thank you in advance.

Francesco

 
Magento Community Magento Community
Magento Community
Magento Community
 
ryanharne
Jr. Member
 
Total Posts:  3
Joined:  2012-03-20
 

Hi wikilab,

Those were DNS related issue, please refer to your domain manager / hosting.
See these reported issue at
http://stackoverflow.com/questions/11802351/

::Changing nameserver lines with Google’s public DNS servers address in your resolv.conf file

Hope this helps.
Ryan H.

 
Magento Community Magento Community
Magento Community
Magento Community
 
CoastAMS
Member
 
Avatar
Total Posts:  57
Joined:  2011-03-24
Bath
 

Hi - we get the odd PayPal IPN postback failure - the order in the back-end shows as Pending Payment but the money has been taken.

Magento CE 1.5.0.1

The unknown IPN log even shows this…
[payment_status] => Completed
[payment_type] => instant

Most order go through without this problem though so the process works...any ideas? Could it be timing out?

Addittion - the log also states this…
[postback_to] => https://www.paypal.com/webscr
[postback_result] => HTTP/1.1 100 Continue

Thanks, Paul

 
Magento Community Magento Community
Magento Community
Magento Community
 
barnyshergold
Member
 
Avatar
Total Posts:  53
Joined:  2011-02-05
 

I\’ve just found out another reason why you get IPN failures on Magento 1.7+

If you are using Website Payments Standard and your site DOES NOT use SSL. Make sure the Advanced Option : Enable SSL verification is set to NO.

Barny

 
Magento Community Magento Community
Magento Community
Magento Community
 
shadowice222
Jr. Member
 
Total Posts:  3
Joined:  2011-12-10
 

@CoastAMS

I have been having the same issue. If you notice, the postback_result should have much more than just

[postback_result] => HTTP/1.1 100 Continue

it seems that the 100 / 101 part of the response is not being cut off properly as it is supposed to be in..

magento/lib/Varien/Http/Adapter/Curl.php
public function read()
    
{
        $response 
curl_exec($this->_getResource());

        
// Remove 100 and 101 responses headers
        
if (Zend_Http_Response::extractCode($response) == 100 ||
            
Zend_Http_Response::extractCode($response) == 101{
            $response 
preg_split(\'/^\\r?$/m\'$response2);
            
$response trim($response[1]);
        
}

        
return $response;
    
}

..and in..

magento/lib/Zend/Http/Response.php
public static function extractCode($response_str)
    
{
        preg_match
(\"|^HTTP/[\\d\\.x]+ (\\d+)|\"$response_str$m);

        if (isset(
$m[1])) {
            
return (int) $m[1];
        
else {
            
return false;
        
}
    }

i cannot figure out why though

 
Magento Community Magento Community
Magento Community
Magento Community
 
angelo_f
Sr. Member
 
Total Posts:  80
Joined:  2011-10-28
 

I found a patch at this URL. Hopefully it will fix issue
http://www.magentocommerce.com/bug-tracking/issue/?issue=13515#30

 
Magento Community Magento Community
Magento Community
Magento Community
 
Peppermay
Sr. Member
 
Avatar
Total Posts:  111
Joined:  2008-10-18
Lille, France
 

Hi MageFolks !
Has anyone found out a logical reason why Paypal postbacks sometimes (!) break with an empty [postback_result] ?

Is this a Paypal, Magento, Zend or curl bug ?
Is this occurring when one of the Paypal transaction parameters is given a special value ?
Is there any security risk with the kbaleozzz-ryanharne’s fix ?

With a fewer words: where are we now ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
angelo_f
Sr. Member
 
Total Posts:  80
Joined:  2011-10-28
 
Peppermay - 28 February 2013 01:39 AM

Hi MageFolks !
Has anyone found out a logical reason why Paypal postbacks sometimes (!) break with an empty [postback_result] ?

Is this a Paypal, Magento, Zend or curl bug ?
Is this occurring when one of the Paypal transaction parameters is given a special value ?
Is there any security risk with the kbaleozzz-ryanharne’s fix ?

With a fewer words: where are we now ?

It might be worth comparing what the function was in a previous version of magento - say 6.2.  We only have this issue in version 7

 
Magento Community Magento Community
Magento Community
Magento Community
 
Peppermay
Sr. Member
 
Avatar
Total Posts:  111
Joined:  2008-10-18
Lille, France
 
angelo_f - 28 February 2013 12:41 PM

It might be worth comparing what the function was in a previous version of magento - say 6.2.  We only have this issue in version 7

After a quick glance, it looks like Mage_Paypal_Model_Ipn->_postback(), Varien_Http_Adapter_Curl->read() and Zend_Http_Response::extractCode() remain unchanged between 1.6.2 and 1.7.0…
Weird…

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2