Skip to content

NoSuchFileException usign questdb embedded and the questdb jar is in a directory containing spaces #5668

@sarunas-stasaitis

Description

@sarunas-stasaitis

To reproduce

  1. Create app using questdb embedded (see minimal example at https://github.com/sarunas-stasaitis/qdb-embedded-crash)
  2. Make sure the path to the working directory contains a space
  3. Build with mvn clean install
  4. Try running java -jar target/qdb-embedded-crash-1.0-SNAPSHOT.jar
  5. You should get similar output:
2025-05-12T11:28:47.516099Z I i.q.c.t.t.InputFormatConfiguration loading input format config [resource=/text_loader.json]
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: java.nio.file.NoSuchFileException: C:\New%20folder\qdb-embedded-crash\target\lib\questdb-8.3.1.jar
        at io.questdb.griffin.FunctionFactoryScanner.scan(FunctionFactoryScanner.java:97)
        at io.questdb.griffin.FunctionFactoryCacheBuilder.scan(FunctionFactoryCacheBuilder.java:32)
        at io.questdb.griffin.FunctionFactoryCacheBuilder.scan(FunctionFactoryCacheBuilder.java:20)
        at io.questdb.cairo.CairoEngine.getFunctionFactories(CairoEngine.java:1771)
        at io.questdb.cairo.CairoEngine.<init>(CairoEngine.java:178)
        at test.qdb.Main.main(Main.java:17)
Caused by: java.lang.RuntimeException: java.nio.file.NoSuchFileException: C:\New%20folder\qdb-embedded-crash\target\lib\questdb-8.3.1.jar
        at io.questdb.griffin.FunctionFactoryScanner.scanJar(FunctionFactoryScanner.java:286)
2025-05-12T11:28:47.547804Z A i.q.c.CairoEngine loading functions from /C:/New%20folder/qdb-embedded-crash/target/lib/questdb-8.3.1.jar
        at io.questdb.griffin.FunctionFactoryScanner.scan(FunctionFactoryScanner.java:69)
        ... 5 more
Caused by: java.nio.file.NoSuchFileException: C:\New%20folder\qdb-embedded-crash\target\lib\questdb-8.3.1.jar
        at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85)
        at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
        at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
        at java.base/sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:53)
        at java.base/sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:38)
        at java.base/sun.nio.fs.WindowsFileSystemProvider.readAttributes(WindowsFileSystemProvider.java:197)
        at java.base/java.nio.file.Files.readAttributes(Files.java:1865)
        at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1512)
        at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:744)
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:254)
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:181)
        at java.base/java.util.jar.JarFile.<init>(JarFile.java:345)
        at java.base/java.util.jar.JarFile.<init>(JarFile.java:316)
        at io.questdb.griffin.FunctionFactoryScanner.scanJar(FunctionFactoryScanner.java:266)
        ... 6 more

QuestDB version:

8.3.1

OS, in case of Docker specify Docker and the Host OS:

Windows 10, Windows Server 2019

File System, in case of Docker specify Host File System:

NTFS

Full Name:

Šarūnas Stašaitis

Affiliation:

Energy Advice

Have you followed Linux, MacOs kernel configuration steps to increase Maximum open files and Maximum virtual memory areas limit?

  • Yes, I have

Additional context

Issue seems to be around

URL url = clazz.getProtectionDomain().getCodeSource().getLocation();
, which doesn't handle special character handling differences between file path and urls.

An embedded instance of questdb on windows is likely to end up somewhere in C:\Program Files\

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIncorrect or unexpected behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions