Hi Paul,
thank you for the fast response. Sorry, this might have been a bit confusing.
C:\Temp\Solr is my custom folder and already exists from the previous Solr
version, so it also should be accessible to the new version. Process Monitor
showed that Solr first tries to access the default folder C:\Solr\server\tmp,
which I then created to see if this would help the service to start (which
worked fine).
Regarding specifying the path in solr.cmd, the only thing I did was replacing
"%SOLR_SERVER_DIR%\tmp" by "C:\Temp\Solr" so I can't see any error here, as in
the default file also a backslash is used.
See the part of solr.cmd in question below.
Regards
Daniel
======= begin solr.cmd =======
...
IF "%FG%"=="1" (
REM run solr in the foreground
title "Solr-%SOLR_PORT%"
echo %SOLR_PORT%>"%SOLR_TIP%"\bin\solr-%SOLR_PORT%.port
"%JAVA%" %SERVEROPT% %SOLR_JAVA_MEM% %START_OPTS% ^
-Dlog4j.configurationFile="%LOG4J_CONFIG%" -DSTOP.PORT=!STOP_PORT!
-DSTOP.KEY=%STOP_KEY% ^
-Dsolr.solr.home="%SOLR_HOME%" -Dsolr.install.dir="%SOLR_TIP%"
-Dsolr.default.confdir="%DEFAULT_CONFDIR%" ^
-Djetty.port=%SOLR_PORT% -Djetty.home="%SOLR_SERVER_DIR%" ^
-Djava.io.tmpdir="%SOLR_SERVER_DIR%\tmp" -jar start.jar %SOLR_JETTY_CONFIG%
"%SOLR_JETTY_ADDL_CONFIG%"
) ELSE (
START /B "Solr-%SOLR_PORT%" /D "%SOLR_SERVER_DIR%" ^
"%JAVA%" %SERVEROPT% %SOLR_JAVA_MEM% %START_OPTS% ^
-Dlog4j.configurationFile="%LOG4J_CONFIG%" -DSTOP.PORT=!STOP_PORT!
-DSTOP.KEY=%STOP_KEY% ^
-Dsolr.log.muteconsole ^
-Dsolr.solr.home="%SOLR_HOME%" -Dsolr.install.dir="%SOLR_TIP%"
-Dsolr.default.confdir="%DEFAULT_CONFDIR%" ^
-Djetty.port=%SOLR_PORT% -Djetty.home="%SOLR_SERVER_DIR%" ^
-Djava.io.tmpdir="%SOLR_SERVER_DIR%\tmp" -jar start.jar %SOLR_JETTY_CONFIG%
"%SOLR_JETTY_ADDL_CONFIG%" > "!SOLR_LOGS_DIR!\solr-%SOLR_PORT%-console.log"
echo %SOLR_PORT%>"%SOLR_TIP%"\bin\solr-%SOLR_PORT%.port
REM now wait to see Solr come online ...
"%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS%
-Dsolr.install.dir="%SOLR_TIP%" -Dsolr.default.confdir="%DEFAULT_CONFDIR%"^
-Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml"
^
-classpath
"%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*"
^
org.apache.solr.util.SolrCLI status -maxWaitSecs 30 -solr
!SOLR_URL_SCHEME!://%SOLR_TOOL_HOST%:%SOLR_PORT%/solr
)
...
======= end solr.cmd =======
-----Original Message-----
From: Paul Russell <[email protected]>
Sent: Dienstag, 21. Juni 2022 12:01
To: [email protected]
Subject: [EXTERN!]: Re: Unable to set custom temp directory on Windows with
9.0.0
Daniel,
You have listed "-Djava.io.tmpdir="C:\Temp\Solr" as the intended temp
directory but also indicated creating folder structure "
C:\Solr\server\tmp" if that wasnt a typo then you need to create the
"C:\Temp\SOLR" folder structure and also when passing java directives the
correct directive would be '-Djava.io.tmpdir="C:/temp/solr"
On Tue, Jun 21, 2022 at 5:49 AM Calliess Daniel Ing. <
[email protected]> wrote:
> Hi,
>
> after updating my Solr test installation from version 8.11.1 to 9.0.0 I am
> unable to start the Solr service when I am setting a custon temporary
> directory. I'm doing this by changing
>
> -Djava.io.tmpdir="%SOLR_SERVER_DIR%\tmp"
>
> to
>
> -Djava.io.tmpdir="C:\Temp\Solr"
>
> in the file 'solr.cmd'.
>
> Regarding to the Process Monitor tool, there might be a bug with creating
> the path to the temporary folder, as the following output shows:
> cmd.exe 7448 QueryDirectory C:\Solr\server\tmp NO SUCH FILE
> cmd.exe 7448 CreateFile C:\Solr\server\tmp ACCESS DENIED
> java.exe 7872 CreateFile
> C:\Solr\server\-Djava.io.tmpdir=C:\Temp\ NAME INVALID
> java.exe 7872 CreateFile
> C:\Solr\server\-Djava.io.tmpdir=C:\Temp\Solr NAME INVALID
>
> The StandardError output includes a corresponding message:
> 2022-06-21 09:39:20.112: java.lang.SecurityException: Unable to create
> temporary file or directory
>
> When I'm creating the folder C:\Solr\server\tmp and allowing the service
> user write access, then the service is starting and using this folder as
> the temporary directory.
>
> Am I doing something wrong or is this indeed a bug?
>
> Best regards
> Daniel
>