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 »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Could not find a valid key error on Add/Update/Delete Contacts
Pages: [1]

Author Topic: Could not find a valid key error on Add/Update/Delete Contacts  (Read 2482 times)

gturnbull

  • Guest
Could not find a valid key error on Add/Update/Delete Contacts
June 11, 2010, 04:29:15 pm
I installed civiCRM 3.1.5 on Drupal 6.17 (on a Windows XP SP3 with IIS 5.1 server) and am getting the following error when I attempt to add/update or delete contacts:

Sorry. A non-recoverable error has occurred.
We can't load the requested web page. This page requires cookies to be enabled in your browser settings. Please check this setting and enable cookies (if they are not enabled). Then try again. If this error persists, contact the site adminstrator for assistance.

Error type: Could not find a valid key.

I have checked the following settings:
1. Checked the base_url variable which is set in the Drupal settings.php and civicrm.settings.php file are the same. Both are set to http://127.0.0.1. The civiCRM url has a trailing slash.
2. Created a user in the Drupal Users table with the uid = 0
3. Checked the charachter set of the Drupal Sessions table is utf8 and the Collation type is utf8_general_ci
4. Cleared the Drupal cache by going to admin/performance and clicking the 'Clear cached data' button.
5. Cleared the civiCRM cache by deleteing the contents of the civicrm_cach table.
6. I have entered a 16 bit alpha numeric value for the civicrm_site_key variable in the civicrm_setting.php file located in the sites/default directory (ie replaced te null value with a value in single brackets)
7. I have tried installing with two seperate databases (one for Drupal, one for civiCRM) and one database (just Drupal with the civiCRM tables built there)

Other civiCRM modules are working, but the Contacts module just won't add, update or delete without choking.

Please help - Any tips or advice would be welcome.

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Could not find a valid key error on Add/Update/Delete Contacts
June 14, 2010, 04:31:13 am
Quote from: gturnbull on June 11, 2010, 04:29:15 pm
I installed civiCRM 3.1.5 on Drupal 6.17 (on a Windows XP SP3 with IIS 5.1 server) and am getting the following error when I attempt to add/update or delete contacts:

Sorry. A non-recoverable error has occurred.
We can't load the requested web page. This page requires cookies to be enabled in your browser settings. Please check this setting and enable cookies (if they are not enabled). Then try again. If this error persists, contact the site adminstrator for assistance.

Can you try logging out and back into Drupal? (Maybe your Drupal user does not have a counterpart CiviCRM contact…)
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

gturnbull

  • Guest
Re: Could not find a valid key error on Add/Update/Delete Contacts
June 14, 2010, 11:02:41 am
Hi,
Thanks for your response. I have tried logging out and back in, clearing my drupal cache and clearing my web browsers cache. Nothing seems to help.

Is anyone else running civiCRM on Drupal with a Windows server (IIS 5.1) and getting the same problem?

Again - Any advice is welcome.

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Could not find a valid key error on Add/Update/Delete Contacts
June 15, 2010, 09:29:38 am
Quote from: gturnbull on June 11, 2010, 04:29:15 pm
2. Created a user in the Drupal Users table with the uid = 0

Is this the Drupal user that you log in with? Does it have a counterpart CiviCRM contact? What exactly does not work when you say ‘Contacts module just won’t add, update or delete without choking’? Can ‘your’ CiviCRM user become an event participant, for example?
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

gturnbull

  • Guest
Re: Could not find a valid key error on Add/Update/Delete Contacts
June 15, 2010, 10:08:52 am
Hi,
Thanks for getting back to me. I am not logging in using the uid=0 user. My understanding is that this user is for anonymous log ins which I understand to be users who have not logged in at all.

I am logging in as the site administrator and this user does have a counterpart in the civiCRM contact table.

I am able to add, update or delete contacts but I receive the 'Could not find a valid key' error each time I do so. It is as though the add, update or delete operation is choking on the page call back function which should return the user to current page and display the confirmation message saying 'The contact has been successfully added/updated or deleted'.

I do not have clean urls turned on. Could this be the problem?

Thanks for your help.

gturnbull

  • Guest
Re: Could not find a valid key error on Add/Update/Delete Contacts
June 15, 2010, 02:36:10 pm
Hi,
Just tested my site. Yes, I am able to register my civiCRM user for an event without any problems or error messages.

The 'a valid key can not be found' error message appears only when I add, update or delete contacts in civiCRM.

Thanks,


Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Could not find a valid key error on Add/Update/Delete Contacts
June 16, 2010, 02:26:17 am
Quote from: gturnbull on June 15, 2010, 02:36:10 pm
The 'a valid key can not be found' error message appears only when I add, update or delete contacts in civiCRM.

Hm, the ‘Error type: Could not find a valid key.’ text is only in one place in CiviCRM (CRM/Core/Controller.php) and it signals that for some reason the QuickForm key (the qfKey variable) was not submitted along with the form; this would suggest that there might be something wrong with your IIS/PHP stack. You can check (by viewing the HTML source of the page before submitting) whether such an element exist (just search for the qfKey string).
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Could not find a valid key error on Add/Update/Delete Contacts
June 16, 2010, 07:54:23 am

can u copy and paste the url's when you get to the edit page AND after you hit submit (i.e. when u get the error)

replace your hostname in the above urls with the same string HOSTNAME in both urls

thanx


lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

joyinmudville

  • Guest
Re: Could not find a valid key error on Add/Update/Delete Contacts
July 05, 2010, 08:28:43 am
Did you ever figure out this error? I am having the same problem.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Could not find a valid key error on Add/Update/Delete Contacts

This forum was archived on 2017-11-26.