{"record":{"id":"e3c3413376206860","repo":"quarkusio/quarkus","slug":"flyway-migration-location-may-not-be-null","errorCode":null,"errorMessage":"Flyway migration location may not be null.","messagePattern":"Flyway migration location may not be null\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/flyway/deployment/src/main/java/io/quarkus/flyway/deployment/FlywayProcessor.java","lineNumber":375,"sourceCode":"                    .build());\n            ClassPathUtils.consumeAsPaths(Thread.currentThread().getContextClassLoader(), location, path -> {\n                Set<String> applicationMigrations = null;\n                try {\n                    applicationMigrations = FlywayProcessor.this.getApplicationMigrationsFromPath(finalLocation, path);\n                } catch (IOException e) {\n                    LOGGER.warnv(e,\n                            \"Can't process files in path %s\", path);\n                }\n                if (applicationMigrations != null) {\n                    applicationMigrationResources.addAll(applicationMigrations);\n                }\n            });\n        }\n    }\n\n    private String normalizeLocation(String location) {\n        if (location == null) {\n            throw new IllegalStateException(\"Flyway migration location may not be null.\");\n        }\n\n        // Strip any 'classpath:' protocol prefixes because they are assumed\n        // but not recognized by ClassLoader.getResources()\n        if (location.startsWith(CLASSPATH_APPLICATION_MIGRATIONS_PROTOCOL + ':')) {\n            location = location.substring(CLASSPATH_APPLICATION_MIGRATIONS_PROTOCOL.length() + 1);\n            if (location.startsWith(\"/\")) {\n                location = location.substring(1);\n            }\n        }\n        if (!location.endsWith(\"/\")) {\n            location += \"/\";\n        }\n\n        return location;\n    }\n\n    private Set<String> getApplicationMigrationsFromPath(final String location, final Path rootPath)","sourceCodeStart":357,"sourceCodeEnd":393,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/flyway/deployment/src/main/java/io/quarkus/flyway/deployment/FlywayProcessor.java#L357-L393","documentation":"Flyway migration locations are normalized at build time so they can be resolved through ClassLoader.getResources(). A null location is invalid — this defensive IllegalStateException is thrown to prevent a null classpath lookup later.","triggerScenarios":"quarkus.flyway.locations (or a datasource-specific locations entry) contains/resolves to a null element — typically from a misconfigured collection or an unresolvable config expression feeding normalizeLocation.","commonSituations":"A location list built programmatically with a null entry; config property interpolated from a missing value; custom extension or code passing null into location normalization.","solutions":["Set explicit non-null values for quarkus.flyway.locations, e.g. classpath:db/migration","Check for config placeholders/expressions that resolve to null and fix or remove them","If locations come from code (custom processor), filter null entries before normalization"],"exampleFix":"// before\nquarkus.flyway.locations=${missing.property}\n// after\nquarkus.flyway.locations=classpath:db/migration","handlingStrategy":"validation","validationCode":"String loc = config.getOptionalValue(\"quarkus.flyway.locations\", String.class).orElse(\"classpath:db/migration\");\nObjects.requireNonNull(loc, \"Flyway location must not be null\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set explicit quarkus.flyway.locations values","Avoid config placeholders that can resolve to null","Filter nulls before passing location lists to Flyway setup"],"tags":["flyway","migration","configuration","build-time"],"backgroundTag":"missing-required-config","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}