quarkusio/quarkus · error · RuntimeException

unknown type ${set}

Error message

unknown type ${set}

What it means

While writing the generated bytecode, writeBytecode() iterates recorded instructions and only knows how to emit StoredMethodCall and NewInstance. Any other BytecodeInstruction implementation reaching this loop is a Quarkus framework bug, since no other instruction types are expected here.

Source

Thrown at core/deployment/src/main/java/io/quarkus/deployment/recording/BytecodeRecorderImpl.java:578

                        }
                    }
                });
            } else if (set instanceof NewInstance) {
                context.writeInstruction(new InstructionGroup() {
                    @Override
                    public void write(MethodContext context, MethodCreator method, ResultHandle array) {
                        //this instruction creates a new instance
                        //it just goes in the startup context
                        NewInstance ni = (NewInstance) set;
                        ResultHandle val = method.newInstance(ofConstructor(ni.theClass));
                        ResultHandle rv = method.newInstance(ofConstructor(RuntimeValue.class, Object.class), val);
                        method.invokeVirtualMethod(
                                ofMethod(StartupContext.class, "putValue", void.class, String.class, Object.class),
                                method.getMethodParam(0), method.load(ni.proxyId), rv);
                    }
                });
            } else {
                throw new RuntimeException("unknown type " + set);
            }

        }
        context.close();
        mainMethod.returnValue(null);
        var createArray = file.getMethodCreator(createArrayDescriptor);
        createArray.returnValue(createArray.newArray(Object.class, deferredParameterCount));
        file.close();

    }

    /**
     * Returns a representation of a serialized parameter.
     */
    private DeferredParameter loadObjectInstance(Object param, Map<Object, DeferredParameter> existing, Class<?> expectedType,
            boolean relaxedValidation) {
        if (loadComplete) {
            throw new RuntimeException("All parameters have already been loaded, it is too late to call loadObjectInstance");

View on GitHub (pinned to e1c734241f)

Solutions

  1. Rebuild Quarkus core with a clean state (mvn clean install) to rule out mixed module versions
  2. Check which BytecodeInstruction type appears in the message and search Quarkus source for where it is added
  3. If using released Quarkus, report a bug at github.com/quarkusio/quarkus with the full stack trace
  4. If you added the instruction type yourself, add a corresponding branch in the writeBytecode loop to emit it

Example fix

// before
} else {
    throw new RuntimeException("unknown type " + set);
}
// after
} else if (set instanceof MyInstruction mi) {
    context.writeInstruction((context, method, array) -> emit(mi, method));
} else {
    throw new RuntimeException("unknown type " + set);
}
Defensive patterns

Strategy: try-catch

Try / catch

try {
    bytecodeRecorderImpl.writeBytecode(...);
} catch (RuntimeException e) {
    if (e.getMessage().startsWith("unknown type")) {
        throw new IllegalStateException("Quarkus internal bytecode instruction bug — report with stack trace", e);
    }
    throw e;
}

Prevention

When it happens

Trigger: A BytecodeInstruction subclass other than StoredMethodCall or NewInstance was added to storedMethodCalls. For users this can only occur when using an unreleased/patched Quarkus core or an internal API that injects custom instructions.

Common situations: Developers hacking on Quarkus core or using an internal fork that adds new instruction types; mismatched core/deployment module versions from a broken local build.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/8793dbfdee48b760. Report an issue: GitHub.