XML configuration parsing is now more strict about situations where a single setting is allowed but multiple values are found. In the past, one value would be chosen arbitrarily and silently. Starting with 4.5, configuration parsing will fail with an error in situations like this. If you see error messages such as "solrconfig.xml contains more than one value for config path: XXXXX" or "Found Z configuration sections when at most 1 is allowed matching expression: XXXXX" check your solrconfig.xml file for multiple occurrences of XXXXX and delete the ones that you do not wish to use. See SOLR-4953 & SOLR-5108 for more details.

http://archive.apache.org/dist/lucene/solr/4.5.0/changes/Changes.html#v4...

The following settings are multiple but should be a single (and cause errors in solr 4.5)

  • useCompoundFile
  • ramBufferSizeMB
  • mergeFactor
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Nick_vh’s picture

Can you provide a patch and will it still work with solr 4.4 or lower?

Nick_vh’s picture

Status: Active » Needs review
FileSize
509 bytes

Hmm, makes sense - these duplicate values should have never been in there.

checker’s picture

#2 is working on solr 4.5.

drunken monkey’s picture

These should also be removed for 3.x, I'd say. Even though no 3.x version will complain, it's still wrong conceptually.

Also, are you sure this removes the right version? The mergeFactor differs between the two, and the one you delete in your patch looks like the one we explicitly wanted to set (since the other appears as-is in the example configs).

In any case, thanks a lot for reporting, checker! (Stupid Apache, soon they'll be releasing a new Solr version every week …)

cspitzlay’s picture

Here is a patch that keeps the value 10.

@drunken monkey: In 3.x there are two separate sections:
indexDefaults and mainIndex, and both have only one instance of each of the three parameters.
So there are no duplicates.

In 4 the situation is different:
From example/solr/collection1/conf/solrconfig.xml in the solr 4.5.1 distribution,
about the <indexConfig> element:
"Note: This replaces <indexDefaults> and <mainIndex> from older versions"
It seems to me the values from these two elements were merged (incorrectly) when porting the version 3 config to 4. Just guessing, though.

Nick_vh’s picture

Just to add some information but the value should be 4, not 10. 10 is way too much for Drupal sites and the way they behave (more reads versus writes)

Details on the why is available here : http://nickveenhof.be/blog/upgrading-apache-solr-14-35-and-its-implications

cspitzlay’s picture

I see. Thanks for the pointer.

Then what is still required before #2 can be committed?

I don't see how this change could break 4.4 and earlier, judging from the docs quoted by checker.
Two of the definitions are identical anyway, and the docs talk about 4.4 and earlier choosing one of the values arbitrarily which means that you might have gotten 10 instead of 4 all along. So applying this patch even seems to fix a potential bug in 4.4 and earlier.

drunken monkey’s picture

Status: Needs review » Reviewed & tested by the community

@drunken monkey: In 3.x there are two separate sections:
indexDefaults and mainIndex, and both have only one instance of each of the three parameters.
So there are no duplicates.

Oh, you're right. Thanks for the correction, and sorry I was a bit hast there.

As far as I'm concerned, #2 is ready to go then.

Yet Another User’s picture

I have the same kind of issue. Could you tell me on which file I need to apply this patch?
Please correct me if I am wrong, I am trying to apply this way.

[root@sitename solr]# cd collection1/conf/
[root@sitename conf]# patch -p0 --dry-run < 2107417-2.patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/solr-conf/solr-4.x/solrconfig.xml b/solr-conf/solr-4.x/solrconfig.xml
|index 9b866ce..54d844a 100644
|--- a/solr-conf/solr-4.x/solrconfig.xml
|+++ b/solr-conf/solr-4.x/solrconfig.xml
--------------------------
File to patch: solrconfig.xml
patching file solrconfig.xml
[root@sitename conf]# lsof -i :8983
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 30377 root 70u IPv4 347688 0t0 TCP *:8983 (LISTEN)
[root@sitename conf]# kill -9 30377
[root@sitename example]# java -jar start.jar

2625 [coreLoadExecutor-3-thread-1] WARN org.apache.solr.core.SolrResourceLoader – Can't find (or read) directory to add to classloader: ../../contrib/clustering/lib/ (resolved as: /opt/solr-4.5.1/example/solr/collection1/../../contrib/clustering/lib).
2844 [coreLoadExecutor-3-thread-1] ERROR org.apache.solr.core.CoreContainer – Failed to load file /opt/solr-4.5.1/example/solr/collection1/solrconfig.xml
2849 [coreLoadExecutor-3-thread-1] ERROR org.apache.solr.core.CoreContainer – Unable to create core: collection1
org.apache.solr.common.SolrException: Could not load config file /opt/solr-4.5.1/example/solr/collection1/solrconfig.xml
2856 [coreLoadExecutor-3-thread-1] ERROR org.apache.solr.core.CoreContainer – null:org.apache.solr.common.SolrException: Unable to create core: collection1

It still gives the same error.
Please reply.

Thanks

Yet Another User’s picture

Status: Reviewed & tested by the community » Active
checker’s picture

Status: Active » Reviewed & tested by the community

@Mohit Mittal
I think your problem is different to the bug here is described. Your path to /lib is wrong in your solrconfig.xml.

Yet Another User’s picture

@checker

Could you tell me what path I need to give and where exactly in the file?

Thanks
Mohit Mittal

FiNeX’s picture

Patch #2 works fine on solr 4.5. Thanks :-)

Yet Another User’s picture

@FiNeX,

1) Could you tell me which file you have patched?

