-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 boot fails when vertx-cache temporary directory exists #7678
Comments
Looking at the code in vert.x[1], it always uses a call to |
I was wondering the same. While the base dir is fixed the actually name is generated at runtime. |
I'm talking about native image on Windows 10. In JVM mode different directory gets used with every run, with native image binary the directory is always the same (for that one binary). |
True for JVM mode, not in native mode. Native mode will make our heads hairless:) |
Just to be sure, it only happens on windows? |
Maybe the boot failing is happening only on Windows but I would bet the hardcoded temp directory is a global issue if the directory name is generated at static init. |
The directory name is computed at runtime and is not stored in a static field (the File Resolver is created in the VertxImpl constructor). Also, the directory should be clearer on shutdown (at least it's what the code is trying to do...). |
I've seen it on Windows only, maybe it's because Windows are more strict when it comes to filesystem and locks on files.
Sure, but that didn't happen with |
So I tried on macOS and the tmp folder name is unique on every run of native app. 3x execution of native binary with Installed features: [cdi, resteasy]
|
I will have a look tomorrow. I need to setup a Windows 10 VM. We need to test it with GraalVM 19.3 and 20.x.
Clement
…On 9 Mar 2020 at 13:06 +0100, Rostislav Svoboda ***@***.***>, wrote:
So I tried on macOS and the tmp folder name is unique on every run of native app.
On macOS I'm using 19.3.1, on Windows machine I used GraalVM 20 as suggested in PR for Windows native by Tomaz.
3x execution of native binary with Installed features: [cdi, resteasy]
/var/folders/nn/w1bsdgrx69n9gch4w4vkrkv40000gn/T/vertx-cache/file-cache-2554416b-2b60-4a9e-bf62-4de1b02029e4
/var/folders/nn/w1bsdgrx69n9gch4w4vkrkv40000gn/T/vertx-cache/file-cache-def0845c-f09f-4888-8869-b7555b488519
/var/folders/nn/w1bsdgrx69n9gch4w4vkrkv40000gn/T/vertx-cache/file-cache-8eae8c90-220d-417b-81a3-b82c8f0de9b4
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Unfortunately, I'm not able to build a native-image on Windows...
|
@cescoffier do you have the right tools installed on your Windows box? |
@rsvoboda I forgot to ask, does this only happen with 20.x of GraalVM or even with 19.3.x?
|
It's my home laptop, Windows is the host OS, no VM. Using GraalVM 20, didn't try 19.3 as Windows support for native-image improved with GraalVM 20. |
I tried to use 19.3.1 on Windows machine, but it can't be used with Quarkus, getting error
|
Windows native-image based binary generates always the same UUID. I filed an issue in GraalVM tracker - oracle/graal#2265 |
@rsvoboda @cescoffier I'm experiencing this issue with jvm and native mode in openshift. not sure what I'm doing wrong |
not sure if this is the issue exactly |
@karesti in your case I believe it's because you don't have the permission to write in Any way to get a reproducer if that's not the case? |
@cescoffier oh ok. I will check this with the team. How can I give those permissions in openshift ? |
@cescoffier I will check with the team so I get it solved if it's a matter of permissions |
Normally on OpenShift |
So, the problem is that the docker file uses RUN chown 1001 /work
|
@cescoffier I forgot to ping you in my comment above |
The default FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3
WORKDIR /work/
RUN chown 1001 /work \
&& chmod "g+rwX" /work \
&& chown 1001:root /work
COPY --chown=1001:root target/*-runner /work/application
EXPOSE 8080
USER 1001
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] So it needs to be adjusted? In other words: is |
@rsvoboda I did not use anything specific or custom. the quarkus app dit not start simply. I used 4 extensions: websockets, infinispan, rest and scheduler |
I just tried (with a different set of extensions but would still use vert.x) on an OpenShift on Azure and no problem. D'oh didn't see the ubi-minimal version, I may have an older version. |
Which version of OpenShift was used? Especially interested in the version used by @karesti. |
Just checked with the very last ubi:8.3 - no problem. So might be an OpenShift permission issue. |
@rsvoboda I'm using a dedicated version 4.6.8 |
@rsvoboda is that a setting you can reproduced? I don't have "dedicated", I only have cloud instances. |
We were not able to reproduce. As if there were some specific permissions specified in the used OpenShift cluster. |
@karesti I am trying to reproduce your issue without success.
For example, a valid YAML could be something like this:
|
@pjgg this pod deploy worked! I used the scheduler and websockets extension (if this might be an issue) |
I will test the deployment in another way |
@pjgg So I tested using deployment config and 2 pods and works as well. Might the scheduler or websockets extensions be related? |
I am not sure, yet. Could you show me your dependencies? (maven/gradle) just to set up an scenario with the same version as you?. When you said:
Do you mean that you use your application and the default Docker file, and works? I have tested with a scheduler (quartz), and looks ok!. |
Another aspect that might be relevant: I'm running two instances of the same native runner on a machine on separate user accounts. The first one can be launched normally. The second one throws the same exception as above. The cause is that the first user has created and is thus owning Both users have defined the paths to separate temp dirs in the environment, e.g. for one of them:
I guess that the For me the workaround using |
The |
So, the @rsvoboda any concern with such an approach? |
I spoke with @pjgg about this. In general we are ok with such change. The only concern we see is around @karesti use-case whe Katia worked with known path About unique cache generate at each startup - also in NATIVE mode? |
Yes, it's going to be generated on every application start, so even in native mode, multiple runs will generate multiple directories. |
…table. Under that directory, another random directory is created that is only readable and writable from the current user. The vertx-cache directory creation is disabled if: * the user specifies a cache directory * the vertx-cache directory already exists Fix quarkusio#7678
FYI @rsvoboda I am able to reproduce this error on Quarkus 2.7.X in NO NATIVE (didn't tried on native), not reproducible in Quarkus 2.6.3.Final. |
Oh BTW, not testing in Windows. It happens in a Kubernetes cluster, using a new PVC mounted in /tmp directory. None of this fails in Quarkus 2.6.3.Final |
Please file new issue with steps to reproduce, this sounds like a new variant of the problem. |
Ok so it seems I had to create an init-containers in order to set the permissions properly. Thanks very much! |
@juangon Can you provide a snippet of changes you did so that other people can learn from your fix? Assuming you have custom yaml descriptor and not relying on kubernetes yaml generated by Quarkus extension. |
Yes sure, I don't have a custom YAML descriptor, but will write here anyway. Here is the PVC for a microservice:
And here the init-containers
User is 185 as existing in latest Dockerfile |
Thanks! |
Quarkus boot fails when vertx-cache temporary directory exists.
Running on Windows 10, using GraalVM 20 JDK 11 based, native image
First I thought the problem is in the file path which mixes Windows and Linux path separators, but that is not the problem.
The problem is that
file-cache-9cf306ad-0c1b-4d8f-8468-f6d148da5859
directory exists and Quarkus native binary boot fails due to that fact. This directory was generated duringmvn clean install -Dnative
execution but wasn't cleaned at the end.Workaround is to remove that temporary directory and after this step Quarkus .exe app boots without problem, temporary directory gets cleaned during the shutdown. So following executions run without problem. The same file-cache directory gets generated on each run.
Few points:
mvn clean install -Dnative
executionThe third point is the biggest issue from my perspective as it blocks portability (C:\Users\ROSTIS~1\AppData\Local\Temp\ would be expected on every system the app gets started?)I tried on another windows machine and the path is not fully hard-coded, user's tmp directory is reflected, but the final directory is alwaysfile-cache-9cf306ad-0c1b-4d8f-8468-f6d148da5859
,Always the same path can be risky from a security perspective, knowledgeable users know where to look beforehand.
Steps to reproduce on sample bootstrap app:
The text was updated successfully, but these errors were encountered: