Git Product home page Git Product logo

Comments (33)

 avatar commented on July 17, 2024 9

Same problem here.
pyorient 1.5.5
orientdb 3.0.2

from pyorient.

Froskekongen avatar Froskekongen commented on July 17, 2024 8

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

from pyorient.

mogui avatar mogui commented on July 17, 2024 5

from pyorient.

CafeLungo avatar CafeLungo commented on July 17, 2024 4

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)

from pyorient.

styk-tv avatar styk-tv commented on July 17, 2024 4

OrientTechnologies removed (in their fork) the if statement causing the error :)
orientechnologies@5bbe000 (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'))

from pyorient.

XhrCkYsSgZokJL avatar XhrCkYsSgZokJL commented on July 17, 2024 3

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

from pyorient.

montequie avatar montequie commented on July 17, 2024 3

@TariqAHassan Thanks a lot!
It worked.

from pyorient.

dustyny avatar dustyny commented on July 17, 2024 3

+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.

from pyorient.

wave-DmP avatar wave-DmP commented on July 17, 2024 2

@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

from pyorient.

shashwatwork avatar shashwatwork commented on July 17, 2024 2

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

from pyorient.

mpomet avatar mpomet commented on July 17, 2024 2

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).

from pyorient.

jbonfardeci avatar jbonfardeci commented on July 17, 2024 2

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)

from pyorient.

klkludde avatar klkludde commented on July 17, 2024 1

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

from pyorient.

sanvir10 avatar sanvir10 commented on July 17, 2024 1

Or use pyorient=1.5.1 with this version this work fine.

from pyorient.

imanabu avatar imanabu commented on July 17, 2024 1

@styk-tv's solution fixes the connection problem (thank you for that), but still there are several more issues that's the driver itself.

You need to now get a token and then set it, I did the following and got around that,

    token = client.get_session_token()
    client.set_session_token(token)

But, after that you will still get another exception if you do a Query.

  pyorient.exceptions.PyOrientBadMethodCallException: Unable to find command 'DbQueryMessage'

Granted these are different bugs, I need to warn that you will run into more issues even if you get around this specific issue on this bug.

from pyorient.

 avatar commented on July 17, 2024

can you share your code please?

from pyorient.

 avatar commented on July 17, 2024

Same issue.

from pyorient.

vinitshetty avatar vinitshetty commented on July 17, 2024

+1

from pyorient.

vinitshetty avatar vinitshetty commented on July 17, 2024

i am using 3.0.2 and pyorient 1.5.5

from pyorient.

dersmon avatar dersmon commented on July 17, 2024

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.

from pyorient.

Ostico avatar Ostico commented on July 17, 2024

@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.

from pyorient.

softwareCobbler avatar softwareCobbler commented on July 17, 2024

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.

from pyorient.

Ostico avatar Ostico commented on July 17, 2024

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.

from pyorient.

alanmeeson avatar alanmeeson commented on July 17, 2024

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.

from pyorient.

montequie avatar montequie commented on July 17, 2024

Hi Mogui,

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

Thanks!!

from pyorient.

TariqAHassan avatar TariqAHassan commented on July 17, 2024

@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.

from pyorient.

montequie avatar montequie commented on July 17, 2024

@TariqAHassan

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

from pyorient.

TariqAHassan avatar TariqAHassan commented on July 17, 2024

Hi @montequie

See here.

from pyorient.

dtanase avatar dtanase commented on July 17, 2024

+1
Any updates?

from pyorient.

mn3mos avatar mn3mos commented on July 17, 2024

+1

from pyorient.

upx86 avatar upx86 commented on July 17, 2024

Is there any plan to fix this?

from pyorient.

laurendelong21 avatar laurendelong21 commented on July 17, 2024

+1

from pyorient.

aniketgambhire avatar aniketgambhire commented on July 17, 2024

Hi @rrmerugu. Install pyorient from source as given here PyOrient Installation after this you no longer will face this issue.

from pyorient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.