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 Marc Sturlese <ma...@gmail.com> on 2009/11/23 18:17:05 UTC

error with multicore CREATE action

Hey there,
I am using Solr 1.4 out of the box and am trying to create a core at runtime
using the CREATE action.
I am getting this error when executing:
http://localhost:8983/solr/admin/cores?action=CREATE&name=xxxxx&instanceDir=xxxxx&persist=true&config=solrconfig.xml&schema=schema.xml&dataDir=data

Nov 23, 2009 6:18:44 PM org.apache.solr.core.SolrResourceLoader <init>
INFO: Solr home set to 'solr/xxxxx/'
Nov 23, 2009 6:18:44 PM org.apache.solr.common.SolrException log
SEVERE: org.apache.solr.common.SolrException: Error executing default
implementation of CREATE
	at
org.apache.solr.handler.admin.CoreAdminHandler.handleCreateAction(CoreAdminHandler.java:250)
	at
org.apache.solr.handler.admin.CoreAdminHandler.handleRequestBody(CoreAdminHandler.java:111)
	at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
	at
org.apache.solr.servlet.SolrDispatchFilter.handleAdminRequest(SolrDispatchFilter.java:298)
	at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:174)
	at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
	at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
	at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:211)
	at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
	at org.mortbay.jetty.Server.handle(Server.java:285)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:502)
	at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:821)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:208)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:378)
	at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:226)
	at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
Caused by: java.lang.RuntimeException: Can't find resource 'solrconfig.xml'
in classpath or 'solr/xxxxx/conf/',
cwd=/home/smack/Desktop/apache-solr-1.4.0/example
	at
org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:260)
	at
org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:228)
	at org.apache.solr.core.Config.<init>(Config.java:101)
	at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:130)
	at org.apache.solr.core.CoreContainer.create(CoreContainer.java:405)
	at
org.apache.solr.handler.admin.CoreAdminHandler.handleCreateAction(CoreAdminHandler.java:245)
	... 21 more

I don't know if I am missing something. Should I create manually de folders
and schema and solconfig files?

-- 
View this message in context: http://old.nabble.com/error-with-multicore-CREATE-action-tp26482255p26482255.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: error with multicore CREATE action

Posted by Chris Hostetter <ho...@fucit.org>.
: > : directory is created if it does not exist. Since it calls File#mkdirs,
: > all
: > : parent directories are also created. I don't think Solr creates those
: > : directories by itself.
	...
: Yes, that is correct but those changes are not in trunk right now. We're
: planning to spend some time in the next few weeks in splitting that big
: patch into smaller ones, adding tests and pushing them into trunk.
: LotsOfCores still needs LotsOfWork :)

The point i'm trying to get at is that according to the initial comments 
in this thread, CREATE does *appear* to be creating new instanceDirs on 
the fly because of the mkdirs behavior as you mentioened -- my concern is 
that the way you worded your reply suggests that this is a fluke, and 
doesnt' work properly (ie: is everything properly initialized? does 
persistence work?) ... if that's the case, then untill it does work, we 
should propbably have an explict test for the instanceDir and fail if it 
doesn't exist.

On the other hand: if it already works, it already works -- and we should 
document it.



-Hoss


Re: error with multicore CREATE action

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Thu, Nov 26, 2009 at 12:43 AM, Chris Hostetter
<ho...@fucit.org>wrote:

> :
> : > Are there any use cases for CREATE where the instance directory
> : > *doesn't* yet exist? I ask because I've noticed that Solr will create
> : > an instance directory for me sometimes with the CREATE command. In
>         ...
> : I guess when you try to add documents and an IndexWriter is opened, the
> data
> : directory is created if it does not exist. Since it calls File#mkdirs,
> all
> : parent directories are also created. I don't think Solr creates those
> : directories by itself.
>
> Shalin: I'm confused, wasn't this one of the original use cases for the
> CREATE command as part of the "LotsOfCores" work you and Noble have been
> pushing forward?  I thought one of the goals was that a user could have a
> single solrconfig.xml+schema.xml on disk somewhere, and then at run time
> use the CREATE command to caused many, many new cores to be created (each
> with a new/unqiue instanceDir).
>
>
Yes, that is correct but those changes are not in trunk right now. We're
planning to spend some time in the next few weeks in splitting that big
patch into smaller ones, adding tests and pushing them into trunk.
LotsOfCores still needs LotsOfWork :)

-- 
Regards,
Shalin Shekhar Mangar.

Re: error with multicore CREATE action

Posted by Chris Hostetter <ho...@fucit.org>.
: 
: > Are there any use cases for CREATE where the instance directory
: > *doesn't* yet exist? I ask because I've noticed that Solr will create
: > an instance directory for me sometimes with the CREATE command. In
	...
: I guess when you try to add documents and an IndexWriter is opened, the data
: directory is created if it does not exist. Since it calls File#mkdirs, all
: parent directories are also created. I don't think Solr creates those
: directories by itself.

Shalin: I'm confused, wasn't this one of the original use cases for the 
CREATE command as part of the "LotsOfCores" work you and Noble have been 
pushing forward?  I thought one of the goals was that a user could have a 
single solrconfig.xml+schema.xml on disk somewhere, and then at run time 
use the CREATE command to caused many, many new cores to be created (each 
with a new/unqiue instanceDir).

If that isn't intended (and therefor: not handled well) then we should 
probably make the CREATE command test for the existence of the specified 
instanceDir and error if it doesn't already exist -- otherwise a typo in 
an instanceDir file path could lead to some really unexpected behavior.



-Hoss


Re: error with multicore CREATE action

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Mon, Nov 23, 2009 at 11:49 PM, Chris Harris <ry...@gmail.com> wrote:

> Are there any use cases for CREATE where the instance directory
> *doesn't* yet exist? I ask because I've noticed that Solr will create
> an instance directory for me sometimes with the CREATE command. In
> particular, if I run something like
>
> http://solrhost/solr/admin/cores?action=CREATE&name=newcore&instanceDir=d
> :\dir_that_does_not_exist\&config=C:\dir_that_does_exist\solrconfig.xml&schema=C:\dir_that_does_exist\schema.xml
>
> then Solr will create
>
> d:\dir_that_does_not_exist
>
> and
>
> d:\dir_that_does_not_exist\data
>
>
I guess when you try to add documents and an IndexWriter is opened, the data
directory is created if it does not exist. Since it calls File#mkdirs, all
parent directories are also created. I don't think Solr creates those
directories by itself.

-- 
Regards,
Shalin Shekhar Mangar.

Re: error with multicore CREATE action

Posted by Chris Harris <ry...@gmail.com>.
Are there any use cases for CREATE where the instance directory
*doesn't* yet exist? I ask because I've noticed that Solr will create
an instance directory for me sometimes with the CREATE command. In
particular, if I run something like

http://solrhost/solr/admin/cores?action=CREATE&name=newcore&instanceDir=d:\dir_that_does_not_exist\&config=C:\dir_that_does_exist\solrconfig.xml&schema=C:\dir_that_does_exist\schema.xml

then Solr will create

d:\dir_that_does_not_exist

and

d:\dir_that_does_not_exist\data

for me (but not d:\dir_that_does_not_exist\conf).

Maybe this has to do with some particularly in my solrconfig.xml?
(There I've commented out the dataDir element because I prefer the
default behavior to what you get with "${solr.data.dir:./solr/data}".)

2009/11/23 Shalin Shekhar Mangar <sh...@gmail.com>:

> The instance directory and the configuration files should exist before you
> can create a core. The core CREATE command just creates a Solr core instance
> in memory after reading the configuration from disk.

Re: error with multicore CREATE action

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Mon, Nov 23, 2009 at 10:47 PM, Marc Sturlese <ma...@gmail.com>wrote:

>
> Hey there,
> I am using Solr 1.4 out of the box and am trying to create a core at
> runtime
> using the CREATE action.
> I am getting this error when executing:
>
> http://localhost:8983/solr/admin/cores?action=CREATE&name=xxxxx&instanceDir=xxxxx&persist=true&config=solrconfig.xml&schema=schema.xml&dataDir=data
>
> Nov 23, 2009 6:18:44 PM org.apache.solr.core.SolrResourceLoader <init>
> INFO: Solr home set to 'solr/xxxxx/'
> Nov 23, 2009 6:18:44 PM org.apache.solr.common.SolrException log
> SEVERE: org.apache.solr.common.SolrException: Error executing default
> implementation of CREATE
>        at
>
> org.apache.solr.handler.admin.CoreAdminHandler.handleCreateAction(CoreAdminHandler.java:250)
>        at
> <snip>



>
> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
> Caused by: java.lang.RuntimeException: Can't find resource 'solrconfig.xml'
> in classpath or 'solr/xxxxx/conf/',
> cwd=/home/smack/Desktop/apache-solr-1.4.0/example
>        at
>
> org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:260)
>        at
>
> org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:228)
>        at org.apache.solr.core.Config.<init>(Config.java:101)
>        at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:130)
>        at org.apache.solr.core.CoreContainer.create(CoreContainer.java:405)
>        at
>
> org.apache.solr.handler.admin.CoreAdminHandler.handleCreateAction(CoreAdminHandler.java:245)
>        ... 21 more
>
> I don't know if I am missing something. Should I create manually de folders
> and schema and solconfig files?
>
>
The instance directory and the configuration files should exist before you
can create a core. The core CREATE command just creates a Solr core instance
in memory after reading the configuration from disk.

-- 
Regards,
Shalin Shekhar Mangar.