-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
JSP temp directory regression, possibly due to fix for #12044 #12124
Comments
Are you using Windows? Please don't delete the issue template next time. |
It's Linux, Coretto 17. There is some anecdotal evidence it may not affect the Windows version, I don't have it to test fully. In my case, it was a straight upgrade (stop 0.11, update my init script pointer, start 0.12) resulting in the exception in the log. If nothiing obvious shows up, once I'm done with some other work I can do a bit more digging tomorrow and compare the tmp folders I'm getting between the two versions, I am 99% sure they were subtly different. |
Are you manually configuring the temp directory? |
Are you using a classic jetty-home / jetty-base setup? |
I am configuring the temp directory with an ini file via -Djava.io.tmpdir=tmp (located in my jetty-base), and the top level webapp and nested webinf folder are created without any problems. On 12.0.11, it also creates the nested jsp subfolder, whereas on 12.0.12, that step fails, taking down the webapp. I'm not sure what constitutes "classic", but I have jetty-home in /opt, just unpacking the distribution as posted, and my jetty-base is elsewhere, and my init script passes in the necessary variables to point it to them. Nothing embedded, no. My startup is via an init script that's fairly exotic due to use of setuid (working fine) and not having managed to get a systemd unit file to work so I do some crazy --dry-run stuff that has been working fine with 12.0.11, unchanged from Jetty 11. Permissions all seem fine, evidenced by the fact that it's able to create all the other material in tmp. Red Hat 9 is the only place I've specifically reproduced the bug. No Docker whatsoever. If not for the fact that my colleague reported Windows as working, I would be certain this is a regression from the cleanup fix. I'm still close to certain, simply from Occam's Razor. |
If it helps, this is what 12.0.11 looks like. I can get a sample of the partial pre-crash content on 12.0.12 tomorrow latest.
|
Note that there are few more |
The Internally, on startup of the ServletContext, specifically the Lines 681 to 692 in cc6f1b7
So if the temp directory doesn't exist, the call |
Right. My impression is that the defaulted in scratchdir built from line 685-687 is not in fact the same path as what's been placed on disk previously, so the folder in the middle of the path doesn't exist. It wasn't obvious where I should define my own scratchdir if that were a workaround, but I don't know that I'd want to go that route anyway. If it would have to be in my actual webapp's servlet declarations, that's "non-ideal" for sure. |
the Just copy the one from jetty.project/jetty-ee10/jetty-ee10-webapp/src/main/config/etc/webdefault-ee10.xml Lines 181 to 207 in 58cfe77
|
Ok, I'm in the midst of my main upgrade to 12.0.11 so once I get back to ground zero I can do the comparison and also try some workarounds. I have feelers out to others who can refute or reproduce my results. |
I tested this, and it appears that 12.0.12 creates the jsp temp directory in jetty_base rather than in the specific tmpdir for the webapp in question:
Scott's jetty service account doesn't have write access to jetty_base, which is presumably why he's getting that error. Also, it appears that regardless of whether persistTempDirectory is not specified, is set to true, or is set to false, the webapp temporary directory files are always deleted. Although the jsp tmpdir in the wrong location remains... This is definitely a change in behavior from earlier versions, and I don't think having to go manually change parameters is the right answer to fixing it. Also, while I'm only running one webapp on this server, it seems if multiple jsp webapps were in place they'd be sharing a temporary directory which seems inadvisable and possibly a security issue. If you can confirm this, you might want to pull this version. Thanks... |
@scantor @pbhenson next time (if there is a next time) could you please include all of the information on the issue template? Most particularly it is critical for us to know which EE environment you are using. As neither of you gave the environment, I've assumed Investigating now. |
Also ensure the name of war appears in the name of the tmp dir for ee9 webapps.
OK, found the problem. I've raised #12129 to fix. As a workaround in the meanwhile, you could try explicitly setting the location of the tmp directory for each webapp ( |
Thank you. I didn't realize the extent to which the implementation was that distinct across EE versions, that seems likely to be a maintenance fiasco. Never occured to me it might impact the behavior. |
The 12.0.12 patch for issue 12044 seems to have possibly caused a regression in the JSP temp folder creation step.
Starting 12.0.12 I get this:
Caused by: java.lang.IllegalStateException: Could not create JSP scratch directory
I can see on 12.0.11 I get a jsp folder under "tmp/jetty-0_0_0_0-80-idp_war-_idp-any-4380240850460342364"
On 12.0.12, it can't create it. I think the internal name of the tmp folder is being munged so by the time it goes to create the jsp folder, it isn't using the right path. I noticed I think an extra hyphen or possibly some other stray character in the folder name it created, so something seems to have gone wrong somewhere, like the folder created on disk doesn't match the internal variable holding the folder path it defaults the jsp path to.
The text was updated successfully, but these errors were encountered: