New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does the Java driver 4.0 work with ArangoDB 3.1 RC2? #60

Closed
christian-lechner opened this Issue Oct 18, 2016 · 10 comments

Comments

Projects
None yet
5 participants
@christian-lechner

christian-lechner commented Oct 18, 2016

Hello!

I just switched to the 4.0 Java driver and the RC2 of ArangoDB 3.1. I tried different operations, but the driver stops at the readBytesIntoBuffer method of com.arangodb.internal.velocystream.Connection

protected void readBytesIntoBuffer(final byte[] buf, final int off, final int len) throws IOException {
        for (int readed = 0; readed < len;) {
            final int read = inputStream.read(buf, off + readed, len - readed);
            if (read == -1) {
                throw new IOException("Reached the end of the stream.");
            } else {
                readed += read;
            }
        }
    }

At the final int read = inputStream.read(buf, off + readed, len - readed); line. buf is array with size 16 and initialized with zeroes. off = 0, readed = 0 and len = 16 .

Seems that the inputStream from ArangoDB doesn't return anything.

OS: Windows 8

Any ideas on this issue are appreciated.

@mpv1989

This comment has been minimized.

Show comment
Hide comment
@mpv1989

mpv1989 Oct 19, 2016

Contributor

You have to start the server with an extra endpoint for VelocyStream communication, e.g.
--server.endpoint vpp+tcp://127.0.0.1:8529.
The same for ssl: --server.endpoint vpp+ssl://127.0.0.1:8530

I forgot to mention this in the documentation. Sorry.

Contributor

mpv1989 commented Oct 19, 2016

You have to start the server with an extra endpoint for VelocyStream communication, e.g.
--server.endpoint vpp+tcp://127.0.0.1:8529.
The same for ssl: --server.endpoint vpp+ssl://127.0.0.1:8530

I forgot to mention this in the documentation. Sorry.

@christian-lechner

This comment has been minimized.

Show comment
Hide comment
@christian-lechner

christian-lechner Oct 19, 2016

Thanks for your quick reply!
If I use the --server.endpoint vpp+tcp://127.0.0.1:8529 parameter, I can access the DB with the Java driver, but not the web interface. If I skip the vpp+ part I can access the DB from the web interface, but (of course) not from the Java driver.

christian-lechner commented Oct 19, 2016

Thanks for your quick reply!
If I use the --server.endpoint vpp+tcp://127.0.0.1:8529 parameter, I can access the DB with the Java driver, but not the web interface. If I skip the vpp+ part I can access the DB from the web interface, but (of course) not from the Java driver.

@mpv1989

This comment has been minimized.

Show comment
Hide comment
@mpv1989

mpv1989 Oct 19, 2016

Contributor

You can use both endpoints (one with vpp, one without). You only need two differnt ports. Then you can use both the driver and the web inertface, e.g.

--server.endpoint vpp+tcp://127.0.0.1:8529 --server.endpoint tcp://127.0.0.1:8530

Contributor

mpv1989 commented Oct 19, 2016

You can use both endpoints (one with vpp, one without). You only need two differnt ports. Then you can use both the driver and the web inertface, e.g.

--server.endpoint vpp+tcp://127.0.0.1:8529 --server.endpoint tcp://127.0.0.1:8530

@christian-lechner

This comment has been minimized.

Show comment
Hide comment
@christian-lechner

christian-lechner Oct 19, 2016

Now it works. Thanks!
I tried the following: --server.endpoint tcp://127.0.0.1:8529 --server.endpoint vpp://127.0.0.1:8530 but then ArangoDB crashed ;)

christian-lechner commented Oct 19, 2016

Now it works. Thanks!
I tried the following: --server.endpoint tcp://127.0.0.1:8529 --server.endpoint vpp://127.0.0.1:8530 but then ArangoDB crashed ;)

@mpv1989

This comment has been minimized.

Show comment
Hide comment
@mpv1989

mpv1989 Oct 19, 2016

Contributor

Ok. Thats not really a crash. It just break the startup process and returned the error:
2016-10-19T09:41:53Z [6468] FATAL invalid endpoint 'vpp://127.0.0.1:8529'

I updated our documentation. Thanks!

Contributor

mpv1989 commented Oct 19, 2016

Ok. Thats not really a crash. It just break the startup process and returned the error:
2016-10-19T09:41:53Z [6468] FATAL invalid endpoint 'vpp://127.0.0.1:8529'

I updated our documentation. Thanks!

@christian-lechner

This comment has been minimized.

Show comment
Hide comment
@christian-lechner

christian-lechner Oct 19, 2016

Correct ;)
I started ArangoDB via the services interface of Windows and it reported "process unexpectedly terminated". If I execute it via the command line, I get the more meaningful error message.

christian-lechner commented Oct 19, 2016

Correct ;)
I started ArangoDB via the services interface of Windows and it reported "process unexpectedly terminated". If I execute it via the command line, I get the more meaningful error message.

@servusoft

This comment has been minimized.

Show comment
Hide comment
@servusoft

servusoft Nov 15, 2016

try to use vst+tcp: instead of vpp+tcp:

servusoft commented Nov 15, 2016

try to use vst+tcp: instead of vpp+tcp:

@mpv1989

This comment has been minimized.

Show comment
Hide comment
@mpv1989

mpv1989 Nov 16, 2016

Contributor

with driver version 4.1.0 and above, there is no need for an extra endpoint anymore.

Contributor

mpv1989 commented Nov 16, 2016

with driver version 4.1.0 and above, there is no need for an extra endpoint anymore.

@Simran-B

This comment has been minimized.

Show comment
Hide comment
@Simran-B

Simran-B Nov 17, 2016

Contributor

I started ArangoDB via the services interface of Windows and it reported "process unexpectedly terminated".

I suspect that this generic message is shown on every fatal initialization error that prevents the service from being started. It's not a very nice to do so however, it should rather give you the actual problem description. "Unexpectedly terminated" sounds more like an actual crash.

@dothebart / @fceller: could this be handled slightly more graceful? The following would be more typical for a Windows service that fails to start, accompanied by a ⚠️ warning icon as opposed to a fatal error icon:

The Service1 service could not be started.
The service did not report an error. [or the actual error message could be here]
More help is available ... [instructions / error code that can be looked up]

Contributor

Simran-B commented Nov 17, 2016

I started ArangoDB via the services interface of Windows and it reported "process unexpectedly terminated".

I suspect that this generic message is shown on every fatal initialization error that prevents the service from being started. It's not a very nice to do so however, it should rather give you the actual problem description. "Unexpectedly terminated" sounds more like an actual crash.

@dothebart / @fceller: could this be handled slightly more graceful? The following would be more typical for a Windows service that fails to start, accompanied by a ⚠️ warning icon as opposed to a fatal error icon:

The Service1 service could not be started.
The service did not report an error. [or the actual error message could be here]
More help is available ... [instructions / error code that can be looked up]

@ArangoRaghav

This comment has been minimized.

Show comment
Hide comment
@ArangoRaghav

ArangoRaghav Dec 27, 2016

Hi All,

I also hit the same issue as shown in the below stack:
com.arangodb.ArangoDBException: java.io.IOException: Reached the end of the stream.
at com.arangodb.internal.velocystream.ConnectionSync.write(ConnectionSync.java:111)
at com.arangodb.internal.velocystream.CommunicationSync.send(CommunicationSync.java:137)
at com.arangodb.internal.velocystream.CommunicationSync.execute(CommunicationSync.java:119)
at com.arangodb.internal.velocystream.CommunicationSync.execute(CommunicationSync.java:42)
at com.arangodb.internal.ArangoExecutorSync.execute(ArangoExecutorSync.java:58)
at com.arangodb.ArangoDB.createDatabase(ArangoDB.java:273)
...
...
...
Caused by: java.io.IOException: Reached the end of the stream.
at com.arangodb.internal.velocystream.Connection.readBytesIntoBuffer(Connection.java:212)
at com.arangodb.internal.velocystream.ConnectionSync.write(ConnectionSync.java:107)

My Arangodb version is:
[@@@ sbin]# ./arangod --version
3.0.12
architecture: 64bit
asan: false
asm-crc32: true
boost-version: 1.61.0b1
build-date: YYYY-MM-DD HH:MM:SS
compiler: gcc
cplusplus: 201103
endianness: little
fd-client-event-handler: poll
fd-setsize: 1024
icu-version: 54.1
jemalloc: true
libev-version: 4.22
maintainer-mode: false
openssl-version: OpenSSL 1.0.1e-fips 11 Feb 2013
rocksdb-version: 4.8.0
server-version: 3.0.12
sizeof int: 4
sizeof void*: 8
sse42: false
tcmalloc: false
v8-version: 5.0.71.39
vpack-version: 0.1.30
zlib-version: 1.2.8

Arango java driver used is:

com.arangodb
arangodb-java-driver
4.1.3

When I tried to specify the vpp (velocystream protocol related) command line input to start the arangodb server to solve this issue its not starting (FATAL invalid endpoint issue as shown below).It is starting with tcp endpoint option as expected.
Let me know whether 3.0.12 arango db version has issues related to this vpp/vst acceptance as mentioned.

[@@@ sbin]# ./arangod --server.endpoint tcp://xxx:8529
2016-12-27T09:19:48Z [27191] INFO using SSL options: SSL_OP_CIPHER_SERVER_PREFERENCE, SSL_OP_TLS_ROLLBACK_BUG
2016-12-27T09:19:48Z [27191] INFO file-descriptors (nofiles) hard limit is 4096, soft limit is 1024
2016-12-27T09:19:48Z [27191] INFO ArangoDB 3.0.12 [linux] 64bit, using VPack 0.1.30, ICU 54.1, V8 5.0.71.39, OpenSSL 1.0.1e-fips 11 Feb 2013
2016-12-27T09:19:48Z [27191] INFO loaded database '_system' from '/var/lib/arangodb3/databases/database-1'
2016-12-27T09:19:48Z [27191] INFO loaded database 'testDb' from '/var/lib/arangodb3/databases/database-1289'
2016-12-27T09:19:48Z [27191] INFO the server has 4 (hyper) cores, using 1 scheduler thread(s), 4 dispatcher thread(s)
2016-12-27T09:19:48Z [27191] INFO JavaScript using startup '/usr/share/arangodb3/js', application '/var/lib/arangodb3-apps'
2016-12-27T09:19:49Z [27191] INFO In database 'testDb': Database is up-to-date (30012/standalone/existing)
2016-12-27T09:19:49Z [27191] INFO In database '_system': Database is up-to-date (30012/standalone/existing)
2016-12-27T09:19:49Z [27191] INFO using endpoint 'http+tcp://xxxx:8529' for non-encrypted requests
2016-12-27T09:19:49Z [27191] INFO Authentication is turned off
2016-12-27T09:19:50Z [27191] INFO ArangoDB (version 3.0.12 [linux]) is ready for business. Have fun!

[@@@ sbin]# ./arangod --server.endpoint vpp://xxxx:8529
2016-12-27T09:20:34Z [27425] INFO using SSL options: SSL_OP_CIPHER_SERVER_PREFERENCE, SSL_OP_TLS_ROLLBACK_BUG
2016-12-27T09:20:34Z [27425] FATAL invalid endpoint 'vpp://xxxx:8529'

[@@@ sbin]# ./arangod --server.endpoint tcp+vpp://xxxx:8529
2016-12-27T09:21:11Z [27440] INFO using SSL options: SSL_OP_CIPHER_SERVER_PREFERENCE, SSL_OP_TLS_ROLLBACK_BUG
2016-12-27T09:21:11Z [27440] FATAL invalid endpoint 'tcp+vpp://xxxx:8529'
[@@@ sbin]# ps -ef | grep "arango"
root 27490 21712 0 04:22 pts/4 00:00:00 grep --color=auto arango

[@@@ sbin]# ./arangod --server.endpoint vst+tcp://xxxx:8529
2016-12-27T09:22:39Z [27540] INFO using SSL options: SSL_OP_CIPHER_SERVER_PREFERENCE, SSL_OP_TLS_ROLLBACK_BUG
2016-12-27T09:22:39Z [27540] FATAL invalid endpoint 'vst+tcp://xxxx:8529'
[@@@ sbin]# ps -ef | grep "arango"
root 27652 21712 0 04:24 pts/4 00:00:00 grep --color=auto arango

ArangoRaghav commented Dec 27, 2016

Hi All,

I also hit the same issue as shown in the below stack:
com.arangodb.ArangoDBException: java.io.IOException: Reached the end of the stream.
at com.arangodb.internal.velocystream.ConnectionSync.write(ConnectionSync.java:111)
at com.arangodb.internal.velocystream.CommunicationSync.send(CommunicationSync.java:137)
at com.arangodb.internal.velocystream.CommunicationSync.execute(CommunicationSync.java:119)
at com.arangodb.internal.velocystream.CommunicationSync.execute(CommunicationSync.java:42)
at com.arangodb.internal.ArangoExecutorSync.execute(ArangoExecutorSync.java:58)
at com.arangodb.ArangoDB.createDatabase(ArangoDB.java:273)
...
...
...
Caused by: java.io.IOException: Reached the end of the stream.
at com.arangodb.internal.velocystream.Connection.readBytesIntoBuffer(Connection.java:212)
at com.arangodb.internal.velocystream.ConnectionSync.write(ConnectionSync.java:107)

My Arangodb version is:
[@@@ sbin]# ./arangod --version
3.0.12
architecture: 64bit
asan: false
asm-crc32: true
boost-version: 1.61.0b1
build-date: YYYY-MM-DD HH:MM:SS
compiler: gcc
cplusplus: 201103
endianness: little
fd-client-event-handler: poll
fd-setsize: 1024
icu-version: 54.1
jemalloc: true
libev-version: 4.22
maintainer-mode: false
openssl-version: OpenSSL 1.0.1e-fips 11 Feb 2013
rocksdb-version: 4.8.0
server-version: 3.0.12
sizeof int: 4
sizeof void*: 8
sse42: false
tcmalloc: false
v8-version: 5.0.71.39
vpack-version: 0.1.30
zlib-version: 1.2.8

Arango java driver used is:

com.arangodb
arangodb-java-driver
4.1.3

When I tried to specify the vpp (velocystream protocol related) command line input to start the arangodb server to solve this issue its not starting (FATAL invalid endpoint issue as shown below).It is starting with tcp endpoint option as expected.
Let me know whether 3.0.12 arango db version has issues related to this vpp/vst acceptance as mentioned.

[@@@ sbin]# ./arangod --server.endpoint tcp://xxx:8529
2016-12-27T09:19:48Z [27191] INFO using SSL options: SSL_OP_CIPHER_SERVER_PREFERENCE, SSL_OP_TLS_ROLLBACK_BUG
2016-12-27T09:19:48Z [27191] INFO file-descriptors (nofiles) hard limit is 4096, soft limit is 1024
2016-12-27T09:19:48Z [27191] INFO ArangoDB 3.0.12 [linux] 64bit, using VPack 0.1.30, ICU 54.1, V8 5.0.71.39, OpenSSL 1.0.1e-fips 11 Feb 2013
2016-12-27T09:19:48Z [27191] INFO loaded database '_system' from '/var/lib/arangodb3/databases/database-1'
2016-12-27T09:19:48Z [27191] INFO loaded database 'testDb' from '/var/lib/arangodb3/databases/database-1289'
2016-12-27T09:19:48Z [27191] INFO the server has 4 (hyper) cores, using 1 scheduler thread(s), 4 dispatcher thread(s)
2016-12-27T09:19:48Z [27191] INFO JavaScript using startup '/usr/share/arangodb3/js', application '/var/lib/arangodb3-apps'
2016-12-27T09:19:49Z [27191] INFO In database 'testDb': Database is up-to-date (30012/standalone/existing)
2016-12-27T09:19:49Z [27191] INFO In database '_system': Database is up-to-date (30012/standalone/existing)
2016-12-27T09:19:49Z [27191] INFO using endpoint 'http+tcp://xxxx:8529' for non-encrypted requests
2016-12-27T09:19:49Z [27191] INFO Authentication is turned off
2016-12-27T09:19:50Z [27191] INFO ArangoDB (version 3.0.12 [linux]) is ready for business. Have fun!

[@@@ sbin]# ./arangod --server.endpoint vpp://xxxx:8529
2016-12-27T09:20:34Z [27425] INFO using SSL options: SSL_OP_CIPHER_SERVER_PREFERENCE, SSL_OP_TLS_ROLLBACK_BUG
2016-12-27T09:20:34Z [27425] FATAL invalid endpoint 'vpp://xxxx:8529'

[@@@ sbin]# ./arangod --server.endpoint tcp+vpp://xxxx:8529
2016-12-27T09:21:11Z [27440] INFO using SSL options: SSL_OP_CIPHER_SERVER_PREFERENCE, SSL_OP_TLS_ROLLBACK_BUG
2016-12-27T09:21:11Z [27440] FATAL invalid endpoint 'tcp+vpp://xxxx:8529'
[@@@ sbin]# ps -ef | grep "arango"
root 27490 21712 0 04:22 pts/4 00:00:00 grep --color=auto arango

[@@@ sbin]# ./arangod --server.endpoint vst+tcp://xxxx:8529
2016-12-27T09:22:39Z [27540] INFO using SSL options: SSL_OP_CIPHER_SERVER_PREFERENCE, SSL_OP_TLS_ROLLBACK_BUG
2016-12-27T09:22:39Z [27540] FATAL invalid endpoint 'vst+tcp://xxxx:8529'
[@@@ sbin]# ps -ef | grep "arango"
root 27652 21712 0 04:24 pts/4 00:00:00 grep --color=auto arango

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