[Cubicweb] Migration issue

Christophe de Vienne christophe at unlish.com
Thu Apr 24 17:22:23 CEST 2014


Hi,

I am trying to migrate an instance from version 3.17.11 to 3.19.
When I run upgrade, I run very soon in the error bellow.

I anyone has some hints on what I can attempt it would be great.

The full error :

ctl upgrade unlish-dev --backup-db=n

Upgrading the instance unlish-dev
---------------------------------
-> migration needed from 0.9.0 to 0.12.0 for unlish
-> migration needed from 1.10.0 to 1.10.1 for blog
-> migration needed from 0.4.0 to 0.6.3 for bootstrap
-> migration needed from 1.9.1 to 1.10.0 for comment
-> migration needed from 1.15.0 to 1.16.0 for file
-> migration needed from 1.7.0 to 1.7.1 for link
-> migration needed from 3.17.11 to 3.19.0 for cubicweb
Execute
'/home/cdevienne/ws/unlish/dev-3.19/cubicweb/misc/migration/bootstrapmigration_repository.py'
? [Y/n/s(how)/a(bort)]:
Execute
'/home/cdevienne/ws/unlish/dev-3.19/cubicweb/misc/migration/3.18.0_Any.py'
? [Y/n/s(how)/a(bort)]:
Execute command: add_relation_definition('CWAttribute',
'add_permission', 'CWGroup') ? [Y/n/a(bort)/s(hell)]:
Traceback (most recent call last):
  File "/home/cdevienne/ws/unlish/dev-3.19/cubicweb/cwctl.py", line 162,
in run_arg
    status = cmdmeth(appid)
  File "/home/cdevienne/ws/unlish/dev-3.19/cubicweb/cwctl.py", line 786,
in upgrade_instance
    mih.migrate(vcconf, reversed(toupgrade), self.config)
  File
"/home/cdevienne/ws/unlish/dev-3.19/cubicweb/server/migractions.py",
line 179, in migrate
    super(ServerMigrationHelper, self).migrate(vcconf, toupgrade, options)
  File "/home/cdevienne/ws/unlish/dev-3.19/cubicweb/migration.py", line
181, in migrate
    self.cmd_process_script(script)
  File
"/home/cdevienne/ws/unlish/dev-3.19/cubicweb/server/migractions.py",
line 185, in cmd_process_script
    migrscript, funcname, *args, **kwargs)
  File "/home/cdevienne/ws/unlish/dev-3.19/cubicweb/migration.py", line
350, in cmd_process_script
    execfile(migrscript, scriptlocals)
  File
"/home/cdevienne/ws/unlish/dev-3.19/cubicweb/misc/migration/3.18.0_Any.py",
line 7, in <module>
    add_relation_definition('CWAttribute', 'add_permission', 'CWGroup')
  File "/home/cdevienne/ws/unlish/dev-3.19/cubicweb/migration.py", line
137, in <lambda>
    meth=meth)
  File "/home/cdevienne/ws/unlish/dev-3.19/cubicweb/migration.py", line
203, in interact
    return meth(*args, **kwargs)
  File
"/home/cdevienne/ws/unlish/dev-3.19/cubicweb/server/migractions.py",
line 1092, in cmd_add_relation_definition
    self.group_mapping()))
  File
"/home/cdevienne/ws/unlish/dev-3.19/cubicweb/server/schemaserial.py",
line 378, in execschemarql
    rset = execute(rql, kwargs, build_descr=False)
  File "/home/cdevienne/ws/unlish/dev-3.19/cubicweb/repoapi.py", line
129, in check_open
    return func(clt_cnx, *args, **kwargs)
  File "/home/cdevienne/ws/unlish/dev-3.19/cubicweb/repoapi.py", line
213, in execute
    rset = self._cnx.execute(*args, **kwargs)
  File "/home/cdevienne/ws/unlish/dev-3.19/cubicweb/server/session.py",
line 372, in wrapper
    return func(cnx, *args, **kwargs)
  File "/home/cdevienne/ws/unlish/dev-3.19/cubicweb/server/session.py",
line 382, in check_open
    return func(cnx, *args, **kwargs)
  File "/home/cdevienne/ws/unlish/dev-3.19/cubicweb/server/session.py",
line 1020, in execute
    rset = self._execute(self, rql, kwargs, build_descr)
  File "/home/cdevienne/ws/unlish/dev-3.19/cubicweb/server/querier.py",
line 593, in execute
    results = plan.execute()
  File "/home/cdevienne/ws/unlish/dev-3.19/cubicweb/server/querier.py",
line 177, in execute
    result = step.execute()
  File
"/home/cdevienne/ws/unlish/dev-3.19/cubicweb/server/ssplanner.py", line
454, in execute
    result = self.plan.insert_entity_defs()
  File "/home/cdevienne/ws/unlish/dev-3.19/cubicweb/server/querier.py",
line 423, in insert_entity_defs
    for edef in row])
  File
"/home/cdevienne/ws/unlish/dev-3.19/cubicweb/server/repository.py", line
1190, in glob_add_entity
    self.add_info(cnx, entity, source, extid)
  File
"/home/cdevienne/ws/unlish/dev-3.19/cubicweb/server/repository.py", line
1072, in add_info
    self.system_source.add_info(session, entity, source, extid)
  File
"/home/cdevienne/ws/unlish/dev-3.19/cubicweb/server/sources/native.py",
line 898, in add_info
    self._handle_insert_entity_sql(cnx, self.sqlgen.insert('entities',
attrs), attrs)
  File
"/home/cdevienne/ws/unlish/dev-3.19/cubicweb/server/sources/native.py",
line 713, in doexec
    cursor.execute(str(query), args)
IntegrityError: null value in column "source" violates not-null constraint
DETAIL:  Failing row contains (540878, CWRelation, null, system, null,
null).

instance unlish-dev not upgraded: null value in column "source" violates
not-null constraint
DETAIL:  Failing row contains (540878, CWRelation, null, system, null,
null).



Christophe



More information about the Cubicweb mailing list