GeezerVison is showing github.com — Console cannot connect to remote database · Issue #27 · ArcadeData/arcadedb
Console cannot connect to remote database #27DescriptionArcadeDB Version: v21.9.1-SNAPSHOT
JDK Version: openjdk version "11.0.2" 2019-01-15
OS: macOS Mojave v.10.14.6
Expected behavior
Console must connect to a remote database
Actual behavior
Console returns the following error:
WARNI [RemoteDatabase] Error on executing command, retrying... (payload=Not Found, error=org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1])
Error: A JSONObject text must begin with '{' at 1 [character 2 line 1]
Steps to reproduce
- Start the server (server.sh)
- Create a database (via Studio)
- Start the console (console.sh)
- Try to connect to the remote database:
> connect remote:127.0.0.1/ciaone root ciaone1234
connect remote:127.0.0.1/ciaone root ciaone1234
2021-09-03 07:52:03.952 WARNI [RemoteDatabase] Error on executing command, retrying... (payload=Not Found, error=org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1])
Error: A JSONObject text must begin with '{' at 1 [character 2 line 1]
>
The problem is that Console doesn't use the API version prefix. It tries to connect to the URL http://127.0.0.1:2480/server instead of http://127.0.0.1:2480/api/v1/server.
See:
|
String url = protocol + "://" + connectToServer.getFirst() + ":" + connectToServer.getSecond() + "/" + operation; |
and:
|
routes.addPrefixPath("/api/v1",// |
At the moment, the fix is trivial, but we should find a way to sync the API version among the projects to avoid a similar problem in the future. Activityadded a commit that references this issue on Sep 3, 2021This issue will close once commit 51e8c02 is merged into the 'main' branch.51e8c02 lvca commented on Sep 3, 2021 @giastfader nice to see you here! We changed the API to be /api/v1 and I guess the RemoteDatabase wasn't updated. I guess some test are missing from it. Thanks for pointing it out. Would you like to send a PR? lvca commented on Sep 3, 2021 Ok that part was covered by IT test on server project and in fact they failed. Fixing it asap. giastfader commented on Sep 3, 2021 ContributorAuthor More actions Hi lvca,
PR is on the way.
BTW the tests (RemoteConsoleIT class) for remote connections are not executed by the test suite.
If I manually execute it, then it hangs indefinitely because the server waits for the root password.
Digging on it, I think I found another bug because the ServerSecurity class does not use the configuration object passed to it but uses the GlobalConfiguration class instead into the createDefaultSecurity() method. lvca commented on Sep 3, 2021 I guess I found the code you're mentioning. Fixed with this commit
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|