Answers.Body: <p>I think there is a bug here of some sort - I have reverted to an old copy of ipn.php, from 4.7.3, and payments are now completing successfully again</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-15T21:24:50.703Z
Answers.Text: Hi Robin, please can you confirm the total filepath of the file that you replaced? I'll take a look at it.
Answers.UserDisplayName: JohnFF
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-16T02:59:05.253Z
Answers.Text: I am having a problem as well with Paypal completing and it started with 4.7.4.  Is there a place I can get the 4.7.3 ipn.php to test as well?  Do I need to download the old version and expand to get it or is there a place online?
Answers.UserDisplayName: Hudson Essex Terraplane Club
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-16T16:21:26.543Z
Answers.Text: Hi @JohnFF in Drupal it is /sites/all/modules/civicrm/extern/ipn.php
  
  Thank you :)
Answers.UserDisplayName: Robin Fenwick
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-16T16:22:39.090Z
Answers.Text: @HudsonEssexTerraplaneClub I happened to have 4.7.3 as a backup copy on our server, but you can download it from https://sourceforge.net/projects/civicrm/files/civicrm-stable/4.7.3/
Answers.UserDisplayName: Robin Fenwick
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-16T16:40:37.063Z
Answers.Text: So the only difference is the following two lines in ipn.php:                   //CRM-18245
    CRM_Utils_System::loadBootStrap();                                    What are these two lines doing.  Still testing the old ipn.php file to see if it fixes my problem.
Answers.UserDisplayName: Hudson Essex Terraplane Club
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-16T23:33:56.877Z
Answers.Text: By removing that bootstrap line, my PayPal works again.
Answers.UserDisplayName: Hudson Essex Terraplane Club
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-28T22:28:12.070Z
Answers.Text: Seem related to: https://issues.civicrm.org/jira/browse/CRM-18245
Answers.UserDisplayName: bgm
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-23T22:27:27.563Z
Answers.Text: Monish Deb's answer has the explanation why.
Answers.UserDisplayName: JohnFF
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-14T15:55:25.640Z
Answers.LastActivityDate: 2016-04-14T15:55:25.640Z
Answers.UserDisplayName: Robin Fenwick
Answers.Body: <p>Issue had been filed <a href="https://issues.civicrm.org/jira/browse/CRM-18483" rel="nofollow">https://issues.civicrm.org/jira/browse/CRM-18483</a> and this is my fix <a href="https://github.com/civicrm/civicrm-core/pull/8270/files" rel="nofollow">https://github.com/civicrm/civicrm-core/pull/8270/files</a> </p>
  
  <p>As earlier in case of drupal site, CRM_Utils_System::loadBootStrap() eventually calls CRM_Utils_System_Drupal::loadBootStrap() and fails at <a href="https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/System/Drupal.php#L545" rel="nofollow">https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/System/Drupal.php#L545</a> because we are not passing any drupal userID as $uid parameter in loadBootStrap() fn and got halt at the same point. Unlike in other CMS (wordpress, joomla) the underlying bootstrap code is not too reliant on user id and didn't break. </p>
  
  <p>As per my fix CRM_Utils_System::loadBootStrap($params, TRUE, FALSE) where 2nd parameter stands for $loadUser = TRUE and third $throwError = FALSE so if there is no corresponding CMS userID assigned against civiCRM contactID then it won't break rather it will return false and will complete the workflow just what happen when we call REST url <a href="https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/REST.php#L711" rel="nofollow">https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/REST.php#L711</a>. </p>
  
  <p>The reason behind calling loadBootstrap function lies in <a href="https://issues.civicrm.org/jira/browse/CRM-18245" rel="nofollow">https://issues.civicrm.org/jira/browse/CRM-18245</a> </p>
  
  <p>Can anyone please verify my patch if it works for ya!!</p>
  
  <p>Thanks</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-29T12:50:11.727Z
Answers.LastActivityDate: 2016-04-29T12:50:11.727Z
Answers.UserDisplayName: Monish Deb
Answers.Body: <p>We had identical symptoms, after lots of cursing CiviCRM, finally found it was nothing to do with CiviCRM. 
  PayPal IPN requires a <strong>valid</strong> email address. Our mailbox was full with someones vast supply of Spam. Cleared the mailbox and it worked fine.
  Hope this does it for you.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-14T08:31:48.527Z
Answers.LastActivityDate: 2016-04-14T08:31:48.527Z
Answers.UserDisplayName: PeterS
Answers.Body: <p>This is a really common error incidentally.</p>
  
  <p>I suspect that that error you're seeing is unrelated to the PayPal issue.</p>
  
  <ol>
  <li>Check the CiviCRM Error Logs for errors that happened around the time of the last transaction.</li>
  <li>Check your htaccess logs for blocked requests from PayPal.</li>
  <li>The error being thrown is in libraries/civicrm/CRM/Utils/System/Drupal.php line 545 in function loadBootStrap. This code is messy, with a function that does many things.</li>
  <li>I would check visiting the IPN with the correct parameters in a browser and seeing if that updates the transactions as you'd expect.</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-08T15:28:27.110Z
Answers.Text: Thanks @JohnFF - there is nothing relevant in the logs (no error fires at the time of the transaction), no blocked request in the access logs, and going to the IPN URL just generates 'Sorry, can not load CMS user account'
  
  Here are some relevant lines from access_log
Answers.UserDisplayName: Robin Fenwick
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-08T15:29:09.333Z
Answers.Text: 173.0.81.1 - - [08/Apr/2016:09:48:42 +0100] "POST /sites/all/modules/civicrm/extern/ipn.php?reset=1&contactID=9994&contributionID=5667&module=contribute&membershipID=9587 HTTP/1.0" 200 43
  173.0.81.1 - - [08/Apr/2016:09:51:28 +0100] "POST /sites/all/modules/civicrm/extern/ipn.php?reset=1&contactID=9994&contributionID=5669&module=contribute&membershipID=9587 HTTP/1.0" 200 43
  82.153.198.74 - - [08/Apr/2016:10:03:21 +0100] "GET /sites/all/modules/civicrm/extern/ipn.php?reset=1&contactID=9994&contributionID=5669&module=contribute&membershipID=9587 HTTP/1.1" 200 43
Answers.UserDisplayName: Robin Fenwick
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-08T14:19:07.590Z
Answers.LastActivityDate: 2016-04-08T14:19:07.590Z
Answers.UserDisplayName: JohnFF
Body: <p>We're on civicrm 4.7.5 on Drupal 7.</p>
  
  <p>All contributions paid through the paypal standard payment processor are failing to successfully complete.</p>
  
  <p>The user sees a successful transaction, but the contribution status is "    Pending (Incomplete Transaction)"</p>
  
  <p>There is nothing in the CiviCRM log to suggest an error. The IPN is sent to the correct URL, the status recorded in paypal is HTTP 200 OK.</p>
  
  <p>But when I copy the path into a browser:</p>
  
  <p><a href="https://[ourwebsiteurlredacted.com]/sites/all/modules/civicrm/extern/ipn.php?reset=1&amp;contactID=9994&amp;contributionID=5669&amp;module=contribute&amp;membershipID=9587">https://[ourwebsiteurlredacted.com]/sites/all/modules/civicrm/extern/ipn.php?reset=1&amp;contactID=9994&amp;contributionID=5669&amp;module=contribute&amp;membershipID=9587</a></p>
  
  <p>this prints the following message to screen:</p>
  
  <pre><code>Sorry, can not load CMS user account.
  </code></pre>
  
  <p>Any help debugging would be greatfully received!</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-08T09:16:34.593Z
