{"record":{"id":"ead1aaee5de0bbf1","repo":"apache/skywalking","slug":"failed-to-load-static-lal-rules","errorCode":null,"errorMessage":"Failed to load static LAL rules.","messagePattern":"Failed to load static LAL rules\\.","errorType":"exception","errorClass":"ModuleStartException","httpStatus":null,"severity":"critical","filePath":"oap-server/analyzer/log-analyzer/src/main/java/org/apache/skywalking/oap/log/analyzer/v2/provider/LogAnalyzerModuleProvider.java","lineNumber":172,"sourceCode":"    public void start() throws ServiceNotProvidedException, ModuleStartException {\n        MeterSystem meterSystem = getManager().find(CoreModule.NAME).provider().getService(MeterSystem.class);\n        for (final var rule : moduleConfig.malConfigs()) {\n            // Use the catalog:name key convention so a runtime-rule /addOrUpdate for the same\n            // (catalog, name) replaces this static entry in place instead of running two\n            // converters against the same sample stream.\n            final MetricConvert convert = new MetricConvert(rule, meterSystem);\n            addOrReplaceMetricConvert(\"log-mal-rules:\" + rule.getName(), convert);\n            // Static-loader debug-binding publish — no-op when dsl-debugging is disabled.\n            MalStaticBindingHook.publish(\"log-mal-rules\", rule.getName(), convert);\n        }\n        try {\n            // Light up the Factory now that all peer modules are past prepare:\n            // loadStaticRules calls compile() which constructs RecordSinkListener.Factory\n            // which calls moduleManager.find() — only safe outside prepare.\n            this.factory.loadStaticRules();\n            logAnalyzerService.addListenerFactory(this.factory);\n        } catch (final Exception e) {\n            throw new ModuleStartException(\"Failed to load static LAL rules.\", e);\n        }\n    }\n\n    @Override\n    public void notifyAfterCompleted() throws ServiceNotProvidedException {\n\n    }\n\n    /**\n     * Live snapshot of active MAL converters for {@code log-mal-rules}. Consumed by\n     * {@link org.apache.skywalking.oap.log.analyzer.v2.dsl.spec.extractor.MetricExtractor} at\n     * ingest time. The returned collection is a read-only view; concurrent updates from\n     * {@link #addOrReplaceMetricConvert} / {@link #removeMetricConvert} do not invalidate\n     * in-flight iteration because writers publish a new map reference rather than mutating\n     * the one this method returned.\n     */\n    public Collection<MetricConvert> getMetricConverts() {\n        return metricConverts.values();","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/apache/skywalking/blob/102af09b4a56064e22050dded10e2c52e490d040/oap-server/analyzer/log-analyzer/src/main/java/org/apache/skywalking/oap/log/analyzer/v2/provider/LogAnalyzerModuleProvider.java#L154-L190","documentation":"Wrapper thrown in LogAnalyzerModuleProvider.start() when factory.loadStaticRules() or logAnalyzerService.addListenerFactory(factory) fails. loadStaticRules is where every static LAL rule is actually compiled and registered — so all per-rule compile errors (duplicate names, unknown fields, bad inputType/outputType, DSL syntax) and wiring failures surface here, wrapped with this message. Startup of the log-analyzer module aborts.","triggerScenarios":"Any static LAL rule under lalPath/lalFiles failing compile (see the LALValueCodegen/DSL errors); duplicate rule names across files (auto-layer or per-layer); inputType/outputType resolution failures; listener-factory registration failures after successful compile.","commonSituations":"Deploying new or edited LAL rule files with errors; adding a rule whose name already exists in another file; upgrading SkyWalking with grammar changes that invalidate old rule files.","solutions":["Walk the cause chain — the deepest cause names the exact rule and problem (duplicate name, unknown field, class not found, etc.)","Fix the offending rule in the lal/ catalog identified by the cause","Ensure rule names are unique per layer (and globally for layer: auto rules)","Verify inputType/outputType values are valid FQCNs or registered builder names","Re-run startup after removing the failing file to confirm isolation"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    factory.loadStaticRules();\n} catch (Exception e) {\n    // walk to deepest cause: it names the exact rule file + problem\n    // startup cannot proceed with a broken rule catalog; quarantine the file and retry boot\n}","preventionTips":["Compile new/edited LAL rules against the dsl-scripts-test harness before deployment","Keep rule names unique per layer and globally for auto-layer rules","Stage rule changes; never edit the production lal/ catalog in place without a test pass"],"tags":["lal","log-analyzer","startup","wrapper","rules"],"backgroundTag":null,"analyzedSha":"102af09b4a56064e22050dded10e2c52e490d040","analyzedAt":"2026-08-14T10:47:52.647Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}