pentaho/pentaho-kettle · error · ArgumentRequiredError

Annotation

Error message

Annotation

What it means

pentaho.lang.ArgumentRequiredError thrown by getAnnotationId in Meta.js when the `Annotation` argument is nully (null or undefined). The helper needs an annotation class/id to resolve metadata and cannot proceed without it. It is surfaced through the public annotationId API.

Solutions

  1. Ensure the value passed to annotationId/getAnnotationId is a defined annotation class or annotation id string.
  2. Check that the module providing the annotation resolved successfully (not undefined).
  3. If the argument is legitimately optional, guard the call site before invoking.

Example fix

// before
var id = metaService.annotationId(possiblyMissingAnnotation);
// after
if(possiblyMissingAnnotation != null) {
  var id = metaService.annotationId(possiblyMissingAnnotation);
}
Defensive patterns

Strategy: validation

Validate before calling

if(annotation == null) throw new Error("annotation argument is required");
metaService.annotationId(annotation);

Type guard

function hasAnnotation(a) { return a != null; }

Try / catch

try { id = metaService.annotationId(ann); } catch(e) { if(e.name === "pentaho.lang.ArgumentRequiredError") { id = null; } else { throw e; } }

Prevention

When it happens

Trigger: Calling metaService.annotationId(null), annotationId(undefined), or passing a variable that was never assigned / returned undefined from a failed lookup.

Common situations: Passing the result of an optional require/resolve that came back undefined; forgetting to import the annotation class; calling annotationId before module loading completed.

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/343eafdc54fe4204. Report an issue: GitHub.

Appendix: source

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

     */
    function createErrorAnnotationNotAvailable(moduleId, annotationId) {
      return new OperationInvalidError(
        "The annotation '" + annotationId + "' is not available in module '" + moduleId + "'.");
    }

    /**
     * Gets the identifier of an annotation, given its type or its identifier.
     *
     * @param {Class.<pentaho.module.Annotation>|string} Annotation - The annotation class or identifier.
     *
     * @return {string} The annotation identifier.
     *
     * @throws {pentaho.lang.ArgumentRequiredError} When the `Annotation` argument is _nully_.
     * @throws {pentaho.lang.ArgumentRequiredError} When the `Annotation` argument does not have an `id` property.
     */
    function getAnnotationId(Annotation) {
      if(Annotation == null) {
        throw new ArgumentRequiredError("Annotation");
      }

      if(typeof Annotation === "string") {
        return Annotation;
      }

      var annotationId = Annotation.id;
      if(annotationId == null) {
        throw new ArgumentRequiredError("Annotation.id");
      }

      return annotationId;
    }
    // endregion
  };
});

View on GitHub (pinned to f3058517a1)