You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@polygene.apache.org by Niclas Hedhman <ni...@hedhman.org> on 2015/06/09 13:23:29 UTC

[Elastic Search] exception on startup

Paul (since you wrote this once upon a time),

I get an exception every time the Elastic Search Extension is loaded, even
if I wipe the $HOME/Library/Application Support/myapp where it seems that
ES extension is using (oh, yeah I am using the file system store)

Any ideas? Is it expected?


Caused by: org.elasticsearch.indices.IndexAlreadyExistsException:
[qi4j_index] already exists
    at
org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validateIndexName(MetaDataCreateIndexService.java:164)
    at
org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validate(MetaDataCreateIndexService.java:539)
    at
org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.access$100(MetaDataCreateIndexService.java:89)
    at
org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$2.execute(MetaDataCreateIndexService.java:229)
    at
org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:328)
    at
org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:153)
    at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    ... 1 more

Cheers
-- 
Niclas Hedhman, Software Developer
http://zest.apache.org - New Energy for Java

Re: [Elastic Search] exception on startup

Posted by Niclas Hedhman <ni...@hedhman.org>.
The concept of having Configuration as Entities was a great thing, IMHO,
and we shouldn't toss that out because of this issue at the "configuration
of the stuff that handles the configuration"-part.

But, maybe a separate mechanism should be used specifically for
EntityStores and Indexing subsystems, since they are very very unlikely to
be modified in the same manner.

Let's keep this open...

On Tue, Jun 9, 2015 at 9:18 PM, Paul Merlin <pa...@nosphere.org> wrote:

> Hey gang,
>
> Yes that's an assembly issue.
>
> Every now an then I myself fight with this.
> This is very hard for newcomers, and very frustrating for every others ;)
> Maybe Stan is right and we should do something about it in 3.
>
> Cheers
>
> /Paul
>
>
>


-- 
Niclas Hedhman, Software Developer
http://zest.apache.org - New Energy for Java

Re: [Elastic Search] exception on startup

Posted by Paul Merlin <pa...@nosphere.org>.
Hey gang,

Yes that's an assembly issue.

Every now an then I myself fight with this.
This is very hard for newcomers, and very frustrating for every others ;)
Maybe Stan is right and we should do something about it in 3.

Cheers

/Paul



Re: [Elastic Search] exception on startup

Posted by Stanislav Muhametsin <st...@zest.mail.kapsi.fi>.
On 9.6.2015 15:44, Niclas Hedhman wrote:
> Yeah, and that is why I was putting it in a Config MODULE inside Infra
> Layer... But Wait!! There is MORE !!!
>
>    a. ES Config is in the Config Module
>
>    b. On manipulation of that Configuration Entity Composite, the
> StateNotificationConcern will locate all visible StateChangeListeners and
> call them.
>
>    c. The ElasticSearchIndexer implements this and must either reside inside
> the Storage Module, with Visibility.module, or if it has its own Indexing
> Module (my case), the StateNotication will see it... BAM.
>
> So!! Either Indexer need to be Visibility.module and inside the Storage
> Module, OR the Configuration needs to be in its own Layer below.
>
>
Slightly off-topic and not helpful to the actual problem solving:

I remember stumbling upon this issue some years ago when I was still 
actively using Java (and Qi4j).
I think the underlying problem is that Qi4j is coupling too tightly the 
concepts of 'entity' and 'configuration composite'.
Thus basically forcing a pattern of having separate configuration layer 
for any serious and big application.
This is not necessarily a bad idea in itself, a good application design 
usually tends to put configuration stuff into its own, usually lowermost 
layer.

Problem is, as your application becomes more complex to assemble (e.g. 
the test case you are running), issues like this start to arise and are 
very problematic to debug.
IMO for Qi4j/Zest 3.0, the whole configuration aspect should be 
revisited and re-thought properly.
Especially new users are guaranteed to stumble on problems like this, 
thus making adaptation of Qi4j/Zest really slow and troublesome.

Re: [Elastic Search] exception on startup

Posted by Niclas Hedhman <ni...@hedhman.org>.
Yeah, and that is why I was putting it in a Config MODULE inside Infra
Layer... But Wait!! There is MORE !!!

  a. ES Config is in the Config Module

  b. On manipulation of that Configuration Entity Composite, the
StateNotificationConcern will locate all visible StateChangeListeners and
call them.

  c. The ElasticSearchIndexer implements this and must either reside inside
the Storage Module, with Visibility.module, or if it has its own Indexing
Module (my case), the StateNotication will see it... BAM.

So!! Either Indexer need to be Visibility.module and inside the Storage
Module, OR the Configuration needs to be in its own Layer below.



On Tue, Jun 9, 2015 at 8:18 PM, Jiri Jetmar <ju...@gmail.com>
wrote:

