system
April 27, 2018, 8:29pm
1
Migrated from Redmine #153 | Author: Tavan Eftekhar
Status: Closed | Priority: High, I’m very impatient | Created: 2018-04-27
Not sure what changed or what’s causing this issue, as it worked fine for months until this morning. The error being thrown is:
[27-Apr-2018 15:20:03 America/Chicago] PHP Fatal error: Uncaught exception ‘Exception’ with message 'Incorrect response id (request id: 1, response id: )
Response: ’ in /home/clarityclinic/public_html/wp-content/themes/docdirect-child/JsonRpcClient.php:54
Stack trace:
#0 /home/clarityclinic/public_html/wp-content/themes/docdirect-child/directory/templates/map-search-top.php(29): JsonRpcClient->__call(‘getToken’, Array)
Any help would be appreciated!
system
April 27, 2018, 9:38pm
2
Redmine Admin wrote:
it seems your plugins got swithced ow (could because of expired payent), password changed or auth key changed.
system
April 27, 2018, 9:45pm
3
Tavan Eftekhar wrote:
Redmine Admin wrote:
it seems your plugins got swithced ow (could because of expired payent), password changed or auth key changed.
Is there something I need to do to fix it? I didn’t reset my API keys, and I didn’t change my account password. Any more information would be greatly appreciated, thank you!
system
April 27, 2018, 9:49pm
4
Redmine Admin wrote:
please provide your company login and raw http request body
system
April 27, 2018, 9:58pm
5
Tavan Eftekhar wrote:
I’m not sure about the raw request, as I use PHP to connect to the API as instructed in the API documentation:
$loginClientRiverNorth = new JsonRpcClient('https://user-api.simplybook.me' . '/login/');
$tokenRiverNorth = $loginClientRiverNorth->getToken('clarityclinic', '3d6e0c0b4615f21ceb2a4a7e5c8d2a1e35b7585af22863f940bf56f17d217d9f');
$clientRiverNorth = new JsonRpcClient('https://user-api.simplybook.me' . '/', array(
'headers' => array(
'X-Company-Login: ' . 'clarityclinic',
'X-Token: ' . $tokenRiverNorth
)
));
As you can see above, the company login is clarityclinic. The above getToken request is throwing the error (when it worked for months without issue).
Thanks for your help!
system
April 27, 2018, 10:07pm
6
Redmine Admin wrote:
this is not raw http request, so can’t tell you 100% sure because we do not see your code. Looks like you did some changes in JsonRpcClient.php
tried this code and it works fine for me
<?php
require_once 'JsonRpcClient.php';
try {
$loginClient = new JsonRpcClient('https://user-api.simplybook.me' . '/login/');
$token = $loginClient->getToken('clarityclinic', '3d6e0c0b4615f21ceb2a4a7e5c8d2a1e35b7585af22863f940bf56f17d217d9f');
$client = new JsonRpcClient('https://user-api.simplybook.me' . '/', array(
'headers' => array(
'X-Company-Login: ' . 'clarityclinic',
'X-Token: ' . $token
)
));
} catch (Exception $e) {
var_dump($e);
exit();
}
$res = $client->getEventList();
var_dump($res);
system
April 27, 2018, 10:18pm
7
Tavan Eftekhar wrote:
I haven’t changed JsonRpcClient.php, and I redownloaded it from the API documentation just to be sure. When I use the code you gave on my website it shows the following error:
object(Exception)#2133 (7) { [“message”:protected]=> string(64) "Incorrect response id (request id: 1, response id: ) Response: " [“string”:“Exception”:private]=> string(0) “” [“code”:protected]=> int(0) [“file”:protected]=> string(83) “/home/clarityclinic/public_html/wp-content/themes/docdirect-child/JsonRpcClient.php” [“line”:protected]=> int(54) [“trace”:“Exception”:private]=> array(6) { [0]=> array(6) { [“file”]=> string(104) “/home/clarityclinic/public_html/wp-content/themes/docdirect-child/directory/templates/map-search-top.php” [“line”]=> int(49) [“function”]=> string(6) “__call” [“class”]=> string(13) “JsonRpcClient” [“type”]=> string(2) “->” [“args”]=> array(2) { [0]=> string(8) “getToken” [1]=> array(2) { [0]=> string(13) “clarityclinic” [1]=> string(64) “3d6e0c0b4615f21ceb2a4a7e5c8d2a1e35b7585af22863f940bf56f17d217d9f” } } } [1]=> array(6) { [“file”]=> string(104) “/home/clarityclinic/public_html/wp-content/themes/docdirect-child/directory/templates/map-search-top.php” [“line”]=> int(49) [“function”]=> string(8) “getToken” [“class”]=> string(13) “JsonRpcClient” [“type”]=> string(2) “->” [“args”]=> array(2) { [0]=> string(13) “clarityclinic” [1]=> string(64) “3d6e0c0b4615f21ceb2a4a7e5c8d2a1e35b7585af22863f940bf56f17d217d9f” } } [2]=> array(4) { [“file”]=> string(91) “/home/clarityclinic/public_html/wp-content/themes/docdirect-child/directory/user_search.php” [“line”]=> int(1084) [“args”]=> array(1) { [0]=> string(104) “/home/clarityclinic/public_html/wp-content/themes/docdirect-child/directory/templates/map-search-top.php” } [“function”]=> string(7) “include” } [3]=> array(4) { [“file”]=> string(63) “/home/clarityclinic/public_html/wp-includes/template-loader.php” [“line”]=> int(74) [“args”]=> array(1) { [0]=> string(91) “/home/clarityclinic/public_html/wp-content/themes/docdirect-child/directory/user_search.php” } [“function”]=> string(7) “include” } [4]=> array(4) { [“file”]=> string(50) “/home/clarityclinic/public_html/wp-blog-header.php” [“line”]=> int(19) [“args”]=> array(1) { [0]=> string(63) “/home/clarityclinic/public_html/wp-includes/template-loader.php” } [“function”]=> string(12) “require_once” } [5]=> array(4) { [“file”]=> string(41) “/home/clarityclinic/public_html/index.php” [“line”]=> int(17) [“args”]=> array(1) { [0]=> string(50) “/home/clarityclinic/public_html/wp-blog-header.php” } [“function”]=> string(7) “require” } } [“previous”:“Exception”:private]=> NULL }
system
April 27, 2018, 10:34pm
8
Tavan Eftekhar wrote:
I tested it on another server and it seems to work… Any idea what could be an issue with one web server that would cause it to fail (same code and same jsonrpc file)? I’m not really sure how to fix the issue. Any help would be greatly appreciated thank you!
system
April 27, 2018, 10:50pm
9
Redmine Admin wrote:
it could be related to php version installed on your server.
system
April 27, 2018, 11:00pm
10
Tavan Eftekhar wrote:
PHP version is 5.4.45. Any idea if that’s high enough for JSON-RPC? It was working for months, seems odd to matter. Also the response is the following:
object(Exception)#2 (7) {
["message":protected]=>
string(64) "Incorrect response id (request id: 1, response id: )
Response: "
["string":"Exception":private]=>
string(0) ""
["code":protected]=>
int(0)
["file":protected]=>
string(49) "/home/clarityclinic/public_html/JsonRpcClient.php"
["line":protected]=>
int(54)
["trace":"Exception":private]=>
array(2) {
[0]=>
array(6) {
["file"]=>
string(44) "/home/clarityclinic/public_html/jsontest.php"
["line"]=>
int(7)
["function"]=>
string(6) "__call"
["class"]=>
string(13) "JsonRpcClient"
["type"]=>
string(2) "->"
["args"]=>
array(2) {
[0]=>
string(8) "getToken"
[1]=>
array(2) {
[0]=>
string(13) "clarityclinic"
[1]=>
string(64) "3d6e0c0b4615f21ceb2a4a7e5c8d2a1e35b7585af22863f940bf56f17d217d9f"
}
}
}
[1]=>
array(6) {
["file"]=>
string(44) "/home/clarityclinic/public_html/jsontest.php"
["line"]=>
int(7)
["function"]=>
string(8) "getToken"
["class"]=>
string(13) "JsonRpcClient"
["type"]=>
string(2) "->"
["args"]=>
array(2) {
[0]=>
string(13) "clarityclinic"
[1]=>
string(64) "3d6e0c0b4615f21ceb2a4a7e5c8d2a1e35b7585af22863f940bf56f17d217d9f"
}
}
}
["previous":"Exception":private]=>
NULL
}