codenotary / immudb-py

immudb Python SDK
Apache License 2.0
43 stars 7 forks source link

StatusCode.UNIMPLEMENTED #12

Closed takotab closed 3 years ago

takotab commented 3 years ago

Hi,

When trying the immudb. I can not get it to work. I run the db on docker with: sudo docker run -it -p 3322:3322 -p 9497:9497 --name immudb codenotary/immudb:latest and this is my client code:

import immudb
from immudb.client import ImmudbClient

ic = ImmudbClient("0.0.0.0:3322") 
ic.login("immudb","immudb")

if "testdb" not in [o.databasename for o in ic.databaseList().dblist.databases]:
    ic.databaseCreate(b"testdb")
print(ic.databaseList().dblist.databases)

ic.databaseUse(b"testdb")
print('using testdb')
key="Hello".encode('utf8')
value="Immutable world!".encode('utf8')

# set a key/value pair
ic.set(key,value)

I do get a read out of the databases. But then I get the following error:

    raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
        status = StatusCode.UNIMPLEMENTED
        details = "unknown method SetSV for service immudb.schema.ImmuService"
        debug_error_string = "{"created":"@1606746880.907274017","description":"Error received from peer ipv4:0.0.0.0:3322","file":"src/core/lib/surface/call.cc","file_line":1061,"grpc_message":"unknown method SetSV for service immudb.schema.ImmuService","grpc_status":12}"
>

I'm even running the code in docker and still get the same error. here the Dockerfile:

FROM python:3.7.2-slim

RUN apt-get update && apt-get remove -y --purge man-db && apt-get dist-upgrade -y && apt-get autoremove -y
RUN apt-get update && apt-get install gcc wget git python3-dev g++ -y
RUN apt install python3-pip git -y
RUN pip3 install --upgrade pip

RUN python3 -m pip install --upgrade setuptools
RUN pip3 install --no-cache-dir  --force-reinstall -Iv grpcio #==1.32

RUN pip3 install immudb-py

WORKDIR /app
COPY run_immudb.py /app/run_immudb.py

CMD python3 run_immudb.py

Any help would be much appreciated

SimoneLazzaris commented 3 years ago

Hi takotab. Latest versions of immudb have deprecated and removed some functions that are still used in main branch of immudb-py. That is going to be fixed. For the moment, I suggest you to try branch "feat/nosv" of immudb-py that is coping with that and will be merged soon.

SimoneLazzaris commented 3 years ago

I've merged feat/nosv branch into master, you can use that now