You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by ma...@gmail.com, ma...@gmail.com on 2018/09/16 21:05:16 UTC

Re: Logging fails when starting Solr in Windows using solr.cmd


On 2018/07/03 08:53:20, jakob@jafurrer.ch wrote: 
> Hi,
> 
> I was intending to open an Issue in Jira when I read that I'm supposed 
> to first contact this mailinglist.
> 
> Problem description
> ==================
> 
> System: Microsoft Windows 10 Enterprise Version 10.0.16299 Build 16299
> 
> Steps to reproduce the problem:
> 1) Download solr-7.4.0.tgz
> 2) Unzip to C:\solr-7.4.0
> 3) No changes (configuration or otherwise) whatsoever
> 4) Open cmd.exe
> 5) Execute the following command: cd c:\solr-7.4.0\bin
> 6) Execute the following command: solr.cmd start -p 8983
> 7) The following console output appears:
> 
> 
> c:\solr-7.4.0\bin>solr.cmd start -p 8983
> ERROR StatusLogger Unable to access 
> file:/c:/solr-7.4.0/server/file:c:/solr-7.4.0/server/scripts/cloud-scripts/log4j2.xml
>   java.io.FileNotFoundException: 
> c:\solr-7.4.0\server\file:c:\solr-7.4.0\server\scripts\cloud-scripts\log4j2.xml 
> (Die Syntax für den Dateinamen, Verzeichnisnamen oder die 
> Datenträgerbezeichnung ist falsch)
>          at java.io.FileInputStream.open0(Native Method)
>          at java.io.FileInputStream.open(FileInputStream.java:195)
>          at java.io.FileInputStream.<init>(FileInputStream.java:138)
>          at java.io.FileInputStream.<init>(FileInputStream.java:93)
>          at 
> sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
>          at 
> sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
>          at java.net.URL.openStream(URL.java:1045)
>          at 
> org.apache.logging.log4j.core.config.ConfigurationSource.fromUri(ConfigurationSource.java:247)
>          at 
> org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:404)
>          at 
> org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:346)
>          at 
> org.apache.logging.log4j.core.config.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:260)
>          at 
> org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:615)
>          at 
> org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:636)
>          at 
> org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:231)
>          at 
> org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:153)
>          at 
> org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
>          at 
> org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
>          at 
> org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:121)
>          at 
> org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:43)
>          at 
> org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:46)
>          at 
> org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
>          at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
>          at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
>          at org.apache.solr.util.SolrCLI.<clinit>(SolrCLI.java:228)
> ERROR StatusLogger Unable to access 
> file:/c:/solr-7.4.0/server/file:c:/solr-7.4.0/server/resources/log4j2.xml
>   java.io.FileNotFoundException: 
> c:\solr-7.4.0\server\file:c:\solr-7.4.0\server\resources\log4j2.xml (Die 
> Syntax für den Dateinamen, Verzeichnisnamen oder die 
> Datenträgerbezeichnung ist falsch)
>          at java.io.FileInputStream.open0(Native Method)
>          at java.io.FileInputStream.open(FileInputStream.java:195)
>          at java.io.FileInputStream.<init>(FileInputStream.java:138)
>          at java.io.FileInputStream.<init>(FileInputStream.java:93)
>          at 
> sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
>          at 
> sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
>          at java.net.URL.openStream(URL.java:1045)
>          at 
> org.apache.logging.log4j.core.config.ConfigurationSource.fromUri(ConfigurationSource.java:247)
>          at 
> org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:404)
>          at 
> org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:346)
>          at 
> org.apache.logging.log4j.core.config.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:260)
>          at 
> org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:615)
>          at 
> org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:636)
>          at 
> org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:231)
>          at 
> org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:153)
>          at 
> org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
>          at 
> org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
>          at 
> org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:121)
>          at 
> org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:43)
>          at 
> org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:46)
>          at 
> org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
>          at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
>          at org.eclipse.jetty.util.log.Slf4jLog.<init>(Slf4jLog.java:38)
>          at org.eclipse.jetty.util.log.Slf4jLog.<init>(Slf4jLog.java:32)
>          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
> Method)
>          at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>          at 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>          at 
> java.lang.reflect.Constructor.newInstance(Constructor.java:423)
>          at org.eclipse.jetty.util.log.Log.initialized(Log.java:178)
>          at org.eclipse.jetty.util.log.Log.getLogger(Log.java:311)
>          at org.eclipse.jetty.util.log.Log.getLogger(Log.java:301)
>          at 
> org.eclipse.jetty.xml.XmlConfiguration.<clinit>(XmlConfiguration.java:80)
>          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>          at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>          at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>          at java.lang.reflect.Method.invoke(Method.java:498)
>          at org.eclipse.jetty.start.Main.invokeMain(Main.java:220)
>          at org.eclipse.jetty.start.Main.start(Main.java:486)
>          at org.eclipse.jetty.start.Main.main(Main.java:77)
> INFO  - 2018-07-03 10:12:19.375; 
> org.apache.solr.util.configuration.SSLCredentialProviderFactory; 
> Processing SSL Credential Provider chain: env;sysprop
> Waiting up to 30 to see Solr running on port 8983
> Started Solr server on port 8983. Happy searching!
> 
> c:\solr-7.4.0\bin>
> 
> 
> 8) I managed to fix the situation temporarily as follows (but I am not 
> convinced this is the correct way to comprehensively tackle the problem)
>     Edit C:\solr-7.4.0\bin\solr.cmd as follows:
>     Change all occurrences of '-Dlog4j.configurationFile="file:' to 
> '-Dlog4j.configurationFile="' (19 ocurrences in total)
>     Change all occurrences of 'LOG4J_CONFIG=file:' to 'LOG4J_CONFIG=' (2 
> ocurrences in total)
> 
> 
> 9) Execute the following command: solr.cmd restart -p 8983
> 10) The following console output appears:
> 
> 
> c:\solr-7.4.0\bin>solr.cmd restart -p 8983
> Stopping Solr process 20024 running on port 8983
> 
> Gewartet wird 0 Sekunden. Weiter mit beliebiger Taste...
> INFO  - 2018-07-03 10:47:57.994; 
> org.apache.solr.util.configuration.SSLCredentialProviderFactory; 
> Processing SSL Credential Provider chain: env;sysprop
> Waiting up to 30 to see Solr running on port 8983
> Started Solr server on port 8983. Happy searching!
> 
> c:\solr-7.4.0\bin>
> 
> 
> 11) Can someone confirm this? Shall I open an issue?
> 
> Cheers,
> 
> Jakob
> 
Hello,