> hmm.. I think it was because of the In-Memory EntityStore required for the
> configuration.. Thats the reason for the dedicated config module.. This
> chicken-egg issue..  at least when I remember correctly..
>
>
>
> 2015-06-09 14:13 GMT+02:00 Niclas Hedhman <ni...@hedhman.org>:
>
> > Ok, the reason is "found"... The most typical of problems...
> >
> > The Configuration object of the ES extension triggers the
> > StateChangeNotification back to the ElasticSearch extension, which isn't
> > ready to process it yet.
> >
> > Was this the reason why we always need a Configuration Layer, and a
> Config
> > Module in Infra can't be made work?
> >
> > Cheers
> >
> > On Tue, Jun 9, 2015 at 8:01 PM, Niclas Hedhman <ni...@hedhman.org>
> wrote:
> >
> > > That second one is probably a consequence of the first problem, as the
> > > client=null at passivation...
> > >
> > > On Tue, Jun 9, 2015 at 7:55 PM, Niclas Hedhman <ni...@hedhman.org>
> > wrote:
> > >
> > >>
> > >> Well, how can there be an existing Index the first time it is run?
> > >> Remember, I am not using ES directly, only that the ES extension
> > attaches
> > >> itself to the EntityStateListener notification...
> > >>
> > >> Just now, I go another problem, so I suspect that I am missing some
> > >> crucial setup/assembly part. Perhaps I just change to the RDF indexer
> > >> instead...
> > >>
> > >>
> > >> Caused by: java.lang.NullPointerException
> > >>     at
> > >>
> >
> org.qi4j.index.elasticsearch.ElasticSearchIndexer$Mixin.notifyChanges(ElasticSearchIndexer.java:105)
> > >>     at
> > >>
> >
> org.qi4j.spi.entitystore.StateChangeNotificationConcern$1.commit(StateChangeNotificationConcern.java:44)
> > >>     at
> > >>
> >
> org.qi4j.spi.entitystore.ConcurrentModificationCheckConcern$ConcurrentCheckingEntityStoreUnitOfWork$1.commit(ConcurrentModificationCheckConcern.java:117)
> > >>     at
> > >>
> >
> org.qi4j.api.configuration.Configuration$ConfigurationMixin.initializeConfigurationInstance(Configuration.java:281)
> > >>
> > >>
> > >> On Tue, Jun 9, 2015 at 7:42 PM, Jiri Jetmar <juergen.jetmar@gmail.com
> >
> > >> wrote:
> > >>
> > >>> Just a guess - it looks like that you are trying to create a index
> > with a
> > >>> name that is already existing.
> > >>>
> > >>> Possible solutions are :
> > >>>
> > >>> - check if the index is already created
> > >>> - delete the file-based storage (this approach is used in the unit
> > tests)
> > >>> - Use each time a new name
> > >>>
> > >>> What is the context of this "myapp" ?
> > >>>
> > >>> Cheers,
> > >>> jj
> > >>>
> > >>> 2015-06-09 13:23 GMT+02:00 Niclas Hedhman <ni...@hedhman.org>:
> > >>>
> > >>> > Paul (since you wrote this once upon a time),
> > >>> >
> > >>> > I get an exception every time the Elastic Search Extension is
> loaded,
> > >>> even
> > >>> > if I wipe the $HOME/Library/Application Support/myapp where it
> seems
> > >>> that
> > >>> > ES extension is using (oh, yeah I am using the file system store)
> > >>> >
> > >>> > Any ideas? Is it expected?
> > >>> >
> > >>> >
> > >>> > Caused by: org.elasticsearch.indices.IndexAlreadyExistsException:
> > >>> > [qi4j_index] already exists
> > >>> >     at
> > >>> >
> > >>> >
> > >>>
> >
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validateIndexName(MetaDataCreateIndexService.java:164)
> > >>> >     at
> > >>> >
> > >>> >
> > >>>
> >
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validate(MetaDataCreateIndexService.java:539)
> > >>> >     at
> > >>> >
> > >>> >
> > >>>
> >
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.access$100(MetaDataCreateIndexService.java:89)
> > >>> >     at
> > >>> >
> > >>> >
> > >>>
> >
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$2.execute(MetaDataCreateIndexService.java:229)
> > >>> >     at
> > >>> >
> > >>> >
> > >>>
> >
> org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:328)
> > >>> >     at
> > >>> >
> > >>> >
> > >>>
> >
> org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:153)
> > >>> >     at
> > >>> >
> > >>> >
> > >>>
> >
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> > >>> >     at
> > >>> >
> > >>> >
> > >>>
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> > >>> >     ... 1 more
> > >>> >
> > >>> > Cheers
> > >>> > --
> > >>> > Niclas Hedhman, Software Developer
> > >>> > http://zest.apache.org - New Energy for Java
> > >>> >
> > >>>
> > >>
> > >>
> > >>
> > >> --
> > >> Niclas Hedhman, Software Developer
> > >> http://zest.apache.org - New Energy for Java
> > >>
> > >
> > >
> > >
> > > --
> > > Niclas Hedhman, Software Developer
> > > http://zest.apache.org - New Energy for Java
> > >
> >
> >
> >
> > --
> > Niclas Hedhman, Software Developer
> > http://zest.apache.org - New Energy for Java
> >
>



-- 
Niclas Hedhman, Software Developer
http://zest.apache.org - New Energy for Java

Re: [Elastic Search] exception on startup

Posted by Jiri Jetmar <ju...@gmail.com>.
hmm.. I think it was because of the In-Memory EntityStore required for the
configuration.. Thats the reason for the dedicated config module.. This
chicken-egg issue..  at least when I remember correctly..



2015-06-09 14:13 GMT+02:00 Niclas Hedhman <ni...@hedhman.org>:

> Ok, the reason is "found"... The most typical of problems...
>
> The Configuration object of the ES extension triggers the
> StateChangeNotification back to the ElasticSearch extension, which isn't
> ready to process it yet.
>
> Was this the reason why we always need a Configuration Layer, and a Config
> Module in Infra can't be made work?
>
> Cheers
>
> On Tue, Jun 9, 2015 at 8:01 PM, Niclas Hedhman <ni...@hedhman.org> wrote:
>
> > That second one is probably a consequence of the first problem, as the
> > client=null at passivation...
> >
> > On Tue, Jun 9, 2015 at 7:55 PM, Niclas Hedhman <ni...@hedhman.org>
> wrote:
> >
> >>
> >> Well, how can there be an existing Index the first time it is run?
> >> Remember, I am not using ES directly, only that the ES extension
> attaches
> >> itself to the EntityStateListener notification...
> >>
> >> Just now, I go another problem, so I suspect that I am missing some
> >> crucial setup/assembly part. Perhaps I just change to the RDF indexer
> >> instead...
> >>
> >>
> >> Caused by: java.lang.NullPointerException
> >>     at
> >>
> org.qi4j.index.elasticsearch.ElasticSearchIndexer$Mixin.notifyChanges(ElasticSearchIndexer.java:105)
> >>     at
> >>
> org.qi4j.spi.entitystore.StateChangeNotificationConcern$1.commit(StateChangeNotificationConcern.java:44)
> >>     at
> >>
> org.qi4j.spi.entitystore.ConcurrentModificationCheckConcern$ConcurrentCheckingEntityStoreUnitOfWork$1.commit(ConcurrentModificationCheckConcern.java:117)
> >>     at
> >>
> org.qi4j.api.configuration.Configuration$ConfigurationMixin.initializeConfigurationInstance(Configuration.java:281)
> >>
> >>
> >> On Tue, Jun 9, 2015 at 7:42 PM, Jiri Jetmar <ju...@gmail.com>
> >> wrote:
> >>
> >>> Just a guess - it looks like that you are trying to create a index
> with a
> >>> name that is already existing.
> >>>
> >>> Possible solutions are :
> >>>
> >>> - check if the index is already created
> >>> - delete the file-based storage (this approach is used in the unit
> tests)
> >>> - Use each time a new name
> >>>
> >>> What is the context of this "myapp" ?
> >>>
> >>> Cheers,
> >>> jj
> >>>
> >>> 2015-06-09 13:23 GMT+02:00 Niclas Hedhman <ni...@hedhman.org>:
> >>>
> >>> > Paul (since you wrote this once upon a time),
> >>> >
> >>> > I get an exception every time the Elastic Search Extension is loaded,
> >>> even
> >>> > if I wipe the $HOME/Library/Application Support/myapp where it seems
> >>> that
> >>> > ES extension is using (oh, yeah I am using the file system store)
> >>> >
> >>> > Any ideas? Is it expected?
> >>> >
> >>> >
> >>> > Caused by: org.elasticsearch.indices.IndexAlreadyExistsException:
> >>> > [qi4j_index] already exists
> >>> >     at
> >>> >
> >>> >
> >>>
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validateIndexName(MetaDataCreateIndexService.java:164)
> >>> >     at
> >>> >
> >>> >
> >>>
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validate(MetaDataCreateIndexService.java:539)
> >>> >     at
> >>> >
> >>> >
> >>>
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.access$100(MetaDataCreateIndexService.java:89)
> >>> >     at
> >>> >
> >>> >
> >>>
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$2.execute(MetaDataCreateIndexService.java:229)
> >>> >     at
> >>> >
> >>> >
> >>>
> org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:328)
> >>> >     at
> >>> >
> >>> >
> >>>
> org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:153)
> >>> >     at
> >>> >
> >>> >
> >>>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> >>> >     at
> >>> >
> >>> >
> >>>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> >>> >     ... 1 more
> >>> >
> >>> > Cheers
> >>> > --
> >>> > Niclas Hedhman, Software Developer
> >>> > http://zest.apache.org - New Energy for Java
> >>> >
> >>>
> >>
> >>
> >>
> >> --
> >> Niclas Hedhman, Software Developer
> >> http://zest.apache.org - New Energy for Java
> >>
> >
> >
> >
> > --
> > Niclas Hedhman, Software Developer
> > http://zest.apache.org - New Energy for Java
> >
>
>
>
> --
> Niclas Hedhman, Software Developer
> http://zest.apache.org - New Energy for Java
>

Re: [Elastic Search] exception on startup

Posted by Niclas Hedhman <ni...@hedhman.org>.
Ok, the reason is "found"... The most typical of problems...

The Configuration object of the ES extension triggers the
StateChangeNotification back to the ElasticSearch extension, which isn't
ready to process it yet.

Was this the reason why we always need a Configuration Layer, and a Config
Module in Infra can't be made work?

Cheers

On Tue, Jun 9, 2015 at 8:01 PM, Niclas Hedhman <ni...@hedhman.org> wrote:

> That second one is probably a consequence of the first problem, as the
> client=null at passivation...
>
> On Tue, Jun 9, 2015 at 7:55 PM, Niclas Hedhman <ni...@hedhman.org> wrote:
>
>>
>> Well, how can there be an existing Index the first time it is run?
>> Remember, I am not using ES directly, only that the ES extension attaches
>> itself to the EntityStateListener notification...
>>
>> Just now, I go another problem, so I suspect that I am missing some
>> crucial setup/assembly part. Perhaps I just change to the RDF indexer
>> instead...
>>
>>
>> Caused by: java.lang.NullPointerException
>>     at
>> org.qi4j.index.elasticsearch.ElasticSearchIndexer$Mixin.notifyChanges(ElasticSearchIndexer.java:105)
>>     at
>> org.qi4j.spi.entitystore.StateChangeNotificationConcern$1.commit(StateChangeNotificationConcern.java:44)
>>     at
>> org.qi4j.spi.entitystore.ConcurrentModificationCheckConcern$ConcurrentCheckingEntityStoreUnitOfWork$1.commit(ConcurrentModificationCheckConcern.java:117)
>>     at
>> org.qi4j.api.configuration.Configuration$ConfigurationMixin.initializeConfigurationInstance(Configuration.java:281)
>>
>>
>> On Tue, Jun 9, 2015 at 7:42 PM, Jiri Jetmar <ju...@gmail.com>
>> wrote:
>>
>>> Just a guess - it looks like that you are trying to create a index with a
>>> name that is already existing.
>>>
>>> Possible solutions are :
>>>
>>> - check if the index is already created
>>> - delete the file-based storage (this approach is used in the unit tests)
>>> - Use each time a new name
>>>
>>> What is the context of this "myapp" ?
>>>
>>> Cheers,
>>> jj
>>>
>>> 2015-06-09 13:23 GMT+02:00 Niclas Hedhman <ni...@hedhman.org>:
>>>
>>> > Paul (since you wrote this once upon a time),
>>> >
>>> > I get an exception every time the Elastic Search Extension is loaded,
>>> even
>>> > if I wipe the $HOME/Library/Application Support/myapp where it seems
>>> that
>>> > ES extension is using (oh, yeah I am using the file system store)
>>> >
>>> > Any ideas? Is it expected?
>>> >
>>> >
>>> > Caused by: org.elasticsearch.indices.IndexAlreadyExistsException:
>>> > [qi4j_index] already exists
>>> >     at
>>> >
>>> >
>>> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validateIndexName(MetaDataCreateIndexService.java:164)
>>> >     at
>>> >
>>> >
>>> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validate(MetaDataCreateIndexService.java:539)
>>> >     at
>>> >
>>> >
>>> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.access$100(MetaDataCreateIndexService.java:89)
>>> >     at
>>> >
>>> >
>>> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$2.execute(MetaDataCreateIndexService.java:229)
>>> >     at
>>> >
>>> >
>>> org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:328)
>>> >     at
>>> >
>>> >
>>> org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:153)
>>> >     at
>>> >
>>> >
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>>> >     at
>>> >
>>> >
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>>> >     ... 1 more
>>> >
>>> > Cheers
>>> > --
>>> > Niclas Hedhman, Software Developer
>>> > http://zest.apache.org - New Energy for Java
>>> >
>>>
>>
>>
>>
>> --
>> Niclas Hedhman, Software Developer
>> http://zest.apache.org - New Energy for Java
>>
>
>
>
> --
> Niclas Hedhman, Software Developer
> http://zest.apache.org - New Energy for Java
>



