Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

get_session_key throws exception

More
5 years 3 months ago #199491 by debrota
LimeSurvey version
4.2.3
LimeSurvey build
200511

Every time my PHP program reaches this line:

$sSessionKey= $myJSONRPCClient->get_session_key( LS_USER, LS_PASSWORD );


I get:

Fatal error: Uncaught Exception: Incorrect response id (request id: 1, response id: )

in jsonRPCClient.php on line 158


I've tried presenting the password in every way I can think of... as plain text, as the encoded value I find in the lime_users table on the database, etc.

define( 'LS_USER', 'admin' );

define( 'LS_PASSWORD', ' ' );


Any suggestions?

Dave
The topic has been locked.
More
5 years 3 months ago #199499 by DenisChenu
You have plugins maybe ?

Else : can you update your config.php file to create a log file and set debug at 2 ?
www.limesurvey.org/manual/Optional_settings#Logging_settings

(maybe there are an issue in 4.X)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
More
5 years 3 months ago #199527 by debrota
I've not installed any plugins. I set 'debug'=>2 in application/config/config.php file. I didn't uncomment this line:
// 'runtimePath'=>'/var/limesurvey/runtime/'
Do I need to somehow "restart" the LimeSurvey application after modifying config.php?
My PHP program addLSparticipant.PHP still returns exactly the same error message.
I don't know where to look for LimeSurvey application error logs. I can see access logs to my website with POST requests to /limesurvey/index.php/admin/remotecontrol following GET requests to my /limesurvey/admin/addLSparticipant.php file
The topic has been locked.
More
5 years 3 months ago #199529 by DenisChenu

Hint: The file is saved by default to limesurvey/tmp/runtime/application.log, which is located in the LimeSurvey root folder.

I give you hint to get the error …

Since it's hard to see exact error with remote control i give you an advice to have error …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
More
5 years 3 months ago #199538 by debrota
My limesurvey/tmp/runtime directory contains only cache, HTML, and twig_cache directories, and a file index.html
I don't see an "application.log" file there , or in /limesurvey/application/logs folder
The topic has been locked.
More
5 years 3 months ago #199543 by DenisChenu
Did you update your config file with
Code:
'log' => array(
      'routes' => array(
        'fileError' => array(
          'class' => 'CFileLogRoute',
          'levels' => 'warning, error',
          'except' => 'exception.CHttpException.404',
        ),
      ),

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
More
5 years 3 months ago #199550 by debrota

File Attachment:

File Name: config-per....php.txt
File Size:3.05 KB
The topic has been locked.
More
5 years 3 months ago #199551 by debrota
Does it matter that my config.php file is located in limesurvey/config ?
I don't see a limesurvey/application/config folder
Possibly LimeSurvey is not processing my config.php file?
How can I tell if it is?
The topic has been locked.
More
5 years 3 months ago #199554 by DenisChenu
No, the log part must be inside component , it clearly inside the comment in manual …

bin.shnoulle.net/?29c3310f57a972a2#3A5jt...sXLgGphBoo3LwHASo4qz

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
More
5 years 3 months ago #199562 by debrota
OK, I have the 'log' section within 'components'. I still don't see an application.log file.
Please confirm locations in which I should have config.php and should see application.log appear.

I am still getting an exception thrown by jsonRPCClient.php on line 158... an "Uncaught Exception" said to be the result of "Incorrect response id (request id: 1, response id: )"
The topic has been locked.
More
5 years 3 months ago #199569 by DenisChenu
Then, no error from LimeSurvey ???

Did you activate the remote control ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
More
5 years 3 months ago #199576 by debrota
Now something I did has totally broken LimeSurvey. I can't even get the admin screen to come up with my browser directed to:
debrota.com/limesurvey/index.php

Attached is the text in this file.

Also attached is text in:
debrota.com/limesurvey/config/internal.php

I don't recall trying to change either of these files from defaults.

my config.php file in limesurvey/config folder looks basically like the one you sent to me, only with my host and database credentials in it.

When I try to connect to LimeSurvey, I get an error from line 179 of index.php
The topic has been locked.
More
5 years 3 months ago #199583 by DenisChenu
Maybe i made error in my config.php (not closed ) or a , ).

BUt since you are a PHP dev, i think you know how to fix.

Else : here : server issue , not LS issue …

www.php.net/manual/function.require-once.php

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
More
5 years 3 months ago #199603 by debrota
I somehow damaged my LimeSurvey installation and had to do a reinstallation to get it functioning again. I still can't get get_session_key to work. Here's what I get:

Fatal error: Uncaught Exception: Unable to connect to debrota.com/limesurvey/index.php/admin/remotecontrol in /homepages/10/dxxxxxxxxxx/htdocs/debrota/limesurvey/application/libraries/jsonRPCClient.php:145 Stack trace: #0 /homepages/10/dxxxxxxxxx/htdocs/debrota/limesurvey/admin/addLSparticipant.php(24): jsonRPCClient->__call('get_session_key', Array) #1 {main} thrown in /homepages/10/dxxxxxxxxx/htdocs/debrota/limesurvey/application/libraries/jsonRPCClient.php on line 145
The topic has been locked.
More
5 years 3 months ago #199608 by debrota
Small bit of progress... I now see an application.log file in limesurvey/tmp/runtime:

2020/05/19 19:00:51 [error] [exception.CHttpException.400] CHttpException: The CSRF token could not be verified. in /homepages/10/dxxxxxxxxxx/htdocs/debrota/limesurvey/framework/web/CHttpRequest.php:1378
Stack trace:
#0 /homepages/10/dxxxxxxxxx/htdocs/debrota/limesurvey/framework/base/CComponent.php(561): CHttpRequest->validateCsrfToken(Object(CEvent))
#1 /homepages/10/dxxxxxxxxx/htdocs/debrota/limesurvey/framework/base/CApplication.php(212): CComponent->raiseEvent('onbeginrequest', Object(CEvent))
#2 /homepages/10/dxxxxxxxxx/htdocs/debrota/limesurvey/framework/base/CApplication.php(183): CApplication->onBeginRequest(Object(CEvent))
#3 /homepages/10/dxxxxxxxxx/htdocs/debrota/limesurvey/index0.php(182): CApplication->run()
#4 {main}
REQUEST_URI=/limesurvey/index0.php/admin/authentication/sa/login
HTTP_REFERER=https://debrota.com/limesurvey/index0.php/admin/authentication/sa/login
---

Can somebody suggest how I can get past this error?
The topic has been locked.
Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose