Skip to content
This repository was archived by the owner on Jul 28, 2018. It is now read-only.
This repository was archived by the owner on Jul 28, 2018. It is now read-only.

bcdb: fail to load schema when zdb is in user mode #55

@zaibon

Description

@zaibon

j.clients.zdb/zrobot.toml

addr = 'localhost'
adminsecret_ = ''
encryptionkey_ = ''
mode = 'user'
port = '9900'
secrets_ = '

j.servers.zdb/zrobot.toml

addr = '127.0.0.1'
adminsecret_ = ''
mode = 'user'
path = '/opt/var/zdb/zrobot'
port = 9900
verbose = true

Then trying to load bcdb:

In [1]: cl = j.clients.zdb.get('zrobot')
In [2]: db = j.data.bcdb.get(cl)
In [3]: db.tables_get('/opt/code/github/zero-os/0-robot/zerorobot/storage/')
---------------------------------------------------------------------------
Input                                     Traceback (most recent call last)

/usr/local/bin/js9 in <module>()
----> 1 db.tables_get('/opt/code/github/zero-os/0-robot/zerorobot/storage/')

/opt/code/github/rivine/recordchain/JumpScale9RecordChain/data/bcdb/BCDB.py in tables_get(self, schema_path)
     38         if j.sal.fs.isDir(schema_path):
     39             for path in j.sal.fs.listFilesInDir(schema_path, recursive=False, filter="schema*"):
---> 40                 self.tables_get(schema_path=path)
     41         else:
     42             C=j.sal.fs.fileGetContents(schema_path)

/opt/code/github/rivine/recordchain/JumpScale9RecordChain/data/bcdb/BCDB.py in tables_get(self, schema_path)
     44             for schema in schemas:
     45                 if schema.name!="":
---> 46                     t = self.table_get(schema=schema,name=schema.name)
     47                 # elif schema.url!="":
     48                 #     t = self.table_get(schema=schema,name=schema.url.replace(".","_"))

/opt/code/github/rivine/recordchain/JumpScale9RecordChain/data/bcdb/BCDB.py in table_get(self, schema, name)
     18             return self.tables[name]
     19 
---> 20         t = BCDBTable(self,schema=schema,name=name)
     21         self.tables[name]=t
     22         return t

/opt/code/github/rivine/recordchain/JumpScale9RecordChain/data/bcdb/BCDBTable.py in __init__(self, bcdb, schema, name)
     38         self._index_key = "index:%s:%s" % (self.bcdb.zdbclient.instance, self.name)
     39 
---> 40         self.index_load()
     41 
     42     def index_delete(self):

/opt/code/github/rivine/recordchain/JumpScale9RecordChain/data/bcdb/BCDBTable.py in index_load(self)
     55                 self._index(index, id)
     56 
---> 57         self.db.iterate(iload)
     58         self.logger.debug("build index done")
     59 

/opt/code/github/rivine/recordchain/JumpScale9RecordChain/clients/zdb/ZDBClientNS.py in iterate(self, method, key_start, direction, nrrecords, _keyonly, result)
    213         if result is None:
    214             result = []
--> 215         keyb = self._key_get(key_start, set=False)
    216         if direction == "forward":
    217             CMD = "SCANX"

/opt/code/github/rivine/recordchain/JumpScale9RecordChain/clients/zdb/ZDBClientNS.py in _key_get(self, key, set)
     83         elif self.mode == "user":
     84             if key in ["", None]:
---> 85                 raise j.exceptions.Input("key cannot be None or empty string")
     86         return key
     87 

Input: ERROR: key cannot be None or empty string ((type:input.error)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions