-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
gu install
tries to write to /var/tmp, causing AccessDeniedException when running as non-root user
#1754
Comments
gu install
tries to write to /var/tmp, causing AccessDeniedException when running as non-root user
Gu is actually using Tempdir can be passed as a system property, but |
BWT what's your OS flavour/distribution/version ? |
Sorry for the delay. The info you requested.
I don't remember when I installed my OS, it's been in use for a looong time. But I install the JDK through sdkman to not mess up the host system, I doubt my system is corrupted, as far as Java goes.
So I don't understand why it's still attempting to download something to GraalVM 19.2.1 property dump
Here is the same using OpenJDK 12
Still failing in 19.2.1 $ gu --debug --verbose install native-image
Downloading: Component catalog (source: https://www.graalvm.org/component-catalog/graal-updater-component-catalog.properties)
Receiving 131 kB: Error: Error downloading component catalog from https://www.graalvm.org/component-catalog/graal-updater-component-catalog.properties: /var/tmp/graalvm_install2140517582811800329.
Please check your connection and proxy settings. If your machine is behind a proxy, environment variables (http_proxy, https_proxy, ...) must be set appropriately.
org.graalvm.component.installer.FailedOperationException: Error downloading component catalog from https://www.graalvm.org/component-catalog/graal-updater-component-catalog.properties: /var/tmp/graalvm_install2140517582811800329.
Please check your connection and proxy settings. If your machine is behind a proxy, environment variables (http_proxy, https_proxy, ...) must be set appropriately.
at org.graalvm.component.installer.Environment$1.failure(Environment.java:313)
at org.graalvm.component.installer.ce.WebCatalog.getStorage(WebCatalog.java:116)
at org.graalvm.component.installer.remote.MergeStorage.listComponentIDs(MergeStorage.java:65)
at org.graalvm.component.installer.model.CatalogContents.getComponentIDs(CatalogContents.java:209)
at org.graalvm.component.installer.model.CatalogContents.findAbbreviatedId(CatalogContents.java:219)
at org.graalvm.component.installer.model.CatalogContents.doLoadComponents(CatalogContents.java:256)
at org.graalvm.component.installer.model.CatalogContents.findComponent(CatalogContents.java:165)
at org.graalvm.component.installer.remote.CatalogIterable$It.next(CatalogIterable.java:136)
at org.graalvm.component.installer.remote.CatalogIterable$It.next(CatalogIterable.java:110)
at org.graalvm.component.installer.commands.InstallCommand.prepareInstallation(InstallCommand.java:199)
at org.graalvm.component.installer.commands.InstallCommand.executeStep(InstallCommand.java:259)
at org.graalvm.component.installer.commands.InstallCommand.execute(InstallCommand.java:148)
at org.graalvm.component.installer.ComponentInstaller.processCommand(ComponentInstaller.java:280)
at org.graalvm.component.installer.ComponentInstaller.run(ComponentInstaller.java:406)
at org.graalvm.component.installer.ComponentInstaller.main(ComponentInstaller.java:440)
Caused by: java.nio.file.AccessDeniedException: /var/tmp/graalvm_install2140517582811800329
at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)
at java.nio.file.Files.createDirectory(Files.java:674)
at java.nio.file.TempFileHelper.create(TempFileHelper.java:136)
at java.nio.file.TempFileHelper.createTempDirectory(TempFileHelper.java:173)
at java.nio.file.Files.createTempDirectory(Files.java:991)
at org.graalvm.component.installer.remote.FileDownloader.createTempDir(FileDownloader.java:119)
at org.graalvm.component.installer.remote.FileDownloader.download(FileDownloader.java:346)
at org.graalvm.component.installer.ce.WebCatalog.getStorage(WebCatalog.java:110)
... 13 more
|
This is strange (I have an Ubunut too ;) and here the writes go to the Does |
I'm unable to pass
|
Oops. Apologies, my big mistake: I wasn't testing on a pristine install, so With a pristine installation, it's obvious that native-imaged GU indeed writes into a different directory ( |
We have ran in to the same issue on Ubuntu: TempReproducer.java: import java.nio.file.Files;
import java.nio.file.Path;
public final class TempReproducer {
public static void main(String[] args) {
try {
Path tempPath = Files.createTempFile("helidon-large", ".tmp");
System.out.println("Temp file: " + tempPath.toAbsolutePath().toString());
} catch (java.io.IOException e) {
throw new RuntimeException("Failed to open temporary file", e);
}
}
} kec@vulcan:~/tmp/native-temp$ javac TempReproducer.java
kec@vulcan:~/tmp/native-temp$ native-image --no-server TempReproducer
kec@vulcan:~/tmp/native-temp$ java TempReproducer
Temp file: /tmp/helidon-large9059398991885025175.tmp
kec@vulcan:~/tmp/native-temp$ ./tempreproducer
Exception in thread "main" java.lang.RuntimeException: Failed to open temporary file
at TempReproducer.main(TempReproducer.java:9)
Caused by: java.nio.file.AccessDeniedException: /var/tmp/helidon-large17658088856362561823.tmp
|
I think this issue has been fixed in the last months. If it is still reproducible, please re-open the issue. |
Problem
Trying to install native-image as a non-root user, I get an error, since it tries to write to a weird location. At the very least, the error message makes no sense until one turns on
--debug
(see below).Can I override this
/var/tmp
location setting using an environment variable?If so, which one? I need it to point at
/tmp
or some other location in my$HOME
...Reproduction
The text was updated successfully, but these errors were encountered: