Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarkus fails to start if config is not a directory #37903

Closed
xtaixe opened this issue Dec 22, 2023 · 2 comments · Fixed by #37996
Closed

Quarkus fails to start if config is not a directory #37903

xtaixe opened this issue Dec 22, 2023 · 2 comments · Fixed by #37996
Labels
area/config kind/bug Something isn't working
Milestone

Comments

@xtaixe
Copy link

xtaixe commented Dec 22, 2023

Describe the bug

Quarkus fails to start if config is not a directory (both in dev mode and when running normally):

java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.deployment.steps.ConfigGenerationBuildStep#unknownConfigFiles threw an exception: java.lang.IllegalStateException: java.nio.file.NotDirectoryException: /Users/xtaixe/dev/getting-started/config
	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:858)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
	at java.base/java.lang.Thread.run(Thread.java:1583)
	at org.jboss.threads.JBossThread.run(JBossThread.java:501)
Caused by: java.nio.file.NotDirectoryException: /Users/xtaixe/dev/getting-started/config
	at java.base/sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:460)
	at java.base/java.nio.file.Files.newDirectoryStream(Files.java:613)
	at io.quarkus.runtime.configuration.ConfigDiagnostic.configFiles(ConfigDiagnostic.java:185)
	at io.quarkus.runtime.configuration.ConfigDiagnostic.configFilesFromLocations(ConfigDiagnostic.java:197)
	at io.quarkus.deployment.steps.ConfigGenerationBuildStep.unknownConfigFiles(ConfigGenerationBuildStep.java:436)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849)
	... 6 more

Expected behavior

The config file should be ignored when loading configuration and the application should start.

Actual behavior

Quarkus fails to start and throws an exception.

How to Reproduce?

mvn io.quarkus.platform:quarkus-maven-plugin:3.6.4:create -DprojectGroupId=org.acme -DprojectArtifactId=getting-started
touch config
./mvnw compile quarkus:dev

Output of uname -a or ver

Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000 arm64

Output of java -version

openjdk version "21" 2023-09-19 OpenJDK Runtime Environment GraalVM CE 21+35.1 (build 21+35-jvmci-23.1-b15) OpenJDK 64-Bit Server VM GraalVM CE 21+35.1 (build 21+35-jvmci-23.1-b15, mixed mode, sharing)

Quarkus version or git rev

3.6.4

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.6

Additional information

No response

@geoand
Copy link
Contributor

geoand commented Jan 3, 2024

#37997 fixes the issue

geoand added a commit that referenced this issue Jan 3, 2024
Don't fail if config is not a directory
@quarkus-bot quarkus-bot bot added this to the 3.7 - main milestone Jan 3, 2024
@rsvoboda
Copy link
Member

rsvoboda commented Jan 4, 2024

I hit this issue with 3.6 CLI when created app in Downloads directory which contained config file I downloaded for OCP cluster.
CLI based on Quarkus main work fine.

@gsmet gsmet modified the milestones: 3.7 - main, 3.6.5 Jan 9, 2024
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants