pyorient icon indicating copy to clipboard operation
pyorient copied to clipboard

pyorient not working with orientdb 3.0.0

Open rrmerugu opened this issue 7 years ago • 34 comments

When i try to establish a connection to the db from pyorient, the below error is showing up. im using pyorient==1.5.5, is it possible its not compatible with orientdb 3.0.0. Any plans to support pyorient for orientdb 3.0.0 version soon ?

pyorient.exceptions.PyOrientWrongProtocolVersionException: Protocol version 37 is not supported yet by this client.

PS: This is the version of the orientdb i'm using https://orientdb.com/download.php?file=orientdb-community-gremlin-3.0.0.tar.gz

rrmerugu avatar May 13 '18 20:05 rrmerugu

can you share your code please?

ghost avatar May 28 '18 06:05 ghost

client = pyorient.OrientDB('localhost', 2424) session_id = client.connect('user', 'password')

pyorient.exceptions.PyOrientWrongProtocolVersionException: Protocol version 37 is not supported yet by this client.

pyorient 1.5.5 orientdb 3.0.0

XhrCkYsSgZokJL avatar Jun 05 '18 15:06 XhrCkYsSgZokJL

Same problem here. pyorient 1.5.5 orientdb 3.0.2

ghost avatar Jun 07 '18 11:06 ghost

Same issue.

ghost avatar Jun 11 '18 10:06 ghost

+1

vinitshetty avatar Jun 12 '18 15:06 vinitshetty

i am using 3.0.2 and pyorient 1.5.5

vinitshetty avatar Jun 12 '18 15:06 vinitshetty

Same issue using the current Docker image.

I just wanted to try OrientDB and am not sure what a patch would encompass. No matter how complicated that may be, the Repository README states:

Pyorient works with orientdb version 1.7 and later.

As a first measure: Could someone adjust that line, pointing to the last working OrientDB (2.x) version?

For Docker it works with orientdb:2.2.35.

dersmon avatar Jun 22 '18 10:06 dersmon

@dersmon good point, since at moment i have not enough time to advance the version at least until august i think, this is the best option.

Ostico avatar Jun 22 '18 13:06 Ostico

I changed SUPPORTED_PROTOCOL in constants.py from 36 to 37 and it connects... now, is there going to be a bunch of buggy behavior?...Not the kind of thing for a production environment, but it got me back to my project.

softwareCobbler avatar Jul 28 '18 00:07 softwareCobbler

Hi @softwareCobbler ,

not tried, not tested and I don't know which issues there could be. Could be useful to know which problems you find as a good starting point to short cut the driver improvement.

Ostico avatar Aug 02 '18 09:08 Ostico

@mogui: Is there any plan to update pyorient to support version 3.x reliably?

Froskekongen avatar Aug 15 '18 17:08 Froskekongen

I have looked into this a bit. This client throws an error if the OrientDB server is of a more recent version than the client. The official Java client has slightly different behaviour, it just raises a warning that you will not be able to use the full features of the newer version.

It looks like both the python and Java clients attempt to connect to the server using the clients preferred protocol version, and expect the server to handle it.

I have tweaked the connection version checking in the python client to mirror that in the java client, and I'm going to give it a shot and see how it goes. (So far I have tried connecting to a V3.0.5 OrientDB and querying a graph successfully).

Note: links are to the relevant sections of code.

alanmeeson avatar Aug 22 '18 18:08 alanmeeson

@softwareCobbler I tried your approach and got the following

pyorient.exceptions.PyOrientDatabaseException: com.orientechnologies.orient.core.exception.OConfigurationException - You can use connect as first operation only for protocol < 37 please use handshake for protocol >= 37

wave-DmP avatar Sep 14 '18 16:09 wave-DmP

HI Tariq, We’ve been very busy with our everyday jobs, hopefully they will calm down soon, and we’re look into that soon, We’ve got some ideas on how to maintain compatibility, hang on :)

On 20 Sep 2018, at 02:54, Tariq Hassan [email protected] wrote:

Hi @Ostico

Sorry to ping you directly, but any idea about the status of this issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

mogui avatar Sep 20 '18 07:09 mogui

Hi Mogui! Any updates on this yet? Our development team really looks forward to testing pyorient with our OrientDB-server, version 3.0.7

Yours sincerely /Kjell

klkludde avatar Sep 26 '18 16:09 klkludde

Hi Mogui,

Do you guys have any estimations about fixing it? Or any proper python temporary solution to use mean while?

Thanks!!

montequie avatar Sep 27 '18 04:09 montequie

