Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Couldn't parse #8

Open
kromsam opened this issue Apr 14, 2019 · 3 comments
Open

Error: Couldn't parse #8

kromsam opened this issue Apr 14, 2019 · 3 comments

Comments

@kromsam
Copy link

kromsam commented Apr 14, 2019

Well there hasn't been much activity in this repo. But I'll give it a try and ask a question.

I have been able to get the server running. Filled in the credentials in Thunderbirds and tried some queries. But I keep getting the same error.

bind dc=[domain name of civicrm site], dc=[tld]:[password]
searching 100
[ 'title',
  'sn',
  'surname',
  'mozillahomelocalityname',
  'cn',
  'commonname',
  'givenname',
  'mozillahomestate',
  'mail',
  'mozillaworkurl',
  'workurl',
  'labeleduri',
  'o',
  'company',
  'mozillahomestreet2',
  'mozillanickname',
  'xmozillanickname',
  'mobile',
  'cellphone',
  'carphone',
  'modifytimestamp',
  'nsaimid',
  'nscpaimscreenname',
  'telephonenumber',
  'birthyear',
  'c',
  'countryname',
  'mozillahomestreet',
  'postalcode',
  'zip',
  'mozillacustom1',
  'custom1',
  'mozillahomecountryname',
  'st',
  'region',
  'mozillacustom2',
  'custom2',
  'mozillahomeurl',
  'homeurl',
  'mozillaworkstreet2',
  'mozillasecondemail',
  'xmozillasecondemail',
  'facsimiletelephonenumber',
  'fax',
  'description',
  'notes',
  'mozillacustom3',
  'custom3',
  'homephone',
  'mozillausehtmlmail',
  'xmozillausehtmlmail',
  'birthday',
  'street',
  'streetaddress',
  'postofficebox',
  'mozillacustom4',
  'custom4',
  'l',
  'locality',
  'pager',
  'pagerphone',
  'ou',
  'department',
  'departmentnumber',
  'orgunit',
  'birthmonth',
  'mozillahomepostalcode',
  'objectclass' ]
query DN = dc=[domain name of civicrm site], dc=[tld] sub / And
(&(|(cn=*ldap*)(givenname=*ldap*)(sn=*ldap*)(mozillanickname=*ldap*)(mail=*ldap*)(mozillasecondemail=*ldap*)(&(description=*ldap*))(o=*ldap*)(ou=*ldap*)(title=*ldap*)(mozillaworkurl=*ldap*)(mozillahomeurl=*ldap*)))-> searching And for ldap
searching ldap
civicrm_contact_search failed: couldn't parse {"is_error":0,"undefined_fields":["contact_is_deleted","cms","contact_type","sort_name"],"version":3,"count":1,"id":5,"values":[{"contact_id":"5","sort_name":"API, LDAP","display_name":"LDAP API","contact_type":"Individual","first_name":"LDAP","last_name":"API","job_title":"","organization_name":"","contact_is_deleted":"0","current_employer":"","address_id":"","street_address":"","supplemental_address_1":"","city":"","postal_code":"","state_province_id":"","country_id":"","phone_id":"","phone_type_id":"","phone":"","email_id":"","email":"","state_province_name":"","state_province":"","country":"","id":"5"}]}
civicrm_contact_search failed: unknown error

So. It actually manages to get a good search result. But somehow it isn't able to send it to Thunderbird. Maybe I'm missing out something obvious! Hope you can give me some advice, after all these years.

All the best,

@tttp
Copy link
Member

tttp commented May 1, 2019

Hi,

It seems that the error is on the api client node module, that can't properly parse the json sent by the server... that seems to be valid json!

Are you in the mood of debuging and log what's exactly in the body returned?

https://github.com/TechToThePeople/node-civicrm/blob/master/civicrm.js#L114

  "values": [
    {
      "contact_id": "5",
      "sort_name": "API, LDAP",
      "display_name": "LDAP API",
      "contact_type": "Individual",
      "first_name": "LDAP",
      "last_name": "API",
      "job_title": "",
      "organization_name": "",
      "contact_is_deleted": "0",
      "current_employer": "",
      "address_id": "",
      "street_address": "",
      "supplemental_address_1": "",
      "city": "",
      "postal_code": "",
      "state_province_id": "",
      "country_id": "",
      "phone_id": "",
      "phone_type_id": "",
      "phone": "",
      "email_id": "",
      "email": "",
      "state_province_name": "",
      "state_province": "",
      "country": "",
      "id": "5"
    }
  ]

@kromsam
Copy link
Author

kromsam commented May 1, 2019

Hi Xavier,

Thank you so much for answering me, I'm not very savvy in all this but I think I'll could work it out eventually. So I got some questions:

  • Do I also need to install node-civicrm to make LDAPcivi work?
  • Could this have something to do with what I filled in in the config of the server / Thunderbird?
  • How and what could I debug? (By filling in one complete contact and see what it returns?)

I'll try out some things and will return with my findings.

Kind regards,

@tttp
Copy link
Member

tttp commented May 1, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants