eclipse-vertx/vert.x · error · FileSystemException

open

Error message

open

What it means

Wrap of an IOException raised while opening a file with the computed OpenOptions in AsyncFileImpl's constructor path. The message 'open' is the failing operation label; the underlying cause carries the real filesystem error (missing file, permissions, invalid flags combination).

Source

Thrown at vertx-core/src/main/java/io/vertx/core/file/impl/AsyncFileImpl.java:102

    if (options.isRead()) opts.add(StandardOpenOption.READ);
    if (options.isWrite()) opts.add(StandardOpenOption.WRITE);
    if (options.isCreate()) opts.add(StandardOpenOption.CREATE);
    if (options.isCreateNew()) opts.add(StandardOpenOption.CREATE_NEW);
    if (options.isSync()) opts.add(StandardOpenOption.SYNC);
    if (options.isDsync()) opts.add(StandardOpenOption.DSYNC);
    if (options.isDeleteOnClose()) opts.add(StandardOpenOption.DELETE_ON_CLOSE);
    if (options.isSparse()) opts.add(StandardOpenOption.SPARSE);
    if (options.isTruncateExisting()) opts.add(StandardOpenOption.TRUNCATE_EXISTING);
    try {
      if (options.getPerms() != null) {
        FileAttribute<?> attrs = PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString(options.getPerms()));
        ch = AsynchronousFileChannel.open(file, opts, vertx.workerPool().executor(), attrs);
      } else {
        ch = AsynchronousFileChannel.open(file, opts, vertx.workerPool().executor());
      }
      if (options.isAppend()) writePos = ch.size();
    } catch (IOException e) {
      throw new FileSystemException(FileSystemImpl.getFileAccessErrorMessage("open", path), e);
    }
    this.context = context;
    this.queue = new InboundBuffer<>(context, 0);
    queue.handler(buff -> {
      if (buff.length() > 0) {
        handleBuffer(buff);
      } else {
        handleEnd();
      }
    });
    queue.drainHandler(v -> {
      doRead();
    });
  }

  @Override
  public Future<Void> close() {
    Promise<Void> promise = context.promise();

View on GitHub (pinned to fb308bd8c3)

Solutions

  1. Inspect the cause of the thrown exception for the actual reason
  2. Ensure the file exists and OpenOptions (create/createNew/read/write/truncate) are consistent
  3. Check filesystem permissions for the vert.x process
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at vertx-core/src/main/java/io/vertx/core/file/impl/AsyncFileImpl.java:102 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of eclipse-vertx/vert.x@fb308bd8c3 (2026-09-06). Data as JSON: /api/errors/2f4dd7c2446fb012. Report an issue: GitHub.