@mogui

Thanks for the reply. I ended up deleting my comment because I found that commenting out the error message (or invoking warning.warn() instead of raising in my case) will work.

@klkludde @montequie: What I suggested above is not particularly elegant, but it should work as a stopgap measure.

TariqAHassan avatar Sep 27 '18 04:09 TariqAHassan

@TariqAHassan

Can you repost your suggestion? can't find it here

montequie avatar Sep 27 '18 05:09 montequie

Hi @montequie

See here.

TariqAHassan avatar Sep 27 '18 05:09 TariqAHassan

@TariqAHassan Thanks a lot! It worked.

montequie avatar Sep 27 '18 05:09 montequie

+1 Any updates?

dtanase avatar Oct 25 '18 11:10 dtanase

+1

Let me add my encouragement to update to 3.x as well.. :)

I'm a new user to OrientDB. I have a project that I'm working on and I'm nervous to build and then have to migrate to 3.x later on.

dustyny avatar Dec 08 '18 17:12 dustyny

Is there any fix for pyorient with Orientdb 3.0 I got error like Protocol version 37 is not supported yet by this client

shashwatwork avatar May 17 '19 08:05 shashwatwork

+1

mn3mos avatar Aug 19 '19 16:08 mn3mos

Is there any plan to fix this?

upx86 avatar Sep 17 '19 09:09 upx86

+1

laurendelong21 avatar Dec 10 '19 10:12 laurendelong21

If someone needs to use odb3 with python, just use master branch instead of the last release. pip install git+https://github.com/orientechnologies/pyorient

If you just start a new project, I recommend using a more up-to-date dbsm (redisgraph or other).

mpomet avatar Dec 10 '19 15:12 mpomet

I'm sorry, but... what the hell is going on here?

Try out orientdb -> use pyorient -> latest, and right off the bat I run into a non-starter because of a constant that hasn't been updated in almost 2 years now? (Along with other changes that haven't been implemented along with that constant bump)

CafeLungo avatar Jan 02 '20 16:01 CafeLungo

The issue is back. You can fix this by overriding the connect method in OrientSocket:

from pyorient import OrientSocket

class PySocket(OrientSocket):
    def __init__(self, host, port, protocol=36, timeout=300):
        """
        Override OrientSocket protocol version number
        to fix PyOrientWrongProtocolVersionException where:
            'Protocol version 37 is not supported yet by this client.'
        """
        super(PySocket, self).__init__(host, port)
        self.protocol = protocol
        self.host = host
        self.port = port
        self.timeout = timeout

    def connect(self):
        """
        Override OrientSocket connect method
        to fix PyOrientWrongProtocolVersionException where:
            'Protocol version 37 is not supported yet by this client.'
        """

        self._socket.settimeout(self.timeout)
        self._socket.connect( (self.host, self.port) )
        _value = self._socket.recv(2)

        if len(_value) != 2:
            self._socket.close()

        self.connected = True

then

HOST = "localhost"
PORT = 2424
DATABASE_NAME = "<dbname>"
DB_USER = "admin"
DB_PWD = "admin"

socket = PySocket(HOST, PORT)
socket.connect()
client = OrientDB(socket)
client.db_open(DATABASE_NAME, DB_USER, DB_PWD)

jbonfardeci avatar Mar 29 '20 07:03 jbonfardeci

OrientTechnologies removed (in their fork) the if statement causing the error :) https://github.com/orientechnologies/pyorient/commit/5bbe000acb0e65d49a3f85bd0ecf9d40ae155467 (long time ago it seems)

Orient 3+ documentation page links their own fork as the repo to be used (just passing on the message) Probably because this current bug has not been fixed. Check this link under Developers/Python (change of repo for 3+) http://orientdb.com/docs/3.0.x/

Tested on: Orientdb 3.0.30 Pyorient 1.5.5 (not working as per ticket) then upgraded to version below.

If you want to try it below, it works, i checked. Just change your python package location from pypi package of this repo to git-based package of OrientTechnologies repo.

In your requirements.txt find line pyorient=1.5.5

and change to

-e git+https://github.com/orientechnologies/pyorient.git@master#egg=pyorient

then

pip uninstall pyorient && pip install -r requirements.txt

Now the connection as plain as below is working without the error. And be sure to check the first link with the funny fix to have a laugh.

import pyorient
from pyorient.ogm import Graph, Config

graph = Graph(Config.from_url('plocal://127.0.0.1:2424/mydb', 'root', 'supersecret'))

styk-tv avatar Apr 22 '20 20:04 styk-tv