RasaHQ / tutorial-knowledge-base

Integrating Rasa with a knowledge base to encode domain knowledge and resolve entities

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error running migrate.py script

mschnyde opened this issue · comments

Hi Tanja,

I checked the other issues instructions so I cleaned my grakn keyspace, created a new one but then the migration script gives me this error:

Loading from [./data/person] into Grakn ...
Inserted 20 items from [./data/person] into Grakn.
Loading from [./data/account] into Grakn ...
Traceback (most recent call last):
  File "C:\Miniconda\envs\py37_default\lib\site-packages\grakn\service\Session\TransactionService.py", line 161, in send
    response = next(self._response_iterator)
  File "C:\Miniconda\envs\py37_default\lib\site-packages\grpc\_channel.py", line 364, in __next__
    return self._next()
  File "C:\Miniconda\envs\py37_default\lib\site-packages\grpc\_channel.py", line 358, in _next
    raise self
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
        status = StatusCode.UNKNOWN
        details = "syntax error at line 1:
insert $account isa account, has balance 267.69, has account-number "DE82444435329779109646", has account-type "credit", has opening-date 2019-01-16T10:49:31.641721;


   ^
mismatched input '721' expecting {'match', 'define', 'undefine', 'insert', 'compute'}. Please check server logs for the stack trace."
        debug_error_string = "{"created":"@1586159124.776000000","description":"Error received from peer","file":"src/core/lib/surface/call.cc","file_line":1017,"grpc_message":"syntax error at line 1: \ninsert $account isa account, has balance 267.69, has account-number "DE82444435329779109646", has account-type "credit", has opening-date 2019-01-16T10:49:31.641721;\n

                                                         ^\nmismatched input '721' expecting {'match', 'define', 'undefine', 'insert', 'compute'}. Please check server logs for the stack trace.","grpc_status":2}"
>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "migrate.py", line 201, in <module>
    build_banking_graph(inputs)
  File "migrate.py", line 10, in build_banking_graph
    load_data_into_grakn(input, session)
  File "migrate.py", line 19, in load_data_into_grakn
    transaction.query(graql_insert_query)
  File "C:\Miniconda\envs\py37_default\lib\site-packages\grakn\client.py", line 131, in query
    return self._tx_service.query(query, infer)
  File "C:\Miniconda\envs\py37_default\lib\site-packages\grakn\service\Session\TransactionService.py", line 49, in query
    response = self._communicator.send(request)
  File "C:\Miniconda\envs\py37_default\lib\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.UNKNOWN
        details = "syntax error at line 1:
insert $account isa account, has balance 267.69, has account-number "DE82444435329779109646", has account-type "credit", has opening-date 2019-01-16T10:49:31.641721;


   ^
mismatched input '721' expecting {'match', 'define', 'undefine', 'insert', 'compute'}. Please check server logs for the stack trace."
        debug_error_string = "{"created":"@1586159124.776000000","description":"Error received from peer","file":"src/core/lib/surface/call.cc","file_line":1017,"grpc_message":"syntax error at line 1: \ninsert $account isa account, has balance 267.69, has account-number "DE82444435329779109646", has account-type "credit", has opening-date 2019-01-16T10:49:31.641721;\n

                                                         ^\nmismatched input '721' expecting {'match', 'define', 'undefine', 'insert', 'compute'}. Please check server logs for the stack trace.","grpc_status":2}"
>

 generated from request: query_req {
  query: "insert $account isa account, has balance 267.69, has account-number \"DE82444435329779109646\", has account-type \"credit\", has opening-date 2019-01-16T10:49:31.641721;"
}

Thanks for raising this issue, @amn41 will get back to you about it soon✨

Please also check out the docs and the forum in case your issue was raised there too 🤗
commented

@mschnyde What version of grakn are you using?

Hey @tabergma , thank you for the fast reply !

I'm running on rasa 1.7 and grakn-client 1.6 :)

commented

This repository requires Grakn 1.5.7 (grakn-client. 1.5.3). So I guess they changed something in Grakn 1.6 that lead to the error you are getting. Can you try with Grakn 1.5.7 and grakn-client 1.5.3? Otherwise, you need to update the migration script. This documentation page might help with that: https://dev.grakn.ai/docs/client-api/python

I used the Grakn 1.5.7 and still get the same error.

commented

I just double checked and the script is working for me. Let's double check the versions.
What do you get if you execute grakn server version? I get the following:

1.5.7

What do you get if you execute pip freeze | grep grakn? I get the following:

grakn-client==1.5.3

I am using Python 3.6.8.

@tabergma I faced the same errors like @mschnyde and I followed the steps you have mentioned.
when I execute grakn server version I get 1.7.1 and
when I execute pip freeze | grep grakn I get grakn-client==1.6.0 grakn-kglib==0.2.1
What would I miss?
I am using Python 3.7.6

commented

@Wickky The scripts in this repository only work with the versions I mentioned in my comment above (grakn server 1.5.7 and grakn-client 1.5.3). If you want to use a newer version of grakn you need to update the scripts. Otherwise, you need to make sure to use the same grakn versions as I do.

I received a similar error and fixed it.
When I received this error :

`    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.UNKNOWN
        details = "syntax error at line 1: 
insert $account isa account, has opening-date 2019-01-16T10:49:31.641515, has balance 267.69, has account-number "DE82444435329779109646", has account-type "credit";
                                                                     ^
mismatched input '515' expecting {'match', 'define', 'undefine', 'insert', 'compute'}. Please check server logs for the stack trace."
        debug_error_string = "{"created":"@1592435654.549771043","description":"Error received from peer","file":"src/core/lib/surface/call.cc","file_line":1017,"grpc_message":"syntax error at line 1: \ninsert $account isa account, has opening-date 2019-01-16T10:49:31.641515, has balance 267.69, has account-number "DE82444435329779109646", has account-type "credit";\n                                                                     ^\nmismatched input '515' expecting {'match', 'define', 'undefine', 'insert', 'compute'}. Please check server logs for the stack trace.","grpc_status":2}"
>

 generated from request: query_req {
  query: "insert $account isa account, has opening-date 2019-01-16T10:49:31.641515, has balance 267.69, has account-number \"DE82444435329779109646\", has account-type \"credit\";"

}`

It was because the format for 'opening-date' field in the /data/account.csv file did not match grakn's date formats. opening-date format seems to be:
yyyy-mm-ddThh:mm:ss.ffffff so I changed it to yyyy-mm-ddThh:mm:ss.fff and it worked.

grakn required one of the following formats:
yyyy-mm-dd
yyyy-mm-ddThh:mm
yyyy-mm-ddThh:mm:ss
yyyy-mm-ddThh:mm:ss.f
yyyy-mm-ddThh:mm:ss.ff
yyyy-mm-ddThh:mm:ss.fff

http://dev.grakn.ai/docs/schema/concepts#define-an-attribute

I guess moral of the story, even though it said syntax error, it was most likely a grakn syntax error, check your formats.