-- 
Niclas Hedhman, Software Developer
http://zest.apache.org - New Energy for Java

Re: [Elastic Search] exception on startup

Posted by Niclas Hedhman <ni...@hedhman.org>.
That second one is probably a consequence of the first problem, as the
client=null at passivation...

On Tue, Jun 9, 2015 at 7:55 PM, Niclas Hedhman <ni...@hedhman.org> wrote:

>
> Well, how can there be an existing Index the first time it is run?
> Remember, I am not using ES directly, only that the ES extension attaches
> itself to the EntityStateListener notification...
>
> Just now, I go another problem, so I suspect that I am missing some
> crucial setup/assembly part. Perhaps I just change to the RDF indexer
> instead...
>
>
> Caused by: java.lang.NullPointerException
>     at
> org.qi4j.index.elasticsearch.ElasticSearchIndexer$Mixin.notifyChanges(ElasticSearchIndexer.java:105)
>     at
> org.qi4j.spi.entitystore.StateChangeNotificationConcern$1.commit(StateChangeNotificationConcern.java:44)
>     at
> org.qi4j.spi.entitystore.ConcurrentModificationCheckConcern$ConcurrentCheckingEntityStoreUnitOfWork$1.commit(ConcurrentModificationCheckConcern.java:117)
>     at
> org.qi4j.api.configuration.Configuration$ConfigurationMixin.initializeConfigurationInstance(Configuration.java:281)
>
>
> On Tue, Jun 9, 2015 at 7:42 PM, Jiri Jetmar <ju...@gmail.com>
> wrote:
>
>> Just a guess - it looks like that you are trying to create a index with a
>> name that is already existing.
>>
>> Possible solutions are :
>>
>> - check if the index is already created
>> - delete the file-based storage (this approach is used in the unit tests)
>> - Use each time a new name
>>
>> What is the context of this "myapp" ?
>>
>> Cheers,
>> jj
>>
>> 2015-06-09 13:23 GMT+02:00 Niclas Hedhman <ni...@hedhman.org>:
>>
>> > Paul (since you wrote this once upon a time),
>> >
>> > I get an exception every time the Elastic Search Extension is loaded,
>> even
>> > if I wipe the $HOME/Library/Application Support/myapp where it seems
>> that
>> > ES extension is using (oh, yeah I am using the file system store)
>> >
>> > Any ideas? Is it expected?
>> >
>> >
>> > Caused by: org.elasticsearch.indices.IndexAlreadyExistsException:
>> > [qi4j_index] already exists
>> >     at
>> >
>> >
>> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validateIndexName(MetaDataCreateIndexService.java:164)
>> >     at
>> >
>> >
>> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validate(MetaDataCreateIndexService.java:539)
>> >     at
>> >
>> >
>> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.access$100(MetaDataCreateIndexService.java:89)
>> >     at
>> >
>> >
>> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$2.execute(MetaDataCreateIndexService.java:229)
>> >     at
>> >
>> >
>> org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:328)
>> >     at
>> >
>> >
>> org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:153)
>> >     at
>> >
>> >
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>> >     at
>> >
>> >
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>> >     ... 1 more
>> >
>> > Cheers
>> > --
>> > Niclas Hedhman, Software Developer
>> > http://zest.apache.org - New Energy for Java
>> >
>>
>
>
>
> --
> Niclas Hedhman, Software Developer
> http://zest.apache.org - New Energy for Java
>



-- 
Niclas Hedhman, Software Developer
http://zest.apache.org - New Energy for Java

Re: [Elastic Search] exception on startup

Posted by Jiri Jetmar <ju...@gmail.com>.
hmm, first time run ? Thats indeed strange..

ok, if you want I can take a look on the ES issue since I spend sometime on
this indexer..

cheers,
jj

2015-06-09 13:55 GMT+02:00 Niclas Hedhman <ni...@hedhman.org>:

