Welcome to the LimeSurvey Community Forum

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

Can't connect with remote control

  • LarryMartell
  • LarryMartell's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 11 months ago #216009 by LarryMartell
Can't connect with remote control was created 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?
 
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #216029 by DenisChenu
Replied by DenisChenu on topic Can't connect with remote control
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.
The topic has been locked.
  • LarryMartell
  • LarryMartell's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 11 months ago #216042 by LarryMartell
Replied by LarryMartell on topic Can't connect with remote control
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?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #216044 by DenisChenu
Replied by DenisChenu on topic Can't connect with remote control
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.
The topic has been locked.
More
2 years 11 months ago #216046 by davebostockgmail
Replied by davebostockgmail on topic Can't connect with remote control
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
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #216049 by DenisChenu
Replied by DenisChenu on topic Can't connect with remote control

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.
The topic has been locked.
More
2 years 11 months ago - 2 years 11 months ago #216076 by davebostockgmail
Replied by davebostockgmail on topic Can't connect with remote control

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: 2 years 11 months ago by DenisChenu. Reason: [/quote]
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #216102 by DenisChenu
Replied by DenisChenu on topic Can't connect with remote control

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.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose