Skip to content

iTop 3.3.0 — CLI upgrade fails with a misleading error when selected_modules is empty #1058

Open

Description

@miguelbezerra

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

  1. Restore an existing iTop 3.2 database into a fresh MariaDB.
  2. Point a fresh iTop 3.3.0 install at that database.
  3. Run:
    php setup/unattended-install/unattended-install.php --param-file=upgrade.xml --install=1
    
    where upgrade.xml has <mode>upgrade</mode> and an empty <selected_modules>.
  4. 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_rights node then has only <profiles> and no
    top-level <groups>
    , because itop-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

  1. In upgrade mode, auto-detect the modules of the previous environment (e.g. from
    the previous env-production/loaded_modules or from the DB), instead of requiring the
    caller to re-list them; or
  2. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions