I have a migration script that I use to load data into Grakn via the Python driver with Grakn Core 1.6.2. This works.
I have recently downloaded 1.7.1, but when I run the same migration script I get the following error:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/grakn/service/Session/TransactionService.py", line 161, in send
response = next(self._response_iterator)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/grpc/_channel.py", line 388, in __next__
return self._next()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/grpc/_channel.py", line 382, in _next
raise self
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
status = StatusCode.INVALID_ARGUMENT
details = ""
debug_error_string = "{"created":"#1589227241.242279000","description":"Error received from peer ipv6:[::1]:48555","file":"src/core/lib/surface/call.cc","file_line":1055,"grpc_message":"","grpc_status":3}"
>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "migrator.py", line 240, in <module>
insertSchema(URI, KEYSPACE)
File "/Users/johnnie/Documents/grain/insert.py", line 21, in insertSchema
write_transaction.query(schema)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/grakn/client.py", line 131, in query
return self._tx_service.query(query, infer)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/grakn/service/Session/TransactionService.py", line 49, in query
response = self._communicator.send(request)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/grakn/service/Session/TransactionService.py", line 165, in send
raise GraknError("Server/network error: {0}\n\n generated from request: {1}".format(e, request))
grakn.exception.GraknError.GraknError: Server/network error: <_Rendezvous of RPC that terminated with:
status = StatusCode.INVALID_ARGUMENT
details = ""
debug_error_string = "{"created":"#1589227241.242279000","description":"Error received from peer ipv6:[::1]:48555","file":"src/core/lib/surface/call.cc","file_line":1055,"grpc_message":"","grpc_status":3}"
>
generated from request: query_req {
[SCHEMA IS SHOWN HERE]
}
Any help is greatly appreciated.
Are you using the latest release of both the Python Grakn client and Grakn server? Grakn core 1.7 is not compatible with pre-1.7 clients.
I have the same issue when using session.transaction().read(), when it call TransactionService.py
Becaues Grakn Core 1.7.1 does not support KGMS
Detail
You need to write
pip install --upgrade grakn-client
Sources: python client api docs and pip install docs
(the --upgrade flag because it is already installed.)
Related
For my python (python 3.10) based project, we were using aioredis (aioredis 2.0.1) to connect to redis cache and all of a sudden all the requests accessing redis cache started failing. After analysis, we found that Aioredis is now in redis-py. Post that we removed aioredis and added redis (redis 4.5.1) as a dependency in pipfile.
I didn't added any extra code just changed the imports from
import aioredis
to
from redis import asyncio as aioredis
But that didn't resolve the issue completely, now half of the requests are failing with the error code as below.(In an hour 145 requests were success while 79 failed)
redis.exceptions.ConnectionError: Error UNKNOWN while writing to
socket. Connection lost
we use aioredis.Redis for connection
aioredis.Redis(
host=redis_hostname,
port=redis_port,
db=db_name,
password=redis_password,
ssl=true,
connection_pool=aioredis.ConnectionPool.from_url(
f"{redis_protocol}://:{redis_password}#{redis_hostname}:{redis_port}/{db_name}",
connection_class=aioredis.Connection,
max_connections=redis_pool_size,
)
Below is the error trace
Traceback (most recent call last): File
/usr/local/lib/python3.10/site-packages/redis/asyncio/connection.py,
line 788, in send_packed_command await self._writer.drain()
File /usr/local/lib/python3.10/asyncio/streams.py, line 371, in
drain await self._protocol._drain_helper()
Traceback (most recent call last): File
/usr/local/lib/python3.10/site-packages/ddtrace/contrib/asgi/middleware.py,
line 173, in call return await self.app(scope, receive,
wrapped_send)
File /usr/local/lib/python3.10/asyncio/streams.py, line 167, in
_drain_helper raise ConnectionResetError('Connection
lost')ConnectionResetError: Connection lost The above exception was
the direct cause of the following exception:
.....
File /usr/local/lib/python3.10/site-packages/redis/asyncio/client.py,
line 487, in _send_command_parse_response await
conn.send_command(*args)redis.exceptions.ConnectionError: Error
UNKNOWN while writing to socket. Connection lost.
I am using bottle cork as authentication and working in python 2.7 but on python 3.10 its not working
Here is the code for login
#bottle.post('/login')
def login():
"""Authenticate users"""
username = post_get('username')
password = post_get('password')
aaa.login(username, password, success_redirect='/management/stats/today', fail_redirect='/login?failure')
When I do login using correct credentials I am getting 500 internal server error.
Here is the error log
[2022-06-09 09:45:29 +0500] [224454] [DEBUG] POST /login
<h1>Critical error while processing request: /login</h1>[2022-06-09 09:45:29 +0500] [224454] [ERROR] Error handling request /login
Traceback (most recent call last):
File "/opt/app/bin/bottle.py", line 966, in wsgi
start_response(response._status_line, response.headerlist)
File "/opt/app/lib/python3.10/site-packages/beaker/middleware.py", line 150, in session_start_response
session.persist()
File "/opt/app/lib/python3.10/site-packages/beaker/session.py", line 875, in persist
self._session().save()
File "/opt/app/lib/python3.10/site-packages/beaker/session.py", line 723, in save
self._create_cookie()
File "/opt/app/lib/python3.10/site-packages/beaker/session.py", line 737, in _create_cookie
val = self._encrypt_data()
File "/opt/app/lib/python3.10/site-packages/beaker/session.py", line 379, in _encrypt_data
return nonce + b64encode(self.crypto_module.aesEncrypt(data, encrypt_key))
File "/opt/app/lib/python3.10/site-packages/beaker/crypto/pycrypto.py", line 22, in aesEncrypt
counter=Counter.new(128, initial_value=0))
File "/opt/app/lib/python3.10/site-packages/Crypto/Util/Counter.py", line 109, in new
initval = _encode(initial_value, nbytes, little_endian)
File "/opt/app/lib/python3.10/site-packages/Crypto/Util/Counter.py", line 118, in _encode
n = long(n)
NameError: name 'long' is not defined
Thanks for your time.
I installed pycryptodome using pip install pycryptodome and the error is gone.
WARNING: Invalid HTTP request received.
Traceback (most recent call last):
File "/home/ubuntu/MySQL_UI_Backend/venv/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 136, in handle_events
event = self.conn.next_event()
File "/home/ubuntu/MySQL_UI_Backend/venv/lib/python3.8/site-packages/h11/_connection.py", line 432, in next_event
raise RemoteProtocolError(
h11._util.RemoteProtocolError: Receive buffer too long
WARNING:uvicorn.error:Invalid HTTP request received.
Traceback (most recent call last):
File "/home/ubuntu/MySQL_UI_Backend/venv/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 136, in handle_events
event = self.conn.next_event()
File "/home/ubuntu/MySQL_UI_Backend/venv/lib/python3.8/site-packages/h11/_connection.py", line 432, in next_event
raise RemoteProtocolError(
h11._util.RemoteProtocolError: Receive buffer too long
The APIs are working fine locally but when I run it on EC2, I get the above error, the ports I have used are 7879 for the API server, 6869 for the frontend UI running on react
1.Make sure that the ports that you use are open at your security group settings.
2.Try changing the url from https to http
My streaming dataflow job (from Pub/Sub source) throws multiple error messages from the worker:
Failed to read inputs in the data plane. Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/apache_beam/runners/worker/data_plane.py", line 581, in _read_inputs for elements in elements_iterator: File "/usr/local/lib/python3.8/site-packages/grpc/_channel.py", line 416, in __next__ return self._next() File "/usr/local/lib/python3.8/site-packages/grpc/_channel.py", line 706, in _next raise self grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with: status = StatusCode.UNAVAILABLE details = "keepalive watchdog timeout" debug_error_string = "{"created":"#1619783831.069194941","description":"Error received from peer ipv6:[::1]:12371","file":"src/core/lib/surface/call.cc","file_line":1061,"grpc_message":"keepalive watchdog timeout","grpc_status":14}" >
which leads to another error message:
Python sdk harness failed: Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/apache_beam/runners/worker/sdk_worker_main.py", line 155, in main SdkHarness( File "/usr/local/lib/python3.8/site-packages/apache_beam/runners/worker/sdk_worker.py", line 256, in run for work_request in self._control_stub.Control(get_responses()): File "/usr/local/lib/python3.8/site-packages/grpc/_channel.py", line 416, in __next__ return self._next() File "/usr/local/lib/python3.8/site-packages/grpc/_channel.py", line 689, in _next raise self grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with: status = StatusCode.UNAVAILABLE details = "keepalive watchdog timeout" debug_error_string = "{"created":"#1619786284.366500317","description":"Error received from peer ipv6:[::1]:12371","file":"src/core/lib/surface/call.cc","file_line":1061,"grpc_message":"keepalive watchdog timeout","grpc_status":14}" >
judging from "description":"Error received from peer ipv6:[::1]:12371","file":"src/core/lib/surface/call.cc" line, it seems that for some reason, the job cannot reach the grpc backend of the dataflow service.
Is that correct or any other reason for that error message? I use Apache Beam SDK 2.28 for python 3.8. I also use VPC settings that set using --subnetwork=https://www.googleapis.com/compute/v1/projects/.../regions/.../subnetworks/... pipeline option if that worth mentioning
I was trying to implement a simple gRPC server/client and have narrowed down the problem to even basic gRPC Python implementations not working on my machine.
Here is what I tried:
pip install grpcio grpcio-tools
git clone https://github.com/grpc/grpc.git
cd grpc/examples/python/route_guide
python run_codegen.py # Everything breaks whether I include this step or not
python route_guide_server.py
And getting the following error:
-------------- GetFeature --------------
Traceback (most recent call last):
File "route_guide_client.py", line 119, in <module>
run()
File "route_guide_client.py", line 109, in run
guide_get_feature(stub)
File "route_guide_client.py", line 48, in guide_get_feature
latitude=409146138, longitude=-746188906))
File "route_guide_client.py", line 34, in guide_get_one_feature
feature = stub.GetFeature(point)
File "/Users/p/anaconda/envs/py36/lib/python3.6/site-packages/grpc/_channel.py", line 514, in __call__
return _end_unary_response_blocking(state, call, False, None)
File "/Users/p/anaconda/envs/py36/lib/python3.6/site-packages/grpc/_channel.py", line 448, in _end_unary_response_blocking
raise _Rendezvous(state, None, None, deadline)
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
status = StatusCode.UNIMPLEMENTED
details = "Method not found!"
debug_error_string = "{"created":"#1530451116.454542000","description":"Error received from peer","file":"src/core/lib/surface/call.cc","file_line":1083,"grpc_message":"Method not found!","grpc_status":12}"
>
More detail on my machine config if useful.
Realised that the port 50051 was occupied!