> Well, how can there be an existing Index the first time it is run?
> Remember, I am not using ES directly, only that the ES extension attaches
> itself to the EntityStateListener notification...
>
> Just now, I go another problem, so I suspect that I am missing some crucial
> setup/assembly part. Perhaps I just change to the RDF indexer instead...
>
>
> Caused by: java.lang.NullPointerException
>     at
>
> org.qi4j.index.elasticsearch.ElasticSearchIndexer$Mixin.notifyChanges(ElasticSearchIndexer.java:105)
>     at
>
> org.qi4j.spi.entitystore.StateChangeNotificationConcern$1.commit(StateChangeNotificationConcern.java:44)
>     at
>
> org.qi4j.spi.entitystore.ConcurrentModificationCheckConcern$ConcurrentCheckingEntityStoreUnitOfWork$1.commit(ConcurrentModificationCheckConcern.java:117)
>     at
>
> org.qi4j.api.configuration.Configuration$ConfigurationMixin.initializeConfigurationInstance(Configuration.java:281)
>
>
> On Tue, Jun 9, 2015 at 7:42 PM, Jiri Jetmar <ju...@gmail.com>
> wrote:
>
> > Just a guess - it looks like that you are trying to create a index with a
> > name that is already existing.
> >
> > Possible solutions are :
> >
> > - check if the index is already created
> > - delete the file-based storage (this approach is used in the unit tests)
> > - Use each time a new name
> >
> > What is the context of this "myapp" ?
> >
> > Cheers,
> > jj
> >
> > 2015-06-09 13:23 GMT+02:00 Niclas Hedhman <ni...@hedhman.org>:
> >
> > > Paul (since you wrote this once upon a time),
> > >
> > > I get an exception every time the Elastic Search Extension is loaded,
> > even
> > > if I wipe the $HOME/Library/Application Support/myapp where it seems
> that
> > > ES extension is using (oh, yeah I am using the file system store)
> > >
> > > Any ideas? Is it expected?
> > >
> > >
> > > Caused by: org.elasticsearch.indices.IndexAlreadyExistsException:
> > > [qi4j_index] already exists
> > >     at
> > >
> > >
> >
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validateIndexName(MetaDataCreateIndexService.java:164)
> > >     at
> > >
> > >
> >
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validate(MetaDataCreateIndexService.java:539)
> > >     at
> > >
> > >
> >
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.access$100(MetaDataCreateIndexService.java:89)
> > >     at
> > >
> > >
> >
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$2.execute(MetaDataCreateIndexService.java:229)
> > >     at
> > >
> > >
> >
> org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:328)
> > >     at
> > >
> > >
> >
> org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:153)
> > >     at
> > >
> > >
> >
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> > >     at
> > >
> > >
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> > >     ... 1 more
> > >
> > > Cheers
> > > --
> > > Niclas Hedhman, Software Developer
> > > http://zest.apache.org - New Energy for Java
> > >
> >
>
>
>
> --
> Niclas Hedhman, Software Developer
> http://zest.apache.org - New Energy for Java
>

Re: [Elastic Search] exception on startup

Posted by Niclas Hedhman <ni...@hedhman.org>.
Well, how can there be an existing Index the first time it is run?
Remember, I am not using ES directly, only that the ES extension attaches
itself to the EntityStateListener notification...

Just now, I go another problem, so I suspect that I am missing some crucial
setup/assembly part. Perhaps I just change to the RDF indexer instead...


Caused by: java.lang.NullPointerException
    at
org.qi4j.index.elasticsearch.ElasticSearchIndexer$Mixin.notifyChanges(ElasticSearchIndexer.java:105)
    at
org.qi4j.spi.entitystore.StateChangeNotificationConcern$1.commit(StateChangeNotificationConcern.java:44)
    at
org.qi4j.spi.entitystore.ConcurrentModificationCheckConcern$ConcurrentCheckingEntityStoreUnitOfWork$1.commit(ConcurrentModificationCheckConcern.java:117)
    at
org.qi4j.api.configuration.Configuration$ConfigurationMixin.initializeConfigurationInstance(Configuration.java:281)


On Tue, Jun 9, 2015 at 7:42 PM, Jiri Jetmar <ju...@gmail.com>
wrote:

> Just a guess - it looks like that you are trying to create a index with a
> name that is already existing.
>
> Possible solutions are :
>
> - check if the index is already created
> - delete the file-based storage (this approach is used in the unit tests)
> - Use each time a new name
>
> What is the context of this "myapp" ?
>
> Cheers,
> jj
>
> 2015-06-09 13:23 GMT+02:00 Niclas Hedhman <ni...@hedhman.org>:
>
> > Paul (since you wrote this once upon a time),
> >
> > I get an exception every time the Elastic Search Extension is loaded,
> even
> > if I wipe the $HOME/Library/Application Support/myapp where it seems that
> > ES extension is using (oh, yeah I am using the file system store)
> >
> > Any ideas? Is it expected?
> >
> >
> > Caused by: org.elasticsearch.indices.IndexAlreadyExistsException:
> > [qi4j_index] already exists
> >     at
> >
> >
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validateIndexName(MetaDataCreateIndexService.java:164)
> >     at
> >
> >
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validate(MetaDataCreateIndexService.java:539)
> >     at
> >
> >
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.access$100(MetaDataCreateIndexService.java:89)
> >     at
> >
> >
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$2.execute(MetaDataCreateIndexService.java:229)
> >     at
> >
> >
> org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:328)
> >     at
> >
> >
> org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:153)
> >     at
> >
> >
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> >     at
> >
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> >     ... 1 more
> >
> > Cheers
> > --
> > Niclas Hedhman, Software Developer
> > http://zest.apache.org - New Energy for Java
> >
>



