[ 
https://issues.apache.org/jira/browse/SOLR-12777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16617300#comment-16617300
 ] 

Pete Ryland commented on SOLR-12777:
------------------------------------

Here are the errors:
{quote}{{celum-search@phil:/usr/local/share/celum/webapps/solr-7.3.1/bin$ 
./solr start -p 8883 -s /var/lib/data/celum/search -d 
/usr/local/share/celum/webapps/solr-7.3.1/server -t 
/var/lib/data/celum/search/data}}
{{ Exception in thread "main" java.nio.file.AccessDeniedException: 
/usr/local/share/celum/webapps/solr-7.3.1/server/logs}}
{{ at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)}}
{{ at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)}}
{{ at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)}}
{{ at 
sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)}}
{{ at java.nio.file.Files.createDirectory(Files.java:674)}}
{{ at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)}}
{{ at java.nio.file.Files.createDirectories(Files.java:767)}}
{{ at org.apache.solr.util.SolrCLI$UtilsTool.archiveGcLogs(SolrCLI.java:4262)}}
{{ at org.apache.solr.util.SolrCLI$UtilsTool.runTool(SolrCLI.java:4245)}}
{{ at org.apache.solr.util.SolrCLI.main(SolrCLI.java:282)}}
{{ Failed archiving old GC logs}}
{{ Exception in thread "main" java.nio.file.AccessDeniedException: 
/usr/local/share/celum/webapps/solr-7.3.1/server/logs}}
{{ at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)}}
{{ at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)}}
{{ at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)}}
{{ at 
sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)}}
{{ at java.nio.file.Files.createDirectory(Files.java:674)}}
{{ at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)}}
{{ at java.nio.file.Files.createDirectories(Files.java:767)}}
{{ at 
org.apache.solr.util.SolrCLI$UtilsTool.archiveConsoleLogs(SolrCLI.java:4291)}}
{{ at org.apache.solr.util.SolrCLI$UtilsTool.runTool(SolrCLI.java:4248)}}
{{ at org.apache.solr.util.SolrCLI.main(SolrCLI.java:282)}}
{{ Failed archiving old console logs}}{{ERROR: Logs directory 
/usr/local/share/celum/webapps/solr-7.3.1/server/logs could not be created. 
Exiting}}
{{ celum-search@phil:/usr/local/share/celum/webapps/solr-7.3.1/bin$ ./solr 
start -p 8883 -s /var/lib/data/celum/search -d /var/lib/celum-search -t 
/var/lib/data/celum/search/data}}{{ERROR: start.jar file not found in 
/var/lib/celum-search!}}
{{ Please check your -d parameter to set the correct Solr server 
directory.}}{{celum-search@phil:/usr/local/share/celum/webapps/solr-7.3.1/bin$ 
}}{quote}

By the way, those error messages are really ugly and hard to understand.  A 
normal user cares little about the internal java exceptions and shouldn't be 
exposed to them.

> Solr server directory needs to be writable by the user running solr
> -------------------------------------------------------------------
>
>                 Key: SOLR-12777
>                 URL: https://issues.apache.org/jira/browse/SOLR-12777
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: scripts and tools
>    Affects Versions: 7.3.1
>            Reporter: Pete Ryland
>            Priority: Major
>
> When starting solr, an optional {{-d}} parameter can be provided.  This 
> specifies the "Solr server directory" which needs to be the {{server}} 
> directory from the raw distribution.  This clearly contains the program 
> files, so as per common practice should not be writable by the user running 
> the program.  However, when specified, an error results because it tries to 
> create a log directory within the program directory!  This is really really 
> bad practice.  One should be able to specify a directory for the runtime 
> files and log files on the command line.  It would be even better if the 
> defaults conformed to the filesystem hierarchy standard when run on a Linux 
> system.  I understand that you want to make it easy for developers to use 
> your software, but when deploying on actual production systems, these things 
> are really important.  It's also important to understand that the people 
> deploying your software to production are different to the ones who develop 
> with your software, and a deep understanding of your software shouldn't be 
> necessary for the former to be able to deploy it.
> A wholly-unsatisfactory workaround is to set the pid and log directories by 
> environment variable before starting the server:
> {{$ export SOLR_PID_DIR=/var/lib/celum-search}}
> {{$ export SOLR_LOGS_DIR=/var/log/celum-search}}
> This can also be done in {{/etc/default/solr.in.sh}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to