pinpoint-apm/pinpoint · error · InstrumentException

Failed to add getter

Error message

Failed to add getter: ${getterClassName}

What it means

Catch-all guard in ASMClass.addGetter: an unexpected exception during getter analysis or bytecode generation is wrapped as InstrumentException with the getter class name; the underlying cause is chained.

Solutions

  1. Inspect the chained cause for the real failure (analysis error or ASM error)
  2. Verify the getter class follows the expected getter convention
  3. Upgrade the profiler/agent version for instrumentation fixes
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClass.java:317 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/bdeb70cb7d771d57. Report an issue: GitHub.

Appendix: source

Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClass.java:317

            final GetterAnalyzer.GetterDetails getterDetails = GetterAnalyzer.instance().analyze(getterClass);
            final ASMFieldNodeAdapter fieldNode = this.classNode.getField(fieldName, null);
            if (fieldNode == null) {
                throw new IllegalArgumentException("Not found field. name=" + fieldName);
            }
            Type fieldType = getterDetails.getFieldType();
            if (!fieldNode.getJavaType().equals(fieldType)) {
                throw new IllegalArgumentException("different return type. return=" + fieldType + ", field=" + fieldNode.getJavaType());
            }

            boolean modified = this.classNode.addGetterMethod(getterDetails.getGetter().getName(), fieldNode);
            modified |= this.classNode.addInterface(getterClass.getName());
            if (modified) {
                setModified(true);
            } else if (logger.isDebugEnabled()) {
                logger.debug("Skip addGetter, getter already declared. class={}, getter={}", getName(), getterClass.getName());
            }
        } catch (Exception e) {
            throw new InstrumentException("Failed to add getter: " + getterClass.getName(), e);
        }
    }

    @Override
    public void addSetter(Class<?> setterClass, String fieldName) throws InstrumentException {
        this.addSetter(setterClass, fieldName, false);
    }

    @Override
    public void addSetter(Class<?> setterClass, String fieldName, boolean removeFinal) throws InstrumentException {
        Objects.requireNonNull(setterClass, "setterClass");
        try {
            final SetterAnalyzer.SetterDetails setterDetails = SetterAnalyzer.instance().analyze(setterClass);
            final ASMFieldNodeAdapter fieldNode = this.classNode.getField(fieldName, null);
            if (fieldNode == null) {
                throw new IllegalArgumentException("Not found field. name=" + fieldName);
            }

View on GitHub (pinned to 744c3d3075)