When I give localhost:8983, it returns not found.

How and where do I need to change the path of lib?

Please help.

Thanks

Yet Another User’s picture

FileSize
133.46 KB

Hi,

I have installed Tomcat Server now and I tried "java -jar start.jar" again and it worked with some errors.

Here are the errors,

2633 [coreLoadExecutor-3-thread-1] WARN org.apache.solr.core.SolrResourceLoader – Can't find (or read) directory to add to classloader: ../../contrib/extraction/lib (resolved as: /opt/solr-4.5.1/example/solr/collection1/../../contrib/extraction/lib).

2634 [coreLoadExecutor-3-thread-1] WARN org.apache.solr.core.SolrResourceLoader – Can't find (or read) directory to add to classloader: ../../contrib/clustering/lib/ (resolved as: /opt/solr-4.5.1/example/solr/collection1/../../contrib/clustering/lib).

2850 [coreLoadExecutor-3-thread-1] ERROR org.apache.solr.core.CoreContainer – Failed to load file /opt/solr-4.5.1/example/solr/collection1/solrconfig.xml

2851 [coreLoadExecutor-3-thread-1] ERROR org.apache.solr.core.CoreContainer – Unable to create core: collection1
org.apache.solr.common.SolrException: Could not load config file /opt/solr-4.5.1/example/solr/collection1/solrconfig.xml

2856 [coreLoadExecutor-3-thread-1] ERROR org.apache.solr.core.CoreContainer – null:org.apache.solr.common.SolrException: Unable to create core: collection1

But when I tried to run localhost:8983, it gave me this (please find the attachments)

Please let me know what should I do?

Thanks

Nick_vh’s picture

Status: Reviewed & tested by the community » Fixed

Committed patch #2, thanks!

Mohit Mittal, please try the Solr forums as this is out of scope for this project and it looks more like a server issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

StephenBrown’s picture

Title: Multiple values in solrconfig.xml cause error with solr 4.5. » Multiple values in solrconfig.xml cause error with solr 4.5+
Issue summary: View changes
Status: Closed (fixed) » Reviewed & tested by the community

When/where was this committed? I don't see a message in the commit log, and those lines still exist in 7.x-1.6.

http://drupalcode.org/project/apachesolr.git/blob/7.x-1.6:/solr-conf/sol...

drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

It was fixed in this module, the common config files, and that's what this issue is about.
The fix is already included in the Search API Solr module (though a new release with it is pending) and I'm sure it will be committed to the Apache Solr Search Integration module very soon, too.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Alexander Allen’s picture

Re-opening.

I just downloaded the apachesolr module and applied the instructions per the README.txt and ran straight into the error mentioned in this ticket.

I do not know if the fix in patch #2 has been committed or not, but this has definitely not made it into the current stable release.

Removing the three lines mentioned in patch #2 worked for me, working against the latest version of Solr downloaded from Apache mirrors - 4.7.0:

http://www.apache.org/dyn/closer.cgi/lucene/solr/4.7.0

Alexander Allen’s picture

Status: Closed (fixed) » Reviewed & tested by the community
geerlingguy’s picture

Status: Reviewed & tested by the community » Closed (fixed)

It looks like the patch in #2 (not the later patch with mergeFactor 10) was committed to the Apache Solr Search integration (it's in the dev release only right now).