Repository navigation
iTop 3.3.0 — CLI upgrade fails with a misleading error when selected_modules is empty #1058
Description
Are you willing to create (at a later stage) a PR for that?
No
iTop version
3.3.0
PHP version
8.3
Reproduction procedure
Summary
When performing a CLI upgrade of an existing iTop database with
setup/unattended-install/unattended-install.php in <mode>upgrade</mode>, if the
response file's <selected_modules> section is empty, the installer compiles only
the core (core, application, dictionaries) and aborts the compilation with:
Error: Missing unique tag: groups in: /itop_design/user_rights
The message points the reader toward a datamodel/extension problem, but the actual
cause is that no datamodel modules were selected — in particular itop-structure,
which provides the <user_rights><groups/></user_rights> skeleton the compiler requires
(MFCompiler::CompileUserRights() calls GetUniqueElement('groups') unconditionally).
Environment
- iTop 3.3.0 Community (GA, official tarball
iTop-3.3.0-21411.zip) - PHP 8.3, MariaDB 11.x, Debian (Docker)
- Upgrade of a database originally built on iTop 3.2.x (clone + wizard method)
- Extensions present: TeemIp, combodo-vsphere-datamodel (not relevant — see below)
Steps to reproduce
- Restore an existing iTop 3.2 database into a fresh MariaDB.
- Point a fresh iTop 3.3.0 install at that database.
- Run:
where
php setup/unattended-install/unattended-install.php --param-file=upgrade.xml --install=1upgrade.xmlhas<mode>upgrade</mode>and an empty<selected_modules>. - Compilation aborts:
Missing unique tag: groups in: /itop_design/user_rights.
Diagnosis (what actually happens)
- With empty
selected_modules, the resulting consolidated datamodel
(data/datamodel-production-build.xml) contains only 3 loaded modules
(dictionaries,core,application). - The consolidated
/itop_design/user_rightsnode then has only<profiles>and no
top-level<groups>, becauseitop-structure(which seeds
<user_rights><groups/></user_rights>) was never loaded. MFCompiler::CompileUserRights()calls$oUserRightsNode->GetUniqueElement('groups')
unconditionally, which throws "Missing unique tag" when no<groups>exists.- Confirmed by bisection: removing all third-party extensions (TeemIp, vSphere) does
not change the error — it is not extension-related.
Workaround
Provide the explicit list of modules to install in <selected_modules> (the exact set
that was installed in the source instance). Once itop-structure and the other datamodel
modules are included, compilation succeeds and the upgrade completes normally.
Suggested fix
- In
upgrademode, auto-detect the modules of the previous environment (e.g. from
the previousenv-production/loaded_modules or from the DB), instead of requiring the
caller to re-list them; or - Fail early with a clear, actionable message such as "No datamodel modules selected
for upgrade — expected at least itop-structure" instead of the confusing
"Missing unique tag: groups".
Additional information (if needed)
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsOpen
Activity