I experienced the same issue on Windows 10 professional. I don't think the OS version is important. The solr version might. I have solr-7.4.0. 
I decided to inspect the bin\solr.cmd file. At some point in the file I found the following instruction:

IF NOT DEFINED LOG4J_CONFIG set "LOG4J_CONFIG=file:%SOLR_SERVER_DIR%\resources\log4j2.xml"

To me the syntax sounds a bit cumbersome, but anyway, I decided to remove that "file:" before the env SOLR_SERVER_DIR, and I solved. So the final line is:

IF NOT DEFINED LOG4J_CONFIG set "LOG4J_CONFIG=%SOLR_SERVER_DIR%\resources\log4j2.xml"

A similar situation happens in many other instructions in the same solr.cmd file. I believe that we should remove that "file:" everywhere. Example:
-Dlog4j.configurationFile="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^
instead:
-Dlog4j.configurationFile="%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^

Hope this helps. 
Marco.

Re: Logging fails when starting Solr in Windows using solr.cmd

Posted by Erick Erickson <er...@gmail.com>.
The file:/// change was made in:
https://issues.apache.org/jira/browse/SOLR-12538, how to reconcile
these two?
On Sun, Sep 16, 2018 at 10:54 PM marcostocchi77@gmail.com
<ma...@gmail.com> wrote:
>
>
>
> On 2018/07/03 08:53:20, jakob@jafurrer.ch wrote:
> > Hi,
> >
> > I was intending to open an Issue in Jira when I read that I'm supposed
> > to first contact this mailinglist.
> >
> > Problem description
> > ==================
> >
> > System: Microsoft Windows 10 Enterprise Version 10.0.16299 Build 16299
> >
> > Steps to reproduce the problem:
> > 1) Download solr-7.4.0.tgz
> > 2) Unzip to C:\solr-7.4.0
> > 3) No changes (configuration or otherwise) whatsoever
> > 4) Open cmd.exe
> > 5) Execute the following command: cd c:\solr-7.4.0\bin
> > 6) Execute the following command: solr.cmd start -p 8983
> > 7) The following console output appears:
> >
> >
> > c:\solr-7.4.0\bin>solr.cmd start -p 8983
> > ERROR StatusLogger Unable to access
> > file:/c:/solr-7.4.0/server/file:c:/solr-7.4.0/server/scripts/cloud-scripts/log4j2.xml
> >   java.io.FileNotFoundException:
> > c:\solr-7.4.0\server\file:c:\solr-7.4.0\server\scripts\cloud-scripts\log4j2.xml
> > (Die Syntax für den Dateinamen, Verzeichnisnamen oder die
> > Datenträgerbezeichnung ist falsch)
> >          at java.io.FileInputStream.open0(Native Method)
> >          at java.io.FileInputStream.open(FileInputStream.java:195)
> >          at java.io.FileInputStream.<init>(FileInputStream.java:138)
> >          at java.io.FileInputStream.<init>(FileInputStream.java:93)
> >          at
> > sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
> >          at
> > sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
> >          at java.net.URL.openStream(URL.java:1045)
> >          at
> > org.apache.logging.log4j.core.config.ConfigurationSource.fromUri(ConfigurationSource.java:247)
> >          at
> > org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:404)
> >          at
> > org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:346)
> >          at
> > org.apache.logging.log4j.core.config.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:260)
> >          at
> > org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:615)
> >          at
> > org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:636)
> >          at
> > org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:231)
> >          at
> > org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:153)
> >          at
> > org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
> >          at
> > org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
> >          at
> > org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:121)
> >          at
> > org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:43)
> >          at
> > org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:46)
> >          at
> > org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
> >          at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
> >          at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
> >          at org.apache.solr.util.SolrCLI.<clinit>(SolrCLI.java:228)
> > ERROR StatusLogger Unable to access
> > file:/c:/solr-7.4.0/server/file:c:/solr-7.4.0/server/resources/log4j2.xml
> >   java.io.FileNotFoundException:
> > c:\solr-7.4.0\server\file:c:\solr-7.4.0\server\resources\log4j2.xml (Die
> > Syntax für den Dateinamen, Verzeichnisnamen oder die
> > Datenträgerbezeichnung ist falsch)
> >          at java.io.FileInputStream.open0(Native Method)
> >          at java.io.FileInputStream.open(FileInputStream.java:195)
> >          at java.io.FileInputStream.<init>(FileInputStream.java:138)
> >          at java.io.FileInputStream.<init>(FileInputStream.java:93)
> >          at
> > sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
> >          at
> > sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
> >          at java.net.URL.openStream(URL.java:1045)
> >          at
> > org.apache.logging.log4j.core.config.ConfigurationSource.fromUri(ConfigurationSource.java:247)
> >          at
> > org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:404)
> >          at
> > org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:346)
> >          at
> > org.apache.logging.log4j.core.config.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:260)
> >          at
> > org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:615)
> >          at
> > org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:636)
> >          at
> > org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:231)
> >          at
> > org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:153)
> >          at
> > org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
> >          at
> > org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
> >          at
> > org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:121)
> >          at
> > org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:43)
> >          at
> > org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:46)
> >          at
> > org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
> >          at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
> >          at org.eclipse.jetty.util.log.Slf4jLog.<init>(Slf4jLog.java:38)
> >          at org.eclipse.jetty.util.log.Slf4jLog.<init>(Slf4jLog.java:32)
> >          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> > Method)
> >          at
> > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> >          at
> > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> >          at
> > java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> >          at org.eclipse.jetty.util.log.Log.initialized(Log.java:178)
> >          at org.eclipse.jetty.util.log.Log.getLogger(Log.java:311)
> >          at org.eclipse.jetty.util.log.Log.getLogger(Log.java:301)
> >          at
> > org.eclipse.jetty.xml.XmlConfiguration.<clinit>(XmlConfiguration.java:80)
> >          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >          at
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> >          at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >          at java.lang.reflect.Method.invoke(Method.java:498)
> >          at org.eclipse.jetty.start.Main.invokeMain(Main.java:220)
> >          at org.eclipse.jetty.start.Main.start(Main.java:486)
> >          at org.eclipse.jetty.start.Main.main(Main.java:77)
> > INFO  - 2018-07-03 10:12:19.375;
> > org.apache.solr.util.configuration.SSLCredentialProviderFactory;
> > Processing SSL Credential Provider chain: env;sysprop
> > Waiting up to 30 to see Solr running on port 8983
> > Started Solr server on port 8983. Happy searching!
> >
> > c:\solr-7.4.0\bin>
> >
> >
> > 8) I managed to fix the situation temporarily as follows (but I am not
> > convinced this is the correct way to comprehensively tackle the problem)
> >     Edit C:\solr-7.4.0\bin\solr.cmd as follows:
> >     Change all occurrences of '-Dlog4j.configurationFile="file:' to
> > '-Dlog4j.configurationFile="' (19 ocurrences in total)
> >     Change all occurrences of 'LOG4J_CONFIG=file:' to 'LOG4J_CONFIG=' (2
> > ocurrences in total)
> >
> >
> > 9) Execute the following command: solr.cmd restart -p 8983
> > 10) The following console output appears:
> >
> >
> > c:\solr-7.4.0\bin>solr.cmd restart -p 8983
> > Stopping Solr process 20024 running on port 8983
> >
> > Gewartet wird 0 Sekunden. Weiter mit beliebiger Taste...
> > INFO  - 2018-07-03 10:47:57.994;
> > org.apache.solr.util.configuration.SSLCredentialProviderFactory;
> > Processing SSL Credential Provider chain: env;sysprop
> > Waiting up to 30 to see Solr running on port 8983
> > Started Solr server on port 8983. Happy searching!
> >
> > c:\solr-7.4.0\bin>
> >
> >
> > 11) Can someone confirm this? Shall I open an issue?
> >
> > Cheers,
> >
> > Jakob
> >
> Hello,
>
> I experienced the same issue on Windows 10 professional. I don't think the OS version is important. The solr version might. I have solr-7.4.0.
> I decided to inspect the bin\solr.cmd file. At some point in the file I found the following instruction:
>
> IF NOT DEFINED LOG4J_CONFIG set "LOG4J_CONFIG=file:%SOLR_SERVER_DIR%\resources\log4j2.xml"
>
> To me the syntax sounds a bit cumbersome, but anyway, I decided to remove that "file:" before the env SOLR_SERVER_DIR, and I solved. So the final line is:
>
> IF NOT DEFINED LOG4J_CONFIG set "LOG4J_CONFIG=%SOLR_SERVER_DIR%\resources\log4j2.xml"
>
> A similar situation happens in many other instructions in the same solr.cmd file. I believe that we should remove that "file:" everywhere. Example:
> -Dlog4j.configurationFile="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^
> instead:
> -Dlog4j.configurationFile="%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^
>
> Hope this helps.
> Marco.

Re: Logging fails when starting Solr in Windows using solr.cmd

Posted by Oskar <o....@hima.com>.
I faced the same issue as jakob with solr-7.6.0, eclipse-2018-12 (4.10.0),
Java 1.8.0_191:

*Solution:*
In eclipse Run Configuration run-solr
remove "file:" from Argument
-Dlog4j.configurationFile="file:${workspace_loc:solr-7.6.0}/solr/server/resources/log4j2.xml"




--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: Logging fails when starting Solr in Windows using solr.cmd

Posted by Shawn Heisey <ap...@elyograg.org>.
On 9/16/2018 3:05 PM, marcostocchi77@gmail.com wrote:
> I experienced the same issue on Windows 10 professional. I don't think the OS version is important. The solr version might. I have solr-7.4.0.

The problem has been fixed in the source code and the next version of 
Solr (7.5.0) won't experience this issue.

https://issues.apache.org/jira/browse/SOLR-12538

We had a problem with Jira and ended up erasing all logs in Jira related 
to the change.  The git repository still has it.

https://git1-us-west.apache.org/repos/asf?p=lucene-solr.git;a=commit;h=93ae3669

Thanks,
Shawn