Skip to content

[Native Image] Can not write to network drive #11118

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

Open
1 task
Ferrarisrex opened this issue May 2, 2025 · 4 comments
Open
1 task

[Native Image] Can not write to network drive #11118

Ferrarisrex opened this issue May 2, 2025 · 4 comments
Assignees

Comments

@Ferrarisrex
Copy link

Ferrarisrex commented May 2, 2025

Describe the Issue

it has the error of:
Error: Writing image to directory without write access N:\data\psdapp\target is not possible. Ensure the directory has write access or specify image path with write access.
it does have access, when i do the mvn -Pcompat package it does write new jar files to the directory
the drive is mounted using net use N: \address, and appears as such in file explorer
I can write to this directory outside of graalvm

test writes work just fine:

Image

Image

Image

Image

Maven itself can also access the network drive, just not graalvm

Image

Using the latest version of GraalVM can resolve many issues.

GraalVM Version

java 21.0.4 2024-07-16 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 21.0.4+8.1 (build 21.0.4+8-LTS-jvmci-23.1-b41)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 21.0.4+8.1 (build 21.0.4+8-LTS-jvmci-23.1-b41, mixed mode, sharing)

Operating System and Version

MSYS_NT-10.0-19045 DESKTOP-AC1808G 3.5.7-2644508f.x86_64 2025-02-06 19:32 UTC x86_64 Msys

Build Command

C:\graalvm\bin\native-image.cmd @target\tmp\native-image-15079480595134774010.args com.ferra.launcherClass

-cp
N:\data\psdapp\target\psd4-1.0-SNAPSHOT.jar;C:\Users\Ferra\.m2...
--no-fallback
-o
N:\data\psdapp\target\psd4-x86-64-v1
-H:ConfigurationFileDirectories=N:\data\psdapp\target\graalvm-reachability-metadata\f45387813847aca6e0d46b8e58b61457f1920728\org.jetbrains.kotlin\kotlin-stdlib\1.7.10,N:\data\psdapp\target\graalvm-reachability-metadata\f45387813847aca6e0d46b8e58b61457f1920728\org.glassfish.jaxb\jaxb-runtime\3.0.2,N:\data\psdapp\target\graalvm-reachability-metadata\f45387813847aca6e0d46b8e58b61457f1920728\com.fasterxml.jackson.core\jackson-databind\2.15.2,N:\data\psdapp\target\graalvm-reachability-metadata\f45387813847aca6e0d46b8e58b61457f1920728\commons-logging\commons-logging\1.2,N:\data\psdapp\target\graalvm-reachability-metadata\f45387813847aca6e0d46b8e58b61457f1920728\org.eclipse.jetty\jetty-server\11.0.12,N:\data\psdapp\target\graalvm-reachability-metadata\f45387813847aca6e0d46b8e58b61457f1920728\org.eclipse.jetty\jetty-util\12.0.9
-O1
--no-fallback
--enable-url-protocols=https
--enable-url-protocols=http
-H:Log=registerResource
-H:IncludeResources="./prism/."
-H:IncludeResources=".png$"
-H:IncludeResources=".
/sun/scenario/effect/."
-H:IncludeResources=".
/sound/sampled/."
-H:IncludeResources="./clusterers.UpdateableClusterer"
-march=x86-64-v1
-Dprism.order=sw
-H:ExcludeResources=".
/calendar/."
-H:ExcludeResources=".
/bounce/.*"

Expected Behavior

it to work fine

Actual Behavior

it claims to not have access to the network drive

Steps to Reproduce

use a workspace on a mounted network drive, and try and compile with graalvm

Additional Context

No response

Build Log Output and Error Messages

No response

@oubidar-Abderrahim
Copy link
Member

oubidar-Abderrahim commented May 6, 2025

Is there a reason why you would want to build the native image on a Network drive? this is not a use case I've encountered before

@Karm
Copy link
Contributor

Karm commented May 6, 2025

For the record:

if (!Files.isWritable(imageNamePathParent)) {

@Ferrarisrex
Copy link
Author

Is there a reason why you would want to build the native image on a Network drive? this is not a use case I've encountered before

I have like 6 people working on the program, all on different computers, and this seemed like a logical solution

@fniephaus
Copy link
Member

So it looks like Files.isWritable() can be unreliable on Windows network drives. Maybe a better check is to try and create a temp file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants