cubicweb #16130960 CW 3.24.0 migration crash [validation pending]

drop_entity_type('CWSourceSchemaConfig') crashes with following traceback:

Execute command: drop_entity_type('CWSourceSchemaConfig') ? [Y/n/a(bort)/s(hell)]:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/cwctl.py", line 145, in run_arg
    status = cmdmeth(appid)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/cwctl.py", line 758, in upgrade_instance
    mih.migrate(vcconf, reversed(toupgrade), self.config)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/migractions.py", line 176, in migrate
    super(ServerMigrationHelper, self).migrate(vcconf, toupgrade, options)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/migration.py", line 183, in migrate
    self.cmd_process_script(script)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/migractions.py", line 181, in cmd_process_script
    migrscript, funcname, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/migration.py", line 359, in cmd_process_script
    exec(code, scriptlocals)
  File "/usr/local/share/cubicweb/cubes/nemo/migration/0.12.0_Any.py", line 13, in <module>
    drop_entity_type('CWSourceSchemaConfig')
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/migration.py", line 142, in <lambda>
    meth=meth)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/migration.py", line 205, in interact
    return meth(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/migractions.py", line 923, in cmd_drop_entity_type
    self.commit()
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/migractions.py", line 287, in commit
    self.cnx.commit()
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/session.py", line 187, in check_open
    return func(cnx, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/session.py", line 873, in commit
    operation.handle_event('precommit_event')
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/hook.py", line 769, in handle_event
    getattr(self, event)()
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/hooks/syncschema.py", line 656, in precommit_event
    execute('DELETE CWRType X WHERE X eid %(x)s', {'x': rschema.eid})
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/session.py", line 187, in check_open
    return func(cnx, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/session.py", line 801, in execute
    rset = self._execute(self, rql, kwargs, build_descr)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/statsd_logger.py", line 121, in __call__
    return self.callable(*args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/querier.py", line 606, in execute
    results = plan.execute()
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/querier.py", line 187, in execute
    result = step.execute()
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/ssplanner.py", line 452, in execute
    cnx.repo.glob_delete_entities(cnx, todelete)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/repository.py", line 947, in glob_delete_entities
    self.hm.call_hooks('before_delete_entity', cnx, entities=entities)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/hook.py", line 416, in call_hooks
    registry.call_hooks(event, cnx, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/hook.py", line 337, in call_hooks
    hook()
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/hooks/integrity.py", line 315, in __call__
    {'c': eid})
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/session.py", line 187, in check_open
    return func(cnx, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/session.py", line 801, in execute
    rset = self._execute(self, rql, kwargs, build_descr)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/statsd_logger.py", line 121, in __call__
    return self.callable(*args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/querier.py", line 606, in execute
    results = plan.execute()
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/querier.py", line 187, in execute
    result = step.execute()
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/ssplanner.py", line 448, in execute
    results = self.execute_child()
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/ssplanner.py", line 313, in execute_child
    return self.children[0].execute()
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/ssplanner.py", line 361, in execute
    result = source.syntax_tree_search(cnx, union, args, cachekey)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/sources/native.py", line 529, in syntax_tree_search
    cursor = cnx.system_sql(sql, args)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/session.py", line 187, in check_open
    return func(cnx, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/session.py", line 938, in system_sql
    return source.doexec(self, sql, args, rollback=rollback_on_failure)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/statsd_logger.py", line 121, in __call__
    return self.callable(*args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/cubicweb/server/sources/native.py", line 683, in doexec
    cursor.execute(str(query), args)
ProgrammingError: relation "cw_cwsourceschemaconfig" does not exist
LINE 2: FROM cw_CWSourceSchemaConfig AS _X
             ^

instance app not upgraded: relation "cw_cwsourceschemaconfig" does not exist
LINE 2: FROM cw_CWSourceSchemaConfig AS _X
           ^

For the moment, I commented it out as a temporary workaround.

prioritynormal
typebug
done in3.24.1
load left0.000
closed by#4a387179fa33 [migration] Drop cw_schema relation first
patch[migration] Drop cw_schema relation first [applied][hooks] Delete some properties cached on entities schema on schema updates [applied]