CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute »
  • Community Contributed Payment Processors »
  • Authorize.net "Could not find an entry for x_subscription_id in POST" errors
Pages: [1]

Author Topic: Authorize.net "Could not find an entry for x_subscription_id in POST" errors  (Read 9505 times)

ehendricks

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
  • CiviCRM version: 4.5.8
  • CMS version: Drupal 7.35
  • MySQL version: 5.5
  • PHP version: 5.4.23
Authorize.net "Could not find an entry for x_subscription_id in POST" errors
January 07, 2015, 02:58:19 pm
Drupal 7.34 and CiviCRM 4.5.5

I've searched to see if this has been reported but I didn't find anything that looked like the issue we are having.

We have a client that has both recurring and non-recurring payments.  The error "Could not find an entry for x_subscription_id in POST" has been in their logs for at least the last year, maybe longer.  In the logs its an [info] entry.  I have tracked it down to the AuthrizeNetIPN.php file in the retrieve function, line 330.  Its looking for a subscription ID and when the IPN isn't for a subscription, it logs the message, no biggie.

However, since upgrading to 4.5.5 we are getting a "Sorry but we are unable to provide at this moment/DB Error: syntax error" displayed to the user when a non-recurring payment is made.  Though, I'm not totally sure its only for the one time payments.  That's the one I heard about.

It seems the payment is processed just fine even with the displayed error message.  From what I understand this code is for processing the Silent Posts from Authorize.net and its a duplicate for one time payments so that makes sense.  But its not good plus users are making duplicate payments because of the error.  This issue may or may not be related to this one: https://issues.civicrm.org/jira/browse/CRM-15621.

Thanks very much for any assistance/insight.

Ellen