-- 
Niclas Hedhman, Software Developer
http://zest.apache.org - New Energy for Java

Re: [Elastic Search] exception on startup

Posted by Jiri Jetmar <ju...@gmail.com>.
Just a guess - it looks like that you are trying to create a index with a
name that is already existing.

Possible solutions are :

- check if the index is already created
- delete the file-based storage (this approach is used in the unit tests)
- Use each time a new name

What is the context of this "myapp" ?

Cheers,
jj

2015-06-09 13:23 GMT+02:00 Niclas Hedhman <ni...@hedhman.org>:

> Paul (since you wrote this once upon a time),
>
> I get an exception every time the Elastic Search Extension is loaded, even
> if I wipe the $HOME/Library/Application Support/myapp where it seems that
> ES extension is using (oh, yeah I am using the file system store)
>
> Any ideas? Is it expected?
>
>
> Caused by: org.elasticsearch.indices.IndexAlreadyExistsException:
> [qi4j_index] already exists
>     at
>
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validateIndexName(MetaDataCreateIndexService.java:164)
>     at
>
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validate(MetaDataCreateIndexService.java:539)
>     at
>
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.access$100(MetaDataCreateIndexService.java:89)
>     at
>
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$2.execute(MetaDataCreateIndexService.java:229)
>     at
>
> org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:328)
>     at
>
> org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:153)
>     at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>     at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>     ... 1 more
>
> Cheers
> --
> Niclas Hedhman, Software Developer
> http://zest.apache.org - New Energy for Java
>

Re: [Elastic Search] exception on startup

Posted by Niclas Hedhman <ni...@hedhman.org>.
https://issues.apache.org/jira/browse/ZEST-31

On Tue, Jun 16, 2015 at 11:18 AM, Niclas Hedhman <ni...@hedhman.org> wrote:

> Additionally; I think there is a problem in the ElasticSearch Query
> system, when it comes to handling Associations. I haven't investigated yet,
> but it tried to dereference the EntityReference of an Association, which of
> course causes an EntityTypeNotFoundException, since originating Module is
> down in the Infra Layer.
>
> I changed to the RDF Indexer, and problem went away, as I don't have time
> to look at this right now.
>
>
> Cheers
> Niclas
>
> On Tue, Jun 16, 2015 at 9:15 AM, Niclas Hedhman <ni...@hedhman.org>
> wrote:
>
>>
>> Bringing this up again, since it seems to be an issue in the Elastic
>> Search extension...
>>
>> I have found the answer to the problem as well, explained on
>> http://elasticsearch-users.115913.n3.nabble.com/Testing-the-index-existence-td4019208.html
>>
>> i.e. The "exists" API isn't ready by the time the check is being made. A
>> couple of the answers recommend "try/catch on index creation" instead.
>>
>> Anyone has any opinion of whether that is a good or bad idea?
>>
>> Cheers
>> Niclas
>>
>> On Tue, Jun 9, 2015 at 7:23 PM, Niclas Hedhman <ni...@hedhman.org>
>> wrote:
>>
>>>
>>> Paul (since you wrote this once upon a time),
>>>
>>> I get an exception every time the Elastic Search Extension is loaded,
>>> even if I wipe the $HOME/Library/Application Support/myapp where it seems
>>> that ES extension is using (oh, yeah I am using the file system store)
>>>
>>> Any ideas? Is it expected?
>>>
>>>
>>> Caused by: org.elasticsearch.indices.IndexAlreadyExistsException:
>>> [qi4j_index] already exists
>>>     at
>>> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validateIndexName(MetaDataCreateIndexService.java:164)
>>>     at
>>> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validate(MetaDataCreateIndexService.java:539)
>>>     at
>>> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.access$100(MetaDataCreateIndexService.java:89)
>>>     at
>>> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$2.execute(MetaDataCreateIndexService.java:229)
>>>     at
>>> org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:328)
>>>     at
>>> org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:153)
>>>     at
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>>>     at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>>>     ... 1 more
>>>
>>> Cheers
>>> --
>>> Niclas Hedhman, Software Developer
>>> http://zest.apache.org - New Energy for Java
>>>
>>
>>
>>
>> --
>> Niclas Hedhman, Software Developer
>> http://zest.apache.org - New Energy for Java
>>
>
>
>
> --
> Niclas Hedhman, Software Developer
> http://zest.apache.org - New Energy for Java
>



-- 
Niclas Hedhman, Software Developer
http://zest.apache.org - New Energy for Java

Re: [Elastic Search] exception on startup

Posted by Niclas Hedhman <ni...@hedhman.org>.
Additionally; I think there is a problem in the ElasticSearch Query system,
when it comes to handling Associations. I haven't investigated yet, but it
tried to dereference the EntityReference of an Association, which of course
causes an EntityTypeNotFoundException, since originating Module is down in
the Infra Layer.

I changed to the RDF Indexer, and problem went away, as I don't have time
to look at this right now.


Cheers
Niclas

On Tue, Jun 16, 2015 at 9:15 AM, Niclas Hedhman <ni...@hedhman.org> wrote:

>
> Bringing this up again, since it seems to be an issue in the Elastic
> Search extension...
>
> I have found the answer to the problem as well, explained on
> http://elasticsearch-users.115913.n3.nabble.com/Testing-the-index-existence-td4019208.html
>
> i.e. The "exists" API isn't ready by the time the check is being made. A
> couple of the answers recommend "try/catch on index creation" instead.
>
> Anyone has any opinion of whether that is a good or bad idea?
>
> Cheers
> Niclas
>
> On Tue, Jun 9, 2015 at 7:23 PM, Niclas Hedhman <ni...@hedhman.org> wrote:
>
>>
>> Paul (since you wrote this once upon a time),
>>
>> I get an exception every time the Elastic Search Extension is loaded,
>> even if I wipe the $HOME/Library/Application Support/myapp where it seems
>> that ES extension is using (oh, yeah I am using the file system store)
>>
>> Any ideas? Is it expected?
>>
>>
>> Caused by: org.elasticsearch.indices.IndexAlreadyExistsException:
>> [qi4j_index] already exists
>>     at
>> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validateIndexName(MetaDataCreateIndexService.java:164)
>>     at
>> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validate(MetaDataCreateIndexService.java:539)
>>     at
>> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.access$100(MetaDataCreateIndexService.java:89)
>>     at
>> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$2.execute(MetaDataCreateIndexService.java:229)
>>     at
>> org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:328)
>>     at
>> org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:153)
>>     at
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>>     at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>>     ... 1 more
>>
>> Cheers
>> --
>> Niclas Hedhman, Software Developer
>> http://zest.apache.org - New Energy for Java
>>
>
>
>
> --
> Niclas Hedhman, Software Developer
> http://zest.apache.org - New Energy for Java
>



-- 
Niclas Hedhman, Software Developer
http://zest.apache.org - New Energy for Java

Re: [Elastic Search] exception on startup

Posted by Paul Merlin <pa...@nosphere.org>.
Niclas Hedhman a écrit :
> Bringing this up again, since it seems to be an issue in the Elastic Search
> extension...
>
> I have found the answer to the problem as well, explained on
> http://elasticsearch-users.115913.n3.nabble.com/Testing-the-index-existence-td4019208.html
>
> i.e. The "exists" API isn't ready by the time the check is being made. A
> couple of the answers recommend "try/catch on index creation" instead.
>
> Anyone has any opinion of whether that is a good or bad idea?
I think we should instead wait for ElasticSearch "yellow" status on
activation, that is "the primary shard is allocated but replicas may not
be yet". At this stage the index exists query should answer correctly.

I just pushed a commit to develop for this. Tell me if it solved this issue.

Cheers

/Paul


Re: [Elastic Search] exception on startup

Posted by Niclas Hedhman <ni...@hedhman.org>.
Bringing this up again, since it seems to be an issue in the Elastic Search
extension...

I have found the answer to the problem as well, explained on
http://elasticsearch-users.115913.n3.nabble.com/Testing-the-index-existence-td4019208.html

i.e. The "exists" API isn't ready by the time the check is being made. A
couple of the answers recommend "try/catch on index creation" instead.

Anyone has any opinion of whether that is a good or bad idea?

Cheers
Niclas

On Tue, Jun 9, 2015 at 7:23 PM, Niclas Hedhman <ni...@hedhman.org> wrote:

>
> Paul (since you wrote this once upon a time),
>
> I get an exception every time the Elastic Search Extension is loaded, even
> if I wipe the $HOME/Library/Application Support/myapp where it seems that
> ES extension is using (oh, yeah I am using the file system store)
>
> Any ideas? Is it expected?
>
>
> Caused by: org.elasticsearch.indices.IndexAlreadyExistsException:
> [qi4j_index] already exists
>     at
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validateIndexName(MetaDataCreateIndexService.java:164)
>     at
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validate(MetaDataCreateIndexService.java:539)
>     at
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.access$100(MetaDataCreateIndexService.java:89)
>     at
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$2.execute(MetaDataCreateIndexService.java:229)
>     at
> org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:328)
>     at
> org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:153)
>     at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>     ... 1 more
>
> Cheers
> --
> Niclas Hedhman, Software Developer
> http://zest.apache.org - New Energy for Java
>



-- 
Niclas Hedhman, Software Developer
http://zest.apache.org - New Energy for Java