cubicweb #4525069 unique_together error [rejected]

traceback

root@host:/etc# cubicweb-ctl db-init app -d

Initializing the system database
--------------------------------
-> dropping tables (first pass) [====================]
-> dropping tables (second pass) [====================]
-> creating tables  [====================]
-> inserting default user and default groups.
-> installing /usr/lib/python2.7/dist-packages/cubicweb/schemas/_regproc.postgres.sql
-> installing /usr/share/cubicweb/cubes/addressbook/schema/_regproc.postgres.sql
-> storing the schema in the database  [====================]
Traceback (most recent call last):
File "/usr/bin/cubicweb-ctl", line 4, in <module>
  run(sys.argv[1:])
File "/usr/lib/python2.7/dist-packages/cubicweb/cwctl.py", line 1110, in run
  CWCTL.run(args)
File "/usr/lib/pymodules/python2.7/logilab/common/clcommands.py", line 134, in run
  sys.exit(command.main_run(args, rcfile))
File "/usr/lib/pymodules/python2.7/logilab/common/clcommands.py", line 263, in main_run
  self.run(args)
File "/usr/lib/python2.7/dist-packages/cubicweb/server/serverctl.py", line 459, in run
  init_repository(config, drop=self.config.drop)
File "/usr/lib/python2.7/dist-packages/cubicweb/server/__init__.py", line 300, in init_repository
  initialize_schema(config, schema, handler)
File "/usr/lib/python2.7/dist-packages/cubicweb/server/__init__.py", line 337, in initialize_schema
  mhandler.cmd_exec_event_script('post%s' % event, cube)
File "/usr/lib/python2.7/dist-packages/cubicweb/server/migractions.py", line 352, in cmd_exec_event_script
  return self.cmd_process_script(apc, funcname, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/cubicweb/server/migractions.py", line 184, in cmd_process_script
  migrscript, funcname, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/cubicweb/migration.py", line 350, in cmd_process_script
  execfile(migrscript, scriptlocals)
File "/usr/share/cubicweb/cubes/app/migration/postcreate.py", line 73, in <module>
  last_edited=datetime.now())
File "/usr/lib/python2.7/dist-packages/cubicweb/migration.py", line 137, in <lambda>
  meth=meth)
File "/usr/lib/python2.7/dist-packages/cubicweb/migration.py", line 203, in interact
  return meth(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/cubicweb/server/migractions.py", line 1346, in cmd_create_entity
  entity = self.cnx.create_entity(etype, **kwargs)
File "/usr/lib/python2.7/dist-packages/cubicweb/req.py", line 175, in create_entity
  return cls.cw_instantiate(self.execute, **kwargs)
File "/usr/lib/python2.7/dist-packages/cubicweb/entity.py", line 521, in cw_instantiate
  created = execute(rql, qargs).get_entity(0, 0)
File "/usr/lib/python2.7/dist-packages/cubicweb/repoapi.py", line 129, in check_open
  return func(clt_cnx, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/cubicweb/repoapi.py", line 213, in execute
  rset = self._cnx.execute(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/cubicweb/server/session.py", line 371, in wrapper
  return func(cnx, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/cubicweb/server/session.py", line 381, in check_open
  return func(cnx, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/cubicweb/server/session.py", line 1023, in execute
  rset = self._execute(self, rql, kwargs, build_descr)
File "/usr/lib/python2.7/dist-packages/cubicweb/server/querier.py", line 593, in execute
  results = plan.execute()
File "/usr/lib/python2.7/dist-packages/cubicweb/server/querier.py", line 177, in execute
  result = step.execute()
File "/usr/lib/python2.7/dist-packages/cubicweb/server/ssplanner.py", line 454, in execute
  result = self.plan.insert_entity_defs()
File "/usr/lib/python2.7/dist-packages/cubicweb/server/querier.py", line 423, in insert_entity_defs
  for edef in row])
File "/usr/lib/python2.7/dist-packages/cubicweb/server/repository.py", line 1189, in glob_add_entity
  userhdlr.raise_user_exception()
File "/usr/lib/python2.7/dist-packages/cubicweb/entities/adapters.py", line 363, in raise_user_exception
  rtypes = self.exc.rtypes
File "/usr/lib/pymodules/python2.7/logilab/common/decorators.py", line 155, in __get__
  val = self.wrapped(inst)
File "/usr/lib/python2.7/dist-packages/cubicweb/_exceptions.py", line 91, in rtypes
  cstr = self.session.find('CWUniqueTogetherConstraint', name=cstrname).one()
File "/usr/lib/python2.7/dist-packages/cubicweb/rset.py", line 452, in one
  raise NoResultError("No row was found for one()")
cubicweb._exceptions.NoResultError: No row was found for one()

It seems to come from the fact that there is a unique_together constraint on a (attr,relation) where relationship is inlined but ambiguous (it has several possible objects).

priorityimportant
typebug
done in<not specified>
load0.000
load left0.000
closed by<not specified>