Skip to content
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

Not working with orientdb 3.0 #27

Open
tjtimer opened this issue Jan 29, 2018 · 16 comments
Open

Not working with orientdb 3.0 #27

tjtimer opened this issue Jan 29, 2018 · 16 comments

Comments

@tjtimer
Copy link

tjtimer commented Jan 29, 2018

I can't connect to my orientdb (version 3.0) database.
Traceback:
Traceback (most recent call last):
File "", line 1, in
File "/var/www/projects/pydev/bonham/venv/lib/python3.6/site-packages/pyorient/orient.py", line 411, in db_open
info, clusters, nodes = self.get_message("DbOpenMessage")
File "/var/www/projects/pydev/bonham/venv/lib/python3.6/site-packages/pyorient/orient.py", line 540, in get_message
message_instance = _Message(self._connection)
File "/var/www/projects/pydev/bonham/venv/lib/python3.6/site-packages/pyorient/messages/database.py", line 47, in init
super(DbOpenMessage, self).init(_orient_socket)
File "/var/www/projects/pydev/bonham/venv/lib/python3.6/site-packages/pyorient/messages/base.py", line 24, in init
sock.get_connection()
File "/var/www/projects/pydev/bonham/venv/lib/python3.6/site-packages/pyorient/orient.py", line 78, in get_connection
self.connect()
File "/var/www/projects/pydev/bonham/venv/lib/python3.6/site-packages/pyorient/orient.py", line 103, in connect
" is not supported yet by this client.", [])
pyorient.exceptions.PyOrientWrongProtocolVersionException: Protocol version 37 is not supported yet by this client.

@linmao-song
Copy link

Same here. Not sure if this project is still active? It seems to have been a while since last commit.

@rrmerugu
Copy link

i just updated the constants.py to support the lastest protocol 37 and its working, but not sure if it has any implications. Here is the working pyorient module for orientdb3.0.0 https://github.com/rrmerugu/pyorient/ you can install with pip install git+https://github.com/rrmerugu/pyorient/

@Ostico
Copy link
Collaborator

Ostico commented May 17, 2018

Should be tested, some internal changes could be happened. This requires manual test and debug.

@Ostico
Copy link
Collaborator

Ostico commented May 17, 2018

You can try, but keep in mind that this is not production ready.

@rrmerugu
Copy link

@Ostico is there any roadmap to support 3.0.0 soon ?

@ghost
Copy link

ghost commented Jun 7, 2018

Same problem here.
pyorient 1.5.5
orientdb 3.0.2

@OrientDBColin
Copy link

Starting with OrientDB 3.0.3, it adds a check to protocol 37 during the connect phase to see if a handshake is used. If a client specifies it supports protocol 37 but does not perform an initial handshake, it will fail.

The simplest solution is to still use protocol 36 (OrientDB will adjust accordingly) until the handshake, etc. can be implemented and to comment out this in orient.py:

        if self.protocol > SUPPORTED_PROTOCOL:
            raise PyOrientWrongProtocolVersionException(
                "Protocol version " + str(self.protocol) +
                " is not supported yet by this client.", [])

@Ostico could we comment that out, test it, and publish it to pip?

@OrientDBColin
Copy link

I went ahead and commented the protocol check out so that, at least, it will communicate with OrientDB 3.0.x now.

Your mileage may vary...

@Ostico
Copy link
Collaborator

Ostico commented Dec 10, 2018

Tested and checked with PHPOrient, this solution works, i will update pyOrient also as soon as possible

@Ostico Ostico reopened this Dec 10, 2018
@lalala0731
Copy link

@Ostico when can you updata it? I have the same problem.

@thenesk
Copy link

thenesk commented Apr 26, 2019

@Ostico, @mogui, any chance we could get this patch pushed to pypi?

@Cornoualis
Copy link

Until it's pushed to pypi, you can install the module via:
pip install git+https://github.com/orientechnologies/pyorient

@geastham
Copy link

I forked a version and patched: https://github.com/OpenConjecture/pyorient

Install (be sure to use --upgrade flag to override local cache):

pip install --upgrade git+https://github.com/OpenConjecture/pyorient.git

Connect and test.

python
>> client = pyorient.OrientDB("localhost", 2424)
>> client.set_session_token(True)
>> session_id = client.connect( "admin", "admin" )

@Konubinix
Copy link

Konubinix commented Jun 27, 2020

I am new to orientdb and I have been a little puzzled by all the forks and the lack of activity in pyorient, so maybe my comment will sound a little bit naive. Sorry.

I can tell that the fork https://github.com/OpenConjecture/pyorient appear to work so far.

It appears that, at least in 3.1.0, the binary protocol for error messages changed, causing pyorient to fail interpreting the binary output.

I generally get an output of the form

PyOrientCommandException                  Traceback (most recent call last)
~/perso/perso/python/clk_commands_perso/orientdb.py in <module>
----> 1 o.client.db_drop("docs")

~/.local/lib/python3.8/site-packages/pyorient/orient.py in db_drop(self, name, type)
    375         :return: None
    376         '''
--> 377         self.get_message("DbDropMessage") \
    378             .prepare((name, type)).send().fetch_response()
    379         return None

~/.local/lib/python3.8/site-packages/pyorient/messages/database.py in fetch_response(self)
    419 
    420     def fetch_response(self):
--> 421         return super(DbDropMessage, self).fetch_response()
    422 
    423     def set_db_name(self, db_name):

~/.local/lib/python3.8/site-packages/pyorient/messages/base.py in fetch_response(self, *_continue)
    263         # already fetched, get last results as cache info
    264         elif len(self._body) is 0:
--> 265             self._decode_all()
    266             self.dump_streams()
    267         return self._body

~/.local/lib/python3.8/site-packages/pyorient/messages/base.py in _decode_all(self)
    247 
    248     def _decode_all(self):
--> 249         self._decode_header()
    250         self._decode_body()
    251 

~/.local/lib/python3.8/site-packages/pyorient/messages/base.py in _decode_header(self)
    178                     del serialized_exception
    179 
--> 180             raise PyOrientCommandException(
    181                 exception_class.decode( 'utf8' ),
    182                 [ exception_message.decode( 'utf8' ) ]

PyOrientCommandException:  - 

Do you have a similar experience sometimes ?

@Amioplk
Copy link

Amioplk commented Jan 14, 2021

Hello @Konubinix ! I have the same experience. Do you think it has anything to do with OrientDB 3.1+ version ? (I am currently using 3.1.6 version)

@Konubinix
Copy link

Sorry, I have given up using orientdb, as it is way to resource greedy to run on my Raspberry Pi 3B+. So I won't be able to answer you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests