{"record":{"id":"3e638f8dba268519","repo":"quarkusio/quarkus","slug":"unable-to-find-file-referenced-in-pupropertykey","errorCode":null,"errorMessage":"Unable to find file referenced in '<puPropertyKey(persistenceUnitName, \"sql-load-script\")>=<sqlLoadScript>'. Remove property or add file to your path.","messagePattern":"Unable to find file referenced in '<puPropertyKey\\(persistenceUnitName, \"sql-load-script\"\\)>=<sqlLoadScript>'\\. Remove property or add file to your path\\.","errorType":"exception","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/util/HibernateProcessorSupport.java","lineNumber":502,"sourceCode":"            for (String importFile : importFiles) {\n                Path loadScriptPath;\n                try {\n                    loadScriptPath = applicationArchivesBuildItem.getRootArchive().getChildPath(importFile);\n                } catch (RuntimeException e) {\n                    throw new ConfigurationException(\n                            \"Unable to interpret path referenced in '\"\n                                    + HibernateOrmRuntimeConfig.puPropertyKey(persistenceUnitName, \"sql-load-script\") + \"=\"\n                                    + String.join(\",\", persistenceUnitConfig.sqlLoadScript().get())\n                                    + \"': \" + e.getMessage());\n                }\n\n                if (loadScriptPath != null && !Files.isDirectory(loadScriptPath)) {\n                    // enlist resource if present\n                    existingImportFiles.add(importFile);\n                    nativeImageResources.produce(new NativeImageResourceBuildItem(importFile));\n                } else if (persistenceUnitConfig.sqlLoadScript().isPresent()) {\n                    //raise exception if explicit file is not present (i.e. not the default)\n                    throw new ConfigurationException(\n                            \"Unable to find file referenced in '\"\n                                    + HibernateOrmRuntimeConfig.puPropertyKey(persistenceUnitName, \"sql-load-script\") + \"=\"\n                                    + String.join(\",\", persistenceUnitConfig.sqlLoadScript().get())\n                                    + \"'. Remove property or add file to your path.\");\n                }\n                // in dev mode we want to make sure that we watch for changes to file even if it doesn't currently exist\n                // as a user could still add it after performing the initial configuration\n                hotDeploymentWatchedFiles.produce(new HotDeploymentWatchedFileBuildItem(importFile));\n            }\n\n            if (!existingImportFiles.isEmpty()) {\n                descriptor.getProperties().setProperty(AvailableSettings.JAKARTA_HBM2DDL_LOAD_SCRIPT_SOURCE,\n                        String.join(\",\", existingImportFiles));\n            }\n        }\n\n        //Disable implicit loading of the default import script (import.sql)\n        descriptor.getProperties().setProperty(AvailableSettings.HBM2DDL_SKIP_DEFAULT_IMPORT_FILE, \"true\");","sourceCodeStart":484,"sourceCodeEnd":520,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/util/HibernateProcessorSupport.java#L484-L520","documentation":"Quarkus Hibernate ORM throws this when the SQL load script configured via quarkus.hibernate-orm.<pu>.sql-load-script does not exist at build time. Unlike the default import.sql, an explicitly configured script must resolve to an existing file on the path; the build fails fast so the misconfiguration is caught before runtime. The message includes the exact property key and configured value.","triggerScenarios":"configureSqlLoadScript raises ConfigurationException when the sql-load-script property is explicitly present but loadScriptPath is missing or a directory, so no resource can be enlisted for the persistence unit.","commonSituations":"Typo in the script filename; script placed outside src/main/resources so it never lands on the classpath; file only present in src/test; configured value points at a directory; dev-mode file deleted while the property remains set.","solutions":["Create the referenced file at the configured path inside src/main/resources so it is packaged on the classpath.","Correct the sql-load-script value to the actual file name/path.","Remove the sql-load-script property entirely, or set it to 'no-file' to disable script loading.","Verify the file is not a directory and is readable at build time."],"exampleFix":"// before (application.properties)\nquarkus.hibernate-orm.sql-load-script=my-imports.sql  // file missing\n// after\nquarkus.hibernate-orm.sql-load-script=sql/my-imports.sql  // exists in src/main/resources/sql/\n// or disable: quarkus.hibernate-orm.sql-load-script=no-file","handlingStrategy":"validation","validationCode":"String script = \"sql/my-imports.sql\";\ntry (var in = Thread.currentThread().getContextClassLoader().getResourceAsStream(script)) {\n    if (in == null) throw new IllegalStateException(\"sql-load-script not on classpath: \" + script);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep sql-load-script files under src/main/resources so they are always packaged.","Add a CI/build check that every configured script exists on the classpath.","Use the documented 'no-file' value to disable loading instead of a bogus path.","Never point sql-load-script at a directory."],"tags":["quarkus","hibernate-orm","configuration","missing-file"],"backgroundTag":"missing-sql-load-script","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"}