Git Product home page Git Product logo

Comments (4)

Ostico avatar Ostico commented on July 17, 2024

Sorry sinfex but this is not true, this functionality exists since the first version.

client = pyorient.OrientDB("localhost", 2424)
cluster_info = client.db_open(
    'GratefulDeadConcerts', "admin", "admin"
)
print(cluster_info)
[{'name': b'e', 'id': 10}, {'name': b'index', 'id': 1}, {'name': b'orole', 'id': 4}, {'name': b'v', 'id': 9}, {'name': b'ofunction', 'id': 7}, {'name': b'default', 'id': 3}, {'name': b'manindex', 'id': 2}, {'name': b'orids', 'id': 6}, {'name': b'ouser', 'id': 5}, {'name': b'internal', 'id': 0}, {'name': b'followed_by', 'id': 11}, {'name': b'oschedule', 'id': 8}]

from pyorient.

DeividasJackus avatar DeividasJackus commented on July 17, 2024

I am sorry, but that does not seem to be true. I have tested it several times with python-3.4.1, orientdb-2.0-m3 and a recently forked version of pyorient. I have just tested it out again just in case, using a different server with a fresh installation of python 2.7.5, orientdb 1.7.10 and pyorient 1.2.1, the result is the same.

[dave@studs bin]$ sudo pip install pyorient
Downloading/unpacking pyorient
  Downloading pyorient-1.2.1.tar.gz (47kB): 47kB downloaded
  Running setup.py (path:/tmp/pip_build_root/pyorient/setup.py) egg_info for package pyorient

Installing collected packages: pyorient
  Running setup.py install for pyorient

Successfully installed pyorient
Cleaning up...
[dave@studs bin]$ python2
Python 2.7.5 (default, Jun 17 2014, 18:11:42)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyorient
>>> client = pyorient.OrientDB("localhost", 2424)
>>> cluster_info = client.db_open('GratefulDeadConcerts', "admin", "admin")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/pyorient/orient.py", line 191, in db_open
    .prepare(args).send().fetch_response()
  File "/usr/lib/python2.7/site-packages/pyorient/messages/database.py", line 91, in prepare
    self._perform_connection()
  File "/usr/lib/python2.7/site-packages/pyorient/messages/database.py", line 63, in _perform_connection
    .prepare( ( self._user, self._pass, self._client_id ) )\
  File "/usr/lib/python2.7/site-packages/pyorient/messages/connection.py", line 54, in fetch_response
    self._session_id = super( ConnectMessage, self ).fetch_response()[0]
  File "/usr/lib/python2.7/site-packages/pyorient/messages/base.py", line 137, in fetch_response
    self._decode_all()
  File "/usr/lib/python2.7/site-packages/pyorient/messages/base.py", line 121, in _decode_all
    self._decode_header()
  File "/usr/lib/python2.7/site-packages/pyorient/messages/base.py", line 109, in _decode_header
    raise PyOrientCommandException(cmd_exc, [])
pyorient.exceptions.PyOrientCommandException: Wrong user/password to [connect] to the remote OrientDB Server instance. Get the user/password from the config/orientdb-server-config.xml file - com.orientechnologies.orient.core.exception.OSecurityAccessException

Would you please double check? The only two explanations I can come up with for your piece of code working for you apart from me encountering an anomaly is either you have admin:admin defined in your orientdb-server-config.xml or you are issuing client.connect("root", "...") before the call to client.db_open.

from pyorient.

Ostico avatar Ostico commented on July 17, 2024

Yes, you're right, i've two root user, root and admin, you can find my server configuration here:
https://github.com/mogui/pyorient/blob/master/ci/orientdb-server-config.xml#L145.

But this is the right behaviour of the client, the client can't know the root access credentials.

Wrong user/password to [connect] to the remote OrientDB Server instance. 
Get the user/password from the config/orientdb-server-config.xml file - 
com.orientechnologies.orient.core.exception.OSecurityAccessException

This is an exception raised by orientDB.
Moreover, the binary protocol seems not to allow to open a database without a connection because OrientDB raise an exception.

Writing string (4+30=34 bytes): java.lang.NullPointerException [OChannelBinaryServer]

I have to check for this, but i think there is not a solution at the moment.

from pyorient.

DeividasJackus avatar DeividasJackus commented on July 17, 2024

I believe that should be possible since console.sh does seem to allow this while using the binary protocol (using "remote" connection mode and not "plocal"):

bash-4.2$ sh console.sh
orientdb> connect remote:localhost/test reader reader    <--- reader:reader from OUser
Connecting to database [remote:localhost/test] with user 'reader'...OK

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.