Can't connect with remote control

More
1 month 2 weeks ago #216009 by LarryMartell
I have an instance of lime where I cannot connect with the remote control API. I can connect to the survey and the RC URL works from the browser. But from my python code:

requests.post(url, headers=headers, data=data)
*** requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

(Pdb) url
'foo.com/index.php?r=admin/remotecontrol'
(Pdb) data
'{"method": "get_session_key", "params": {"username": "xxxx", "password": "xxxx"}, "id": 1}'

I have other instances of lime where this all works. What would make it close the connection? How can I debug this? Where could I look to get more details on what lime is doing?
 

Please Log in to join the conversation.

More
1 month 2 weeks ago #216029 by DenisChenu
Did you activate remote control ?
Maybe server is disallowed to call this url.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.

Please Log in to join the conversation.

More
1 month 2 weeks ago #216042 by LarryMartell
If it go to foo.com/?r=admin/remotecontrol I get a page with the list of RC functions and it displays:

RemoteControl is available using json for transport and exposes the following functionality:

Does that mean that it's enabled?

Please Log in to join the conversation.

More
1 month 2 weeks ago #216044 by DenisChenu
Yes, it means is activated.

Maybe just try a "file_get_content" for starting

gist.github.com/TwinProduction/8e8f928e5b0431e96b60d2caca40556d

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.

Please Log in to join the conversation.

More
1 month 2 weeks ago #216046 by davebostockgmail
I had an issue with remote control via PHP .. not sure if it is the same with Python.

It turns out that the JSON RPC client does not work well with self certified SSL websites .. this meant that I could see the correct page at the Remote Control admin page but the act of interacting with the API would throw an error.

This took some time figure out as I tried everything I could think of including turning off all the Firewall rules to see if it was a data routing issue and going as far as to do a full reinstall of LimeSurvey to try to fix it.... it turns out that to correct my issue I had to add the following line into the jsonRPCClient.php file found in /application/libraries 

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);

inserted at the section around line 158 in that file.

Once I added in this line of code then the Remote control worked as expected.

I have no idea why it doesnt like self certified SSL but I hope this helps as it was one of the things that was extremely frustrating

Please Log in to join the conversation.

More
1 month 2 weeks ago #216049 by DenisChenu

I have no idea why it doesnt like self certified SSL but I hope this helps as it was one of the things that was extremely frustrating
 

Not realted to jsonRPC or anything else.

PHP curl doesn't like self cerified SSL, because : it's not secure.
 

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.

Please Log in to join the conversation.

More
1 month 2 weeks ago - 1 month 1 week ago #216076 by davebostockgmail

I have no idea why it doesnt like self certified SSL but I hope this helps as it was one of the things that was extremely frustrating



 

Not realted to jsonRPC or anything else.

PHP curl doesn't like self cerified SSL, because : it's not secure.

I understand this now ... but it was the reason that the API would not work for me and I could not find this documented anywhere as to what the issue may be. 

I know we will not be the only site using self certification and Limesurvey so I thought it would be a good idea to share the issue we had and the resolution and see if it helped in this case.
Last edit: 1 month 1 week ago by DenisChenu. Reason: [/quote]

Please Log in to join the conversation.

More
1 month 1 week ago #216102 by DenisChenu

I know we will not be the only site using self certification and Limesurvey so I thought it would be a good idea to share the issue we had and the resolution and see if it helped in this case.
 

Oh yes : good idea to share , thank you.

My sentence was just about « have no idea why it doesnt like self certified SSL» :)

Else : if you can update our manual : manual.limesurvey.org/RemoteControl_2_API#Setup

Maybe add a subtitle about certificate issue ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now