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 CiviCampaign (Moderators: Kiran Jagtap, xavier) »
  • No valid key for session when using Petition for anonymous users
Pages: [1]

Author Topic: No valid key for session when using Petition for anonymous users  (Read 3778 times)

CatorgHans

  • I post frequently
  • ***
  • Posts: 157
  • Karma: 5
  • CiviCRM version: 4.4
  • CMS version: drupal
No valid key for session when using Petition for anonymous users
June 15, 2013, 02:25:48 pm
I have a "no valid key for session" error when I use a Petition. Only for anonymous users, and they get it when submitting the petition. It does not matter if they have filled it in correctly or if they have left required fields open: after submitting you get the error.

It's an older civicrm that I upgraded.
The version used to be 3.4.1 and I upgraded to 4.3.4 (drupal 6).

The older civicrm also had this error and the new one too.

It's drupal6 and the language is Dutch.

The following is what I get in the logging:
Code: [Select]
jun 15 23:10:41  [info] $Fatal Error Details = Array
(
    [message] => De gevraagde web pagina kan niet geladen worden. De pagina verwacht dat cookies aan staan in de instellingen van je browser. Controleer deze instelling en sta het gebruik van cookies toe (als dat nog niet zo is). Probeer dan opnieuw. Als deze fout weer optreedt, neem dan contact op met de beheerder voor verdere hulp.<br /><br />Beheerders: Deze fout kan een indicatie zijn dat gebruikers deze pagina benaderen via een domein of URL anders dan die als basis-URL geconfigureerd is. VOORBEELD: De basis-URL is http://example.org, maar sommige gebruikers benaderen de pagina via http://www.example.org of een domein-alias zoals http://example.com.<br /><br />Fout type: Er is geen geldige sleutel van de sessie gevonden.
    [code] =>
)


jun 15 23:10:41  [info] $backTrace = #0 /home/aagcorp/domains/dev.aag.nl/public_html/sites/all/modules/civicrm/CRM/Core/Error.php(315): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /home/aagcorp/domains/dev.aag.nl/public_html/sites/all/modules/civicrm/CRM/Core/Controller.php(278): CRM_Core_Error::fatal("De gevraagde web pagina kan niet geladen worden. De pagina verwacht dat cooki...")
#2 /home/aagcorp/domains/dev.aag.nl/public_html/sites/all/modules/civicrm/CRM/Core/Controller.php(186): CRM_Core_Controller->key("CRM_Campaign_Form_Petition_Signature", TRUE, FALSE)
#3 /home/aagcorp/domains/dev.aag.nl/public_html/sites/all/modules/civicrm/CRM/Core/Controller/Simple.php(63): CRM_Core_Controller->__construct("Teken Petitie", TRUE, NULL, "CRM_Campaign_Form_Petition_Signature", FALSE, FALSE)
#4 /home/aagcorp/domains/dev.aag.nl/public_html/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(88): CRM_Core_Controller_Simple->__construct("CRM_Campaign_Form_Petition_Signature", "Teken Petitie", NULL, FALSE, FALSE, FALSE, FALSE)
#5 /home/aagcorp/domains/dev.aag.nl/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(266): CRM_Utils_Wrapper->run("CRM_Campaign_Form_Petition_Signature", "Teken Petitie", NULL)
#6 /home/aagcorp/domains/dev.aag.nl/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(70): CRM_Core_Invoke::runItem((Array:14))
#7 /home/aagcorp/domains/dev.aag.nl/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#8 /home/aagcorp/domains/dev.aag.nl/public_html/sites/all/modules/civicrm/drupal/civicrm.module(354): CRM_Core_Invoke::invoke((Array:3))
#9 [internal function](): civicrm_invoke("petition", "sign")
#10 /home/aagcorp/domains/dev.aag.nl/public_html/includes/menu.inc(348): call_user_func_array("civicrm_invoke", (Array:2))
#11 /home/aagcorp/domains/dev.aag.nl/public_html/index.php(18): menu_execute_active_handler()
#12 {main}


I tried it on demo.civicrm.org, I tried another civicrm with drupal 6 with Dutch language. No other instance I can find has this particular problem.
Off course I deleted all caches and Config.IDS.ini (several times).

Please help me find the cause.

CatorgHans

  • I post frequently
  • ***
  • Posts: 157
  • Karma: 5
  • CiviCRM version: 4.4
  • CMS version: drupal
Re: No valid key for session when using Petition for anonymous users
June 16, 2013, 09:47:45 am
I debugged it until
CRM_Core_Key::privateKey

When you view the form and after you submit the form you should have the same key for this to not happen.
Somehow it is regenerated (differently) before and after the submit (Session did not save??).

Any help still welcome.

CatorgHans

  • I post frequently
  • ***
  • Posts: 157
  • Karma: 5
  • CiviCRM version: 4.4
  • CMS version: drupal
Re: No valid key for session when using Petition for anonymous users
June 26, 2013, 03:53:43 pm
Oh my...
Why do I do that: taking over sites from others.

I have solved the issue.
I hope no-one will ever encounter something like this, but if it happens somewhere ever again, I hope that person finds this thread.

In this case some id**t had deleted uid 0 from the drupal users table...
And then the session (with the qfKey) is not properly stored and/or retrieved, making civicrm form submissions invalid for anonymous users.

So the solution: Add record with uid 0 to drupal users table and it is solved.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: No valid key for session when using Petition for anonymous users
June 26, 2013, 10:43:56 pm
That uid sometimes gets deleted when the database is transferred  or backed up & restored. Some tools don't like having a 0 in what, I think, is an autonumber field
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

CatorgHans

  • I post frequently
  • ***
  • Posts: 157
  • Karma: 5
  • CiviCRM version: 4.4
  • CMS version: drupal
Re: No valid key for session when using Petition for anonymous users
June 27, 2013, 12:23:07 am
Ah, thanks..

That actually makes sense.

The builders of the site have made choices I would never make (that always happens), but have not made mistakes like this and I know the site has been moved from one host to another.

Good that this is in the forum now, other people DO have a chance to run into it then.
« Last Edit: June 27, 2013, 12:44:31 am by CatorgHans »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCampaign (Moderators: Kiran Jagtap, xavier) »
  • No valid key for session when using Petition for anonymous users

This forum was archived on 2017-11-26.