pentaho/pentaho-kettle · error · pentaho.lang.ArgumentRequiredError

Argument 'id' is required.

Error message

Argument 'id' is required.

What it means

util.parseId parses a versioned module identifier string into its package/version parts. Passing null or undefined throws ArgumentRequiredError('id'). It is the private entry point for all id parsing in the module util.

Solutions

  1. Always pass a non-null id string to parseId.
  2. Default or short-circuit before the call: if(id) parsed = util.parseId(id).
  3. Fix the upstream source of the id (config, descriptor, lookup) so it cannot be null.

Example fix

// before
var parts = util.parseId(id);
// after
if(id != null) { var parts = util.parseId(id); }
Defensive patterns

Strategy: validation

Validate before calling

if (id == null) { id = defaultModuleId; }
var parsed = util.parseId(id);

Type guard

function isModuleId(x) { return typeof x === 'string' && x.length > 0; }

Try / catch

try { return util.parseId(id); } catch (e) { if (/Argument 'id' is required/.test(e.message)) { return null; } throw e; }

Prevention

When it happens

Trigger: Calling pentaho.module.util.parseId() or parseId(null/undefined); passing a variable that failed to load from config or a lookup map.

Common situations: Module metadata lookups where the id came from an optional config field; iterating collections that contain null placeholders; tests omitting the id.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — 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/ade76a117b579ea8. Report an issue: GitHub.

Appendix: source

Thrown at plugins/core-ui/src/main/resources/app/pentaho/module/util.js:155

     * Parses a module identifier produced by the Web Package system.
     *
     * It is assumed to have a structure similar to:
     *
     * * `@hitachivantara/pentaho-core@1.2.20/pentaho/visual/models/Bar`
     *
     * The package name and version part is optional and when not present,
     * the whole `package` property will be returned null.
     *
     * @param {string} id - The module identifier.
     * @return {({package: ?({name: string, version}), name: string})} The parsed module information.
     *
     * @throws {pentaho.lang.ArgumentInvalidError} When the module identifier has an invalid syntax.
     *
     * @private
     */
    parseId: function(id) {
      if(id == null) {
        throw new ArgumentRequiredError("id");
      }

      var match = reVersionedModuleId.exec(id);
      // assert match !== null
      return {
        package: match[1] ? {name: match[1], version: match[2]} : null,
        name: match[3]
      };
    }
  };

  return util;

  /**
   * Gets a module map used to resolve the dependencies of a given module.
   *
   * @param {?string|undefined} forId - The identifier of the module for which the module map is desired.
   *

View on GitHub (pinned to f3058517a1)