PyOrient client reports protocol version error when trying to connect to server - orientdb

I'm getting what appears to be a version mismatch error from client.connect() when using what I believe to be the most recent versions of pyorient and the orientdb server
Protocol version 37 is not supported yet by this client.
Is there a more up-to-date version of pyclient available?
here's the test script
#!/usr/bin/env python
import pyorient
client = pyorient.OrientDB( "localhost", 2424 )
session_id = client.connect( "root", "password" )
Here's the full traceback
Traceback (most recent call last):
File "./test1.py", line 7, in <module>
session_id = client.connect( "root", "D1sOri3nted" )
File "~/.local/lib/python2.7/site-packages/pyorient-1.5.5-py2.7.egg/pyorient/orient.py", line 325, in connect
return self.get_message("ConnectMessage") \
File "~/.local/lib/python2.7/site-packages/pyorient-1.5.5-py2.7.egg/pyorient/orient.py", line 540, in get_message
message_instance = _Message(self._connection)\
File "~/.local/lib/python2.7/site-packages/pyorient-1.5.5-py2.7.egg/pyorient/messages/connection.py", line 17, in __init__
super( ConnectMessage, self ).__init__(_orient_socket)
File "~/.local/lib/python2.7/site-packages/pyorient-1.5.5-py2.7.egg/pyorient/messages/base.py", line 24, in __init__
sock.get_connection()
File "~/.local/lib/python2.7/site-packages/pyorient-1.5.5-py2.7.egg/pyorient/orient.py", line 78, in get_connection
self.connect()
File "~/.local/lib/python2.7/site-packages/pyorient-1.5.5-py2.7.egg/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.
I'm using the pyorient version from https://github.com/orientechnologies/pyorient
The server comes from the distributed docker image.
I'm uncertain of how to get the server version, but from within the docker container the console reports v3.0.1
Thanks in advance for any help or advice on this!

Related

Aws Cloudwatch Logs agent throws an error

I'm setting up awslogs agent on ec2 instance, When i run the python script of awslogs. I'm getting below message.
Downloading the latest CloudWatch Logs agent bits ... ERROR: Failed to create virtualenv. Try manually installing with pip and adding it to the sudo user's PATH before running this script.
And awslogs-agent-setup.log show below error.
Environment: CentOS 6.10 and Python 2.6
Traceback (most recent call last):
File "/usr/bin/pip", line 7, in <module>
from pip._internal import main
File "/usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg/pip/_internal/__init__.py", line 19, in <module>
from pip._vendor.urllib3.exceptions import DependencyWarning
File "/usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg/pip/_vendor/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg/pip/_vendor/urllib3/connectionpool.py", line 92
_blocking_errnos = {errno.EAGAIN, errno.EWOULDBLOCK}
^
SyntaxError: invalid syntax
/usr/bin/virtualenv
Traceback (most recent call last):
File "/usr/bin/virtualenv", line 7, in <module>
from virtualenv import main
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 51, in <module>
print("ERROR: {}".format(sys.exc_info()[1]))
ValueError: zero length field name in format
Basically, this error is due to your python version 2.6. Could you please update your python version from 2.6 to 2.7 or 3.1.
This should help.

Google Cloud SDK installation - gsutil error

I have installed Google Cloud SDK but having an issue running "gsutil". Here are the error I'm getting:
~/gcloud/google-cloud-sdk#> gsutil
Traceback (most recent call last):
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/bin/bootstrapping/gsutil.py", line 13, in <module>
import bootstrapping
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 40, in <module>
from googlecloudsdk.core import execution_utils
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/lib/googlecloudsdk/core/execution_utils.py", line 33, in <module>
from googlecloudsdk.core import log
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/lib/googlecloudsdk/core/log.py", line 810, in <module>
_log_manager = _LogManager()
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/lib/googlecloudsdk/core/log.py", line 526, in __init__
self._file_formatter = _LogFileFormatter()
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/lib/googlecloudsdk/core/log.py", line 315, in __init__
super(_LogFileFormatter, self).__init__(fmt=_LogFileFormatter.FORMAT)
TypeError: must be type, not classobj
~/gcloud/google-cloud-sdk#>
I have Python 2.7 installed, also tried to install this with "brew cask" as well as download it directly from Google Cloud site and install, but no luck either.
I googled this error but it seems like I'm the only one with this error..
"gcloud" command works just fine; but it's just "gsutil" that's not working.
Thank you

Can't connect python with titan db

Following the steps to configure the titan srever
bin/titan.sh
Forking Cassandra...
Running `nodetool statusthrift`... OK (returned exit status 0 and printed string "running").
Forking Elasticsearch...
Connecting to Elasticsearch (127.0.0.1:9300)... OK (connected to 127.0.0.1:9300).
Forking Gremlin-Server...
Connecting to Gremlin-Server (127.0.0.1:8182)... OK (connected to 127.0.0.1:8182).
Run gremlin.sh to connect.
The server started perfectly but when i am connecting with python and then run the script the error which i got mentioned below
Traceback (most recent call last):
File "/home/admin-12/Documents/bitbucket/ecodrone/ecodrone/GremlinConnector.py", line 28, in <module>
data = (execute_query("""g.V()"""))
File "/home/admin-12/Documents/bitbucket/ecodrone/ecodrone/GremlinConnector.py", line 22, in execute_query
results = future_results.result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 432, in result
return self.__get_result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/home/admin-12/.local/lib/python3.6/site-packages/gremlin_python/driver/resultset.py", line 81, in cb
f.result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/admin-12/.local/lib/python3.6/site-packages/gremlin_python/driver/connection.py", line 77, in _receive
self._protocol.data_received(data, self._results)
File "/home/admin-12/.local/lib/python3.6/site-packages/gremlin_python/driver/protocol.py", line 71, in data_received
result_set = results_dict[request_id]
KeyError: None
versioning i am using
titan - 1.0.0
gremlin-python - 3.3.2
apache-tinkerpop-gremlin-server-3.3.1
Titan supports some an extremely old version of TinkerPop and I'm sure you'll find some incompatibility there if you try to use gremlin-python 3.3.2. As Titan is no longer supported, I suggest you upgrade to JanusGraph, a more current and maintained version of Titan.

Issue running psycopg2 inside AWS Lambda Function

I'm getting the following error when trying to run psycopg2 in a AWS Lambda:
/var/task/functions/../vendored/psycopg2/_psycopg.so: ELF file's phentsize not the expected size: ImportError
Traceback (most recent call last):
File "/var/task/functions/refresh_mv.py", line 64, in execute
session = SessionFactoryGraphQL.get_session(app=item['app'])
File "/var/task/lib/session_factory.py", line 22, in get_session
engine = create_engine(conn_string, poolclass=NullPool)
File "/var/task/functions/../vendored/sqlalchemy/engine/__init__.py", line 387, in create_engine
return strategy.create(*args, **kwargs)
File "/var/task/functions/../vendored/sqlalchemy/engine/strategies.py", line 80, in create
dbapi = dialect_cls.dbapi(**dbapi_args)
File "/var/task/functions/../vendored/sqlalchemy/dialects/postgresql/psycopg2.py", line 554, in dbapi
import psycopg2
File "/var/task/functions/../vendored/psycopg2/__init__.py", line 50, in <module>
from psycopg2._psycopg import ( # noqa
ImportError: /var/task/functions/../vendored/psycopg2/_psycopg.so: ELF file's phentsize not the expected size
The weird thing is: everything was working fine until yesterday (for more than 5 months), and suddenly stopped working. None of the libraries has been updated.
I tried to build from scratch, as in https://github.com/jkehler/awslambda-psycopg2, but still having the same error.
Can someone help me with it?
The problem is in the latest version of serverless framework. I assume that you are using serverless to deploy your lambda function.
serverless remove
npm install serverless#1.20.2 -g
This should work.

No handlers could be found for logger "mongo_connector.util"

I always got the error below when I try to run mongo-connector with neo4j doc manager. I also tried with a config file as in https://github.com/mongodb-labs/mongo-connector/blob/master/config.json
Where is the problem?
mongo-connector -m localhost:27017 -t http://localhost:7474/db/data -d neo4j_doc_manager
No handlers could be found for logger "mongo_connector.util"
Traceback (most recent call last):
File "/usr/bin/mongo-connector", line 11, in <module>
sys.exit(main())
File "/usr/lib/python2.6/site-packages/mongo_connector/util.py", line 85, in wrapped
func(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/mongo_connector/connector.py", line 1041, in main
conf.parse_args()
File "/usr/lib/python2.6/site-packages/mongo_connector/config.py", line 118, in parse_args
option, dict((k, values.get(k)) for k in option.cli_names))
File "/usr/lib/python2.6/site-packages/mongo_connector/connector.py", line 824, in apply_doc_managers
module = import_dm_by_name(dm['docManager'])
File "/usr/lib/python2.6/site-packages/mongo_connector/connector.py", line 803, in import_dm_by_name
module = __import__(full_name, fromlist=(name,))
File "/usr/lib/python2.6/site-packages/mongo_connector/doc_managers/neo4j_doc_manager.py", line 16, in <module>
from py2neo import Graph, authenticate
File "/usr/lib/python2.6/site-packages/py2neo/__init__.py", line 28, in <module>
from py2neo.database import *
File "/usr/lib/python2.6/site-packages/py2neo/database/__init__.py", line 65
parameters = {k: v for k, v in parameters.items() if k not in presub_parameters}
It looks like you are using Python 2.6. I'm not sure if that version is officially supported for this project. I would suggest upgrading to Python 2.7 or preferably 3.4 and trying to reproduce.