[Cubicweb] cprotocol is None

Jinpeng Li mr.li.jinpeng at gmail.com
Thu Mar 5 16:31:32 CET 2015


Dear all,

Finally I manager insert this relation by revert the cube container to
older version. Maybe there is a version problem between different cubes.

Best,
Jinpeng

On Thu, Mar 5, 2015 at 1:38 PM, Jinpeng Li <mr.li.jinpeng at gmail.com> wrote:

> 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>
>   File
> "/home/cati/brainvisa/builds/catidb-release/lib/python2.7/site-packages/cubicweb/server/session.py",
> line 381, in check_open
>     return func(cnx, *args, **kwargs)
>   File
> "/home/cati/brainvisa/builds/catidb-release/lib/python2.7/site-packages/cubicweb/server/session.py",
> line 1102, in commit
>     operation.handle_event('precommit_event')
>   File
> "/home/cati/brainvisa/builds/catidb-release/lib/python2.7/site-packages/cubicweb/server/hook.py",
> line 770, in handle_event
>     getattr(self, event)()
>   File
> "/home/cati/brainvisa/builds/catidb-release/share/cubicweb/cubes/container/hooks.py",
> 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
> below.
>
> ```
> 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='??',
> inlined=True)
>     results_files = SubjectRelation(('File', 'FileSet', 'ExternalFile'),
>                                                      cardinality='**',
> composite='subject')
>      configuration_files = SubjectRelation(('File', 'FileSet',
> 'ExternalFile'),
>
> 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.
>
> Best,
> Jinpeng
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubicweb.org/pipermail/cubicweb/attachments/20150305/1fbd579a/attachment-0165.html>


More information about the Cubicweb mailing list