-
Notifications
You must be signed in to change notification settings - Fork 13
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
Neo4j 4 drops bolt version 1, perhaps default to higher version? #21
Comments
On further investigation, Neo4j 4.0.0.0 is only returning bolt protocols version 3 and 4. |
Hi Stephen! Thank you for the feedback. I think you are right and it's time to move to BOLTv3. I'll make the commit with this change after several neo4j versions testing. |
The problem is deeper that I thought. BOLT v3 (and v4) is binary incompatible with BOLT v1. Also all versions except v1 are still undocumented. You may find a bit more on this problem here. So I have to investigate neo4j sources a bit to find the differences and understand the way to make changes. |
Appreciate that - had a bit of a play with connect and could see the server failing to follow through on standard v1 type interaction following bolt protocol negotiation. Are these the relevant sources? https://github.com/neo4j/neo4j/tree/4.0/community/bolt/src/main/java/org/neo4j/bolt |
I’m following this documentation but after sending the four magic bytes and the version proposal (1, 0, 0, 0) it seems like the server responses with a ‘0’. Could that be the case? main :: IO ()
main = do
pipe <- connect withConfig
close pipe
withConfig :: BoltCfg
withConfig = def {user = "neo4j", password = "scratch"}
[...]
-- at `Database.Bolt.Connection.Pipe`
handshake :: MonadPipe m => Pipe -> BoltCfg -> m ()
handshake pipe bcfg = do let conn = connection pipe
C.send conn (encodeStrict $ magic bcfg)
C.send conn (boltVersionProposal bcfg)
serverVersion <- decodeStrict <$> recvChunk conn 4
when (serverVersion /= version bcfg) $
throwError $ UnsupportedServerVersion (T.pack . show $ serverVersion)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
flush pipe (createInit bcfg)
response <- fetch pipe
unless (isSuccess response) $
throwError AuthentificationFailed executing with this minor adaptation yield ▶ stack exec scratch-exe
errata-exe: Cannot connect: server version '0' is not supported Changing to version '4' and commenting out flushing in the handshake yields instance Default BoltCfg where
def = BoltCfg { magic = 1616949271
, version = 4
[...]
-- at `Database.Bolt.Connection.Pipe`
handshake :: MonadPipe m => Pipe -> BoltCfg -> m ()
handshake pipe bcfg = do let conn = connection pipe
C.send conn (encodeStrict $ magic bcfg)
C.send conn (boltVersionProposal bcfg)
serverVersion <- decodeStrict <$> recvChunk conn 4
when (serverVersion /= version bcfg) $
throwError $ UnsupportedServerVersion (T.pack . show $ serverVersion)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-- flush pipe (createInit bcfg)
-- response <- fetch pipe
-- unless (isSuccess response) $
-- throwError AuthentificationFailed
and executing those adaptations yields, at least no error ▶ stack exec scratch-exe
|
Popping in here to link to this Issue: Which announces official Bolt documentation here: https://7687.org/ |
Hi, everyone! So, I've found a couple of evenings and made the initial support of protocol version 3 (not the 4). It's still lots of work, but you can use I want to say thanks to all who have written me e-mails with questions about the library. It's very motivating. Hope, we'll make the further work much faster. |
https://7687.org/ is down and used to go upto neo4j 4.4 https://web.archive.org/web/20221017144413/https://7687.org/ For neo4j 5.0 - 5.3 with bolt 5.0 this website seems up to date https://neo4j.com/docs/bolt/current/bolt/ because it referenced changes made to 5.0 in a few places. |
I understand that neo4j 4 has dropped support for bolt version 1, which causes hasbolt connections to fail with the default version 1 requested.
Perhaps it's time to default to version 2?
I would also like to suggest that current error message be adjusted.
It presently reads "Cannot connect: unsupported server version".
I think that's misleading, and would suggest instead "Cannot connect: Requested Bolt protocol version unsupported".
thanks for the great work,
Stephen.
The text was updated successfully, but these errors were encountered: