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) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • "Non-recoverable error" from REST calls.
Pages: [1]

Author Topic: "Non-recoverable error" from REST calls.  (Read 1903 times)

qiemem

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.0
  • CMS version: Drupal 7.2
  • MySQL version: 5.0.77
  • PHP version: 5.2.6
"Non-recoverable error" from REST calls.
June 15, 2011, 10:45:42 am
I've successfully logged in via REST, but whenever I try another REST call such as (sorry for the mangled url):
http:// sub. domain. org/sites/all/modules/civicrm/extern/rest.php?q=civicrm/contact/search&json=1&PHPSESSID=<phpsessid>&key=<site_key>

I get html (not json) that states
Quote
Sorry. A non-recoverable error has occurred.
We experienced an unexpected error. Please post a detailed description and the backtrace on the CiviCRM forums: http://forum.civicrm.org/

with the following traceback in my error logs:

[Wed Jun 15 10:21:54 2011] [error] [client 70.96.69.130] PHP Notice:  Trying to get property of non-object in /path/to/drupal/sites/all/modules/civicrm/CRM/Utils/System/Drupal.php on line 304
[Wed Jun 15 10:21:54 2011] [error] [client 70.96.69.130] PHP Notice:  Trying to get property of non-object in /path/to/drupal/sites/all/modules/civicrm/CRM/Utils/System/Drupal.php on line 305
[Wed Jun 15 10:21:54 2011] [error] [client 70.96.69.130] PHP Notice:  Trying to get property of non-object in /path/to/drupal/sites/all/modules/civicrm/CRM/Utils/System/Drupal.php on line 306
[Wed Jun 15 10:21:54 2011] [error] [client 70.96.69.130] PHP Notice:  Trying to get property of non-object in /path/to/drupal/sites/all/modules/civicrm/CRM/Utils/System/Drupal.php on line 309
[Wed Jun 15 10:21:54 2011] [error] [client 70.96.69.130] PHP Notice:  Undefined offset:  0 in /path/to/drupal/sites/all/modules/civicrm/CRM/Core/I18n/PseudoConstant.php on line 59


Also, I was under the impression one was to fill in their api key (as specified in the db) for key after login, but I would always get "Could not authenticate user, invalid site key." when using the api key.

Did I misconfigure something?

Thanks!

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: "Non-recoverable error" from REST calls.
June 15, 2011, 11:13:04 pm
Hi,

I *think* it has been fixed on 4.0.2 Erik, have you used the rest interface on a recent install?

Try to enable debug+backtrace on civicrm, see if it comes up with more info.
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: "Non-recoverable error" from REST calls.
June 16, 2011, 06:24:18 am
I have not used the REST interface on 4.02 but I will give it a try :-)
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: "Non-recoverable error" from REST calls.
June 16, 2011, 06:59:47 am
I have just tested the REST with CiviCRM 4.0.1 and it works fine? I get results with
Quote
http://localhost/speel7/sites/all/modules/civicrm/extern/rest.php?q=civicrm/contact/search&key=<sitekey>&api_key=testapi&json=1

but NOT when I use the PHPSESSID rather than the api_key. I get the same error if I use that. I will raise an issue and check with 4.02.
qiemem, can you use the api_key? (and you need to enter both the site key and the api key as in my example).
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

qiemem

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.0
  • CMS version: Drupal 7.2
  • MySQL version: 5.0.77
  • PHP version: 5.2.6
Re: "Non-recoverable error" from REST calls.
June 16, 2011, 11:54:44 am
Quote from: Erik Hommel
qiemem, can you use the api_key? (and you need to enter both the site key and the api key as in my example).

Works perfect when using the api_key. Thanks!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • "Non-recoverable error" from REST calls.

This forum was archived on 2017-11-26.