ArcadeData / arcadedb

ArcadeDB Multi-Model Database, one DBMS that supports SQL, Cypher, Gremlin, HTTP/JSON, MongoDB and Redis. ArcadeDB is a conceptual fork of OrientDB, the first Multi-Model DBMS. ArcadeDB supports Vector Embeddings.
https://arcadedb.com
Apache License 2.0
505 stars 63 forks source link

Can not connect to imported database from Console (as suggested in the tutorial) #270

Closed hielsnoppe closed 2 years ago

hielsnoppe commented 2 years ago

ArcadeDB Version: v21.12.1-SNAPSHOT

JDK Version: Docker arcadedata/arcadedb:latest

OS: Docker arcadedata/arcadedb:latest

Expected behavior

ArcadeDB Console v.21.12.1-SNAPSHOT - Copyrights (c) 2021 Arcade Data Ltd (https://arcadedb.com)

> connect ../databases/Imported

{Imported}>

Actual behavior

ArcadeDB Console v.21.12.1-SNAPSHOT - Copyrights (c) 2021 Arcade Data Ltd (https://arcadedb.com)

> connect ../databases/Imported

Error: Error on creating new database instance

Steps to reproduce

Run the following to start the ArcadeDB container:

docker run --rm \
    -p 2480:2480 -p 2424:2424 \
    -e arcadedb.server.rootPassword=playwithdata \
    -e "arcadedb.server.defaultDatabases=Imported[root]{import:https://github.com/ArcadeData/arcadedb-datasets/raw/main/orientdb/OpenBeer.gz}" \
    arcadedata/arcadedb:latest

Run the following to get the container ID:

docker ps

Run the following to open the ArcadeDB Console:

docker exec -it [YOUR_CONTAINER_ID] bin/console.sh

In the console enter:

connect ../databases/Imported

The data is imported correctly and accessible from the web interface. The path seems correct as it is reported on startup by the server - you can find your new ArcadeDB database in '../databases/Imported' and other, non-existing paths raise a different exception.

lvca commented 2 years ago

@hielsnoppe I think the path is not correct. If you run the console from the ArcadeDB root directory with bin/console.sh, then try opening the database with connect databases/Imported.

hielsnoppe commented 2 years ago

Thanks for the quick response! Unfortunately this does not solve the issue:

ArcadeDB Console v.21.12.1-SNAPSHOT - Copyrights (c) 2021 Arcade Data Ltd (https://arcadedb.com)

> connect databases/Imported

Error: Database 'databases/Imported' not exists
lvca commented 2 years ago

Reproduced.

lvca commented 2 years ago

The issue is that the database is open by the server, so the console can't access in embedded mode (file locked).

While I'm improving the error output on this, try this:

connect remote:localhost/Imported root playwithdata
hielsnoppe commented 2 years ago

Thanks Luca! This gets me one step further, but results in another error:

ArcadeDB Console v.21.12.1-SNAPSHOT - Copyrights (c) 2021 Arcade Data Ltd (https://arcadedb.com)

> connect remote:localhost/Imported root playwithdata

Connected

> info types

AVAILABLE TYPES
Error: Error on executing remote operation command (cause:com.arcadedb.exception.DatabaseIsClosedException)
lvca commented 2 years ago

@hielsnoppe I'm unable to reproduce it. Tested with and without docker, works all the times:

/home/arcadedb # bin/console.sh
ArcadeDB Console v.22.1.1-SNAPSHOT - Copyrights (c) 2021 Arcade Data Ltd (https://arcadedb.com)

> connect remote:localhost/Imported root playwithdata

Connected

> info types

AVAILABLE TYPES
+----+------------------------------------------------------------------------------------------------------+-----------+-----------+------+--------------------------------+
|#   |indexes                                                                                               |parentTypes|name       |type  |properties                      |
+----+------------------------------------------------------------------------------------------------------+-----------+-----------+------+--------------------------------+
|0   |1[{unique=true, name=Beer[id], typeName=Beer, automatic=true, type=LSM_TREE, properties=[id]}]        |0[]        |Beer       |vertex|1[{name=id, id=0, type=INTEGER}]|
|1   |1[{unique=true, name=Brewery[id], typeName=Brewery, automatic=true, type=LSM_TREE, properties=[id]}]  |0[]        |Brewery    |vertex|1[{name=id, id=0, type=INTEGER}]|
|2   |1[{unique=true, name=Category[id], typeName=Category, automatic=true, type=LSM_TREE, properties=[id]}]|0[]        |Category   |vertex|1[{name=id, id=0, type=INTEGER}]|
|3   |0[]                                                                                                   |0[]        |HasBrewery |edge  |0[]                             |
|4   |0[]                                                                                                   |0[]        |HasCategory|edge  |0[]                             |
|5   |0[]                                                                                                   |0[]        |HasStyle   |edge  |0[]                             |
|6   |1[{unique=true, name=Style[id], typeName=Style, automatic=true, type=LSM_TREE, properties=[id]}]      |0[]        |Style      |vertex|1[{name=id, id=0, type=INTEGER}]|
+----+------------------------------------------------------------------------------------------------------+-----------+-----------+------+--------------------------------+
Command executed in 87ms
>

That exception is related to the remote database instance that has been closed. Did you execute any other commands between the connect and the info types?

lvca commented 2 years ago

@hielsnoppe I guess there was another OrientDB instance running on your computer, so the new server got 2481 port. Could you please check that out? Also, please get the latest main version where I pushed some improvements to the console usability.

hielsnoppe commented 2 years ago

Not sure why, but now it works. I only ever ran OrientDB and ArcadeDB via Docker and I checked that there are no running containers left, but I might have missed something. Thanks for your help!