- Posts: 38
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Can't connect with remote control
- LarryMartell
- Topic Author
- Offline
- Junior Member
Less
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?
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
- Away
- LimeSurvey Community Team
Less
More
- Posts: 13645
- Thank you received: 2491
2 years 11 months ago #216029
by DenisChenu
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.
Replied by DenisChenu on topic Can't connect with remote control
Did you activate remote control ?
Maybe server is disallowed to call this url.
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
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 38
- Thank you received: 0
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?
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
- Away
- LimeSurvey Community Team
Less
More
- Posts: 13645
- Thank you received: 2491
2 years 11 months ago #216044
by DenisChenu
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.
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
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.
- davebostockgmail
- Offline
- Elite Member
Less
More
- Posts: 166
- Thank you received: 26
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
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
- Away
- LimeSurvey Community Team
Less
More
- Posts: 13645
- Thank you received: 2491
2 years 11 months ago #216049
by DenisChenu
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.
Replied by DenisChenu on topic Can't connect with remote control
Not realted to jsonRPC or anything else.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
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.
- davebostockgmail
- Offline
- Elite Member
Less
More
- Posts: 166
- Thank you received: 26
2 years 11 months ago - 2 years 11 months ago #216076
by davebostockgmail
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.
Replied by davebostockgmail on topic Can't connect with remote control
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.
Not realted to jsonRPC or anything else.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
PHP curl doesn't like self cerified SSL, because : it's not secure.
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
- Away
- LimeSurvey Community Team
Less
More
- Posts: 13645
- Thank you received: 2491
2 years 11 months ago #216102
by DenisChenu
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.
Replied by DenisChenu on topic Can't connect with remote control
Oh yes : good idea to share , thank you.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.
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.