[Cubicweb] cprotocol is None

Jinpeng Li mr.li.jinpeng at gmail.com
Thu Mar 5 13:38:57 CET 2015

Dear all,

When I try to insert a relation configuration_files, I get an error message
"container = cprotocol.related_container AttributeError: 'NoneType' object
has no attribute 'related_container'". Any clue to this error?

cati at cati:~$ cubicweb-ctl shell catiweb
>>> rql_str = 'INSERT FileSet X:X name %(name)s,X related_study S,X
belong_to S WHERE S eid %(study)s'
>>> data = {'study': 324998, 'name': u'keosys_20150127_150248.actions.json'}
>>> ret = session.execute(rql_str, data)
>>> fileset_eid = ret[0][0]
>>> # There is error when commit this rql
>>> rql_str = 'INSERT ProcessingRun X:X name %(name)s,X version
%(version)s,X datetime %(datetime)s,X configuration_files FS,X belong_to S
WHERE FS eid %(fileset)s,S eid %(study)s'
>>> data = {'datetime': u'2015/01/27[15:02]', 'study': 324998, 'version':
u'1.0', 'fileset': fileset_eid, 'name': u'keosys'}
>>> ret = session.execute(rql_str, data)
>>> session.commit()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
line 381, in check_open
    return func(cnx, *args, **kwargs)
line 1102, in commit
line 770, in handle_event
    getattr(self, event)()
line 173, in precommit_event
    container = cprotocol.related_container
AttributeError: 'NoneType' object has no attribute 'related_container'


When I remove "X configuration_files FS" and "FS eid %(fileset)s", I can
commit without any error message. The schema of ProcessingRun is defined as

class ProcessingRun(EntityType):
    name = String(maxsize=256)
    tool = String(maxsize=256)
    datetime = Date()
    category = String(maxsize=256)
    version = String(maxsize=64)
    parameters = String(maxsize=256)
    note = RichString(fulltextindexed=True)
    followed_by = SubjectRelation('ProcessingRun' , cardinality='??',
    results_files = SubjectRelation(('File', 'FileSet', 'ExternalFile'),
     configuration_files = SubjectRelation(('File', 'FileSet',

cardinality='**', composite='subject')

I check the all the relations of ProcessingRun, and I try to add the
relation "results_files". It didn't work neither.

The cubicweb/cubes/container is up to date with the tag
cubicweb-container-version-2.7.0. The old version of container didn't work,
so I updated the container cube. However, it didn't work nether.

Thanks for all the answers in advance.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubicweb.org/pipermail/cubicweb/attachments/20150305/b984b389/attachment-0185.html>

More information about the Cubicweb mailing list