Skip to content

Unable to run queries using PostgresProtocolPlugin #215

Closed

Description

@scwagner

ArcadeDB Version: ArcadeDB Server v21.11.1-SNAPSHOT (build a51ac33/1637325918552/main)

JDK Version: openjdk version "11.0.13" 2021-10-19

OS: Alpine Linux v3.14.3

Expected behavior

Connecting using the Postgres official command-line client with the PostgresProtocolPlugin driver install will work.

Actual behavior

Any queries attempted to be run against the database return an error "Error on executing query: null"

Steps to reproduce

Running the latest version of ArcadeDB from Docker Hub:

docker run --pull always -d --rm --name arcadedb -v pwd/data:/home/arcadedb/databases -p 6379:6379 -p 5432:5432 -p 2480:2480 -p 2424:2424 --env arcadedb.server.rootPassword=playwithdata --env arcadedb.server.plugins="Redis:com.arcadedb.redis.RedisProtocolPlugin,Postgres:com.arcadedb.postgres.PostgresProtocolPlugin" arcadedata/arcadedb:latest

Attempting to connect and run a command using official psql command line client:

$ psql -U root -h 127.0.0.1 game_1_0
Password for user root:
psql (10.19 (Ubuntu 10.19-0ubuntu0.18.04.1), server 10.5)
Type "help" for help.

game_1_0=> select from Item;
ERROR: Error on executing query: null

Activity

  1. lvca commented on Nov 19, 2021

    @lvca
    Member

    We used psql client to develop the driver initially, then we switched to the Java official JDBC driver so we can have automatic tests and regression tests, but it looks like the protocol is quite wide and we have to check again with psql what's going on. I guess we have to change slightly the behavior based on the client type.

  2. added this to the 21.11.1 milestone on Nov 19, 2021
  3. lvca commented on Nov 19, 2021

    @lvca
    Member

    From a quick test seems to work with the simple database used for testing Postgres when I'm connecting through psql:

    arcadedb % psql -U root -h 127.0.0.1 postgresdb
    Password for user root:
    psql (14.0, server 10.5)
    Type "help" for help.
    
    postgresdb=> select from schema:types
    postgresdb-> ;
      name  |   type   | parentTypes | properties |     indexes
    --------+----------+-------------+------------+------------------
     E1     | edge     | []          | []         | []
     E2     | edge     | []          | []         | []
     Person | document | []          | []         | []
     V1     | vertex   | []          | [{ id: 0  +| [{ name: V1[id] +
            |          |             | name: id  +| typeName: V1    +
            |          |             | type: LONG+| type: LSM_TREE  +
            |          |             |  }]        | properties: [id]+
            |          |             |            | automatic: true +
            |          |             |            | unique: true    +
            |          |             |            |  }]
     V2     | vertex   | []          | []         | []
    (5 rows)
    
    postgresdb=> select from V1;
     id | name
    ----+------
        | V1
    (1 row)
    
    postgresdb=> select from Person;
    postgresdb=> select from V2;
     name
    ------
     V2
     V3
    (2 rows)
    
    postgresdb=>
    
  4. lvca commented on Nov 19, 2021

    @lvca
    Member

    I was able to reproduce the error. When the query returns many records I got ERROR: Error on executing query: null. If you do the same select with the limit works. So there must be an issue with the management of pagination.

  5. self-assigned this
    on Nov 19, 2021
  6. lvca commented on Nov 19, 2021

    @lvca
    Member

    Fixed by 1dc352a.

  7. lvca commented on Nov 19, 2021

    @lvca
    Member

    @scwagner the issue was with the buffer allocated for sending the result back to the client. Now it's fixed. Thanks for reporting it (and to be a sponsor!).

  8. scwagner commented on Nov 21, 2021

    @scwagner
    Author

    @lvca Thanks I can confirm that with the latest image from Docker Hub I am able to connect with both psql and using JDBC. Thank you for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions