pentaho/pentaho-kettle · error · ArgumentInvalidError

A module with id or alias

Error message

A module with id or alias '{idOrAlias}' is not defined.

What it means

pentaho.lang.ArgumentInvalidError thrown by MetaService.get when the module with the given id or alias is not defined and keyArgs.assertDefined is true. It is the explicit opt-in variant of returning null: callers asking for a hard guarantee get an error instead.

Solutions

  1. Verify the module id/alias and register/define it before calling get.
  2. Load the module that defines it via require before querying the meta service.
  3. If absence is acceptable, omit assertDefined and handle the null return.

Example fix

// before
var t = metaService.get("pentaho/visaul/models/bar", {assertDefined: true});
// after
var t = metaService.get("pentaho/visual/models/bar", {assertDefined: true});
Defensive patterns

Strategy: try-catch

Validate before calling

if(metaService.get(idOrAlias) === null) {
  // module not defined; register or load before proceeding
}

Type guard

null

Try / catch

try { m = metaService.get(id, {assertDefined: true}); } catch(e) { if(/is not defined/.test(e.message)) { m = null; /* fallback path */ } else { throw e; } }

Prevention

When it happens

Trigger: Calling metaService.get(idOrAlias, {assertDefined: true}) (or APIs that pass assertDefined, like type()) with an id/alias that has never been registered.

Common situations: Typos in module ids; accessing a type before its defining module loaded; plugin not installed in the environment; version change where a module id was renamed.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/80c12ae6e9127f4d. Report an issue: GitHub.

Appendix: source

Thrown at plugins/core-ui/src/main/resources/app/pentaho/_core/module/MetaService.js:204

        if(module.alias !== null) {
          this.__moduleMap[module.alias] = module;
        }
      },

      get: function(idOrAlias, keyArgs) {

        var module = this.__get(idOrAlias);

        if(module === null) {
          if(O.getOwn(keyArgs, "createIfUndefined", false)) {
            // `resolver` is not used when there is no type.
            module = new core.InstanceModuleMeta(idOrAlias, {}, null);

            this.__registerModule(module);

          } else if(O.getOwn(keyArgs, "assertDefined", false)) {
            throw new ArgumentInvalidError(
              "idOrAlias",
              "A module with id or alias '" + idOrAlias + "' is not defined.");
          }
        }

        return module;
      },

      getId: function(idOrAlias) {
        var module = this.get(idOrAlias);
        return module && module.id;
      },

      getInstancesOf: function(typeIdOrAlias) {

        var instances = __createModulesList();

        var type = __getTypeModule(this, typeIdOrAlias, "typeIdOrAlias");

View on GitHub (pinned to f3058517a1)