(Looking at the code I noticed that the retrieve function is called twice for the x_subscription_id parameter, once as type String and once as type Integer.  It seems, looking at where the error is, that the call with type String passes and type Integer fails.  Don't know if this is relevant.)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Authorize.net "Could not find an entry for x_subscription_id in POST" errors
January 07, 2015, 03:43:17 pm

Quote
(Looking at the code I noticed that the retrieve function is called twice for the x_subscription_id parameter, once as type String and once as type Integer.  It seems, looking at where the error is, that the call with type String passes and type Integer fails.  Don't know if this is relevant.)

Definitely remove the time where it checks it for integer.

Do you have any backtraces in your log files?
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

ehendricks

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
  • CiviCRM version: 4.5.8
  • CMS version: Drupal 7.35
  • MySQL version: 5.5
  • PHP version: 5.4.23
Re: Authorize.net "Could not find an entry for x_subscription_id in POST" errors
January 08, 2015, 07:31:23 am
Yes, here's the back trace, I apologize, should have included this initially:


Jan 01 11:15:11  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] =>
SELECT *
FROM   civicrm_membership_type
        WHERE domain_id = 1 AND id IN ( a:32:{i:1;s:1:"1";i:3;s:1:"1";i:4;s:1:"1";i:5;s:1:"1";i:6;s:1:"1";i:2;s:1:"1";i:7;s:1:"1";i:8;s:1:"1";i:9;s:1:"1";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"1";i:13;s:1:"1";i:14;s:1:"1";i:15;s:1:"1";i:16;s:1:"2";i:17;s:1:"2";i:18;s:1:"2";i:19;s:1:"2";i:20;s:1:"2 );
 [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':32:{i:1;s:1:"1";i:3;s:1:"1";i:4;s:1:"1";i:5;s:1:"1";i:6;s:1:"1";i:2;s:1:"1";i:7' at line 3]
    [type] => DB_Error
    [user_info] =>
SELECT *
FROM   civicrm_membership_type
        WHERE domain_id = 1 AND id IN ( a:32:{i:1;s:1:"1";i:3;s:1:"1";i:4;s:1:"1";i:5;s:1:"1";i:6;s:1:"1";i:2;s:1:"1";i:7;s:1:"1";i:8;s:1:"1";i:9;s:1:"1";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"1";i:13;s:1:"1";i:14;s:1:"1";i:15;s:1:"1";i:16;s:1:"2";i:17;s:1:"2";i:18;s:1:"2";i:19;s:1:"2";i:20;s:1:"2 );
 [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':32:{i:1;s:1:"1";i:3;s:1:"1";i:4;s:1:"1";i:5;s:1:"1";i:6;s:1:"1";i:2;s:1:"1";i:7' at line 3]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="
SELECT *
FROM   civicrm_membership_type
        WHERE domain_id = 1 AND id IN ( a:32:{i:1;s:1:"1";i:3;s:1:"1";i:4;s:1:"1";i:5;s:1:"1";i:6;s:1:"1";i:2;s:1:"1";i:7;s:1:"1";i:8;s:1:"1";i:9;s:1:"1";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"1";i:13;s:1:"1";i:14;s:1:"1";i:15;s:1:"1";i:16;s:1:"2";i:17;s:1:"2";i:18;s:1:"2";i:19;s:1:"2";i:20;s:1:"2 );
 [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':32:{i:1;s:1:"1";i:3;s:1:"1";i:4;s:1:"1";i:5;s:1:"1";i:6;s:1:"1";i:2;s:1:"1";i:7' at line 3]"]
)


Jan 01 11:15:11  [info] $backTrace = #0 /home/fshares/public_html/sites/all/modules/civicrm/CRM/Core/Error.php(239): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /home/fshares/public_html/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /home/fshares/public_html/sites/all/modules/civicrm/packages/DB.php(975): PEAR_Error->PEAR_Error("DB Error: syntax error", -2, 16, (Array:2), "\nSELECT *\nFROM   civicrm_membership_type\n        WHERE domain_id = 1 AND i...")
#4 /home/fshares/public_html/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-2, 16, (Array:2), "\nSELECT *\nFROM   civicrm_membership_type\n        WHERE domain_id = 1 AND i...")
#5 /home/fshares/public_html/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -2, NULL, NULL, "\nSELECT *\nFROM   civicrm_membership_type\n        WHERE domain_id = 1 AND i...", "DB_Error", TRUE)
#6 /home/fshares/public_html/sites/all/modules/civicrm/packages/DB/mysql.php(899): DB_common->raiseError(-2, NULL, NULL, NULL, "1064 ** You have an error in your SQL syntax; check the manual that correspon...")
#7 /home/fshares/public_html/sites/all/modules/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
#8 /home/fshares/public_html/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("\nSELECT *\nFROM   civicrm_membership_type\n        WHERE domain_id = 1 AND i...")
#9 /home/fshares/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php(2442): DB_common->query("\nSELECT *\nFROM   civicrm_membership_type\n        WHERE domain_id = 1 AND i...")
#10 /home/fshares/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php(1634): DB_DataObject->_query("\nSELECT *\nFROM   civicrm_membership_type\n        WHERE domain_id = 1 AND i...")
#11 /home/fshares/public_html/sites/all/modules/civicrm/CRM/Core/DAO.php(325): DB_DataObject->query("\nSELECT *\nFROM   civicrm_membership_type\n        WHERE domain_id = 1 AND i...")
#12 /home/fshares/public_html/sites/all/modules/civicrm/CRM/Core/DAO.php(1116): CRM_Core_DAO->query("\nSELECT *\nFROM   civicrm_membership_type\n        WHERE domain_id = 1 AND i...", TRUE)
#13 /home/fshares/public_html/sites/all/modules/civicrm/CRM/Member/BAO/Membership.php(1912): CRM_Core_DAO::executeQuery("\nSELECT *\nFROM   civicrm_membership_type\n        WHERE domain_id = 1 AND i...")
#14 /home/fshares/public_html/sites/all/modules/civicrm/CRM/Member/BAO/Membership.php(788): CRM_Member_BAO_Membership::buildMembershipTypeValues(Object(CRM_Contribute_Form_Contribution_ThankYou), (Array:1))
#15 /home/fshares/public_html/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/ThankYou.php(165): CRM_Member_BAO_Membership::buildMembershipBlock(Object(CRM_Contribute_Form_Contribution_ThankYou), "2", "99", FALSE, (Array:1), TRUE, NULL)
#16 /home/fshares/public_html/sites/all/modules/civicrm/CRM/Core/Form.php(455): CRM_Contribute_Form_Contribution_ThankYou->buildQuickForm()
#17 /home/fshares/public_html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(93): CRM_Core_Form->buildForm()
#18 /home/fshares/public_html/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Contribute_Form_Contribution_ThankYou), "display")
#19 /home/fshares/public_html/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contribute_Form_Contribution_ThankYou), "display")
#20 /home/fshares/public_html/sites/all/modules/civicrm/CRM/Core/Controller.php(356): HTML_QuickForm_Page->handle("display")
#21 /home/fshares/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(331): CRM_Core_Controller->run((Array:3), NULL)
#22 /home/fshares/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(75): CRM_Core_Invoke::runItem((Array:15))
#23 /home/fshares/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#24 /home/fshares/public_html/sites/all/modules/civicrm/drupal/civicrm.module(457): CRM_Core_Invoke::invoke((Array:3))
#25 [internal function](): civicrm_invoke("contribute", "transact")
#26 /home/fshares/public_html/includes/menu.inc(517): call_user_func_array("civicrm_invoke", (Array:2))
#27 /home/fshares/public_html/index.php(21): menu_execute_active_handler()
#28 {main}


ehendricks

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
  • CiviCRM version: 4.5.8
  • CMS version: Drupal 7.35
  • MySQL version: 5.5
  • PHP version: 5.4.23
Re: Authorize.net "Could not find an entry for x_subscription_id in POST" errors
January 16, 2015, 12:54:58 pm
I figured out this problem and it has nothing to do with authorize.net.  Its a problem with the size and updating of a field in the civicrm_membership_block table.

The field membership_types is a VARCHAR of length 255 which only allows what looks like approximately 19 membership types per membership block.

Also, it seems that field isn't cleared out when the membership block is changed.  We had each type listed individually then we switched it to a price set and it didn't reset this field.  I manually cleared it and its working now.

ehendricks

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
  • CiviCRM version: 4.5.8
  • CMS version: Drupal 7.35
  • MySQL version: 5.5
  • PHP version: 5.4.23
Re: Authorize.net "Could not find an entry for x_subscription_id in POST" errors
January 23, 2015, 05:04:00 pm
The actual fix required that the size of the membership_types field in the civicrm_membership_block table.  The code loads all membership types even if a price set is defined that only uses a subset of the membership types.  This user has 32 membership types and that was way too many for the size of this field.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute »
  • Community Contributed Payment Processors »
  • Authorize.net "Could not find an entry for x_subscription_id in POST" errors

This forum was archived on 2017-11-26.