Comments.Text: Apologies for typo in subject line!
Comments.UserDisplayName: Robin Fenwick
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-08T10:58:29.730Z
Comments.Text: You can edit the title to correct this!
Comments.UserDisplayName: William Mortada
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-08T11:59:56.863Z
Comments.Text: So I can! Typo corrected. (Bug still present!)
Comments.UserDisplayName: Robin Fenwick
Tags: <civicontribute><paypal><ipn>
Title: Paypal payments - Pending (Incomplete Transaction)
ThreadText: # Paypal payments - Pending (Incomplete Transaction)
  
  (Asked by: username_0 on 2016-04-08)
  
  We're on civicrm 4.7.5 on Drupal 7.
  
  All contributions paid through the paypal standard payment processor are failing to successfully complete.
  
  The user sees a successful transaction, but the contribution status is " Pending (Incomplete Transaction)"
  
  There is nothing in the CiviCRM log to suggest an error. The IPN is sent to the correct URL, the status recorded in paypal is HTTP 200 OK.
  
  But when I copy the path into a browser:
  
  <https://[ourwebsiteurlredacted.com]/sites/all/modules/civicrm/extern/ipn.php?reset=1&contactID=9994&contributionID=5669&module=contribute&membershipID=9587>
  
  this prints the following message to screen:
  
  ```
  Sorry, can not load CMS user account.
  
  ```
  
  Any help debugging would be greatfully received!
  
  **Tags:** civicontribute, paypal, ipn
  
  > **Comments:**
  > **username_0**: Apologies for typo in subject line!  
  > **username_1**: You can edit the title to correct this!  
  > **username_0**: So I can! Typo corrected. (Bug still present!)  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_0 on 2016-04-14. Score: 2 | Accepted answer
  
  I think there is a bug here of some sort - I have reverted to an old copy of ipn.php, from 4.7.3, and payments are now completing successfully again
  
  > **Comments:**
  > **username_2**: Hi username_0, please can you confirm the total filepath of the file that you replaced? I'll take a look at it.  
  > **username_3**: I am having a problem as well with Paypal completing and it started with 4.7.4.  Is there a place I can get the 4.7.3 ipn.php to test as well?  Do I need to download the old version and expand to get it or is there a place online?  
  > **username_0**: Hi @username_2 in Drupal it is /sites/all/modules/civicrm/extern/ipn.php  Thank you :)  
  > **username_0**: @username_3 I happened to have 4.7.3 as a backup copy on our server, but you can download it from https://sourceforge.net/projects/civicrm/files/civicrm-stable/4.7.3/  
  > **username_3**: So the only difference is the following two lines in ipn.php:                   //CRM-18245   CRM_Utils_System::loadBootStrap();                                    What are these two lines doing.  Still testing the old ipn.php file to see if it fixes my problem.  
  > **username_3**: By removing that bootstrap line, my PayPal works again.  
  > **username_4**: Seem related to: https://issues.civicrm.org/jira/browse/CRM-18245  
  > **username_2**: username_5's answer has the explanation why.  
  
  ---
  
  ### Answer by username_5 on 2016-04-29. Score: 4
  
  Issue had been filed <https://issues.civicrm.org/jira/browse/CRM-18483> and this is my fix <https://github.com/civicrm/civicrm-core/pull/8270/files>
  
  As earlier in case of drupal site, CRM\_Utils\_System::loadBootStrap() eventually calls CRM\_Utils\_System\_Drupal::loadBootStrap() and fails at <https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/System/Drupal.php#L545> because we are not passing any drupal userID as $uid parameter in loadBootStrap() fn and got halt at the same point. Unlike in other CMS (wordpress, joomla) the underlying bootstrap code is not too reliant on user id and didn't break.
  
  As per my fix CRM\_Utils\_System::loadBootStrap($params, TRUE, FALSE) where 2nd parameter stands for $loadUser = TRUE and third $throwError = FALSE so if there is no corresponding CMS userID assigned against civiCRM contactID then it won't break rather it will return false and will complete the workflow just what happen when we call REST url <https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/REST.php#L711>.
  
  The reason behind calling loadBootstrap function lies in <https://issues.civicrm.org/jira/browse/CRM-18245>
  
  Can anyone please verify my patch if it works for ya!!
  
  Thanks
  
  
  ---
  
  ### Answer by username_6 on 2016-04-14. Score: 2
  
  We had identical symptoms, after lots of cursing CiviCRM, finally found it was nothing to do with CiviCRM.
  PayPal IPN requires a **valid** email address. Our mailbox was full with someones vast supply of Spam. Cleared the mailbox and it worked fine.
  Hope this does it for you.
  
  
  ---
  
  ### Answer by username_2 on 2016-04-08. Score: 1
  
  This is a really common error incidentally.
  
  I suspect that that error you're seeing is unrelated to the PayPal issue.
  
  1. Check the CiviCRM Error Logs for errors that happened around the time of the last transaction.
  2. Check your htaccess logs for blocked requests from PayPal.
  3. The error being thrown is in libraries/civicrm/CRM/Utils/System/Drupal.php line 545 in function loadBootStrap. This code is messy, with a function that does many things.
  4. I would check visiting the IPN with the correct parameters in a browser and seeing if that updates the transactions as you'd expect.
  
  > **Comments:**
  > **username_0**: Thanks @username_2 - there is nothing relevant in the logs (no error fires at the time of the transaction), no blocked request in the access logs, and going to the IPN URL just generates 'Sorry, can not load CMS user account'  Here are some relevant lines from access_log  
  > **username_0**: 173.0.81.1 - - [08/Apr/2016:09:48:42 +0100] "POST /sites/all/modules/civicrm/extern/ipn.php?reset=1&contactID=9994&contributionID=5667&module=contribute&membershipID=9587 HTTP/1.0" 200 43 173.0.81.1 - - [08/Apr/2016:09:51:28 +0100] "POST /sites/all/modules/civicrm/extern/ipn.php?reset=1&contactID=9994&contributionID=5669&module=contribute&membershipID=9587 HTTP/1.0" 200 43 82.153.198.74 - - [08/Apr/2016:10:03:21 +0100] "GET /sites/all/modules/civicrm/extern/ipn.php?reset=1&contactID=9994&contributionID=5669&module=contribute&membershipID=9587 HTTP/1.1" 200 43  
  
  ---
  
  