Index document with "security" field fails

This works:

$ curl -XPUT 'http://localhost:9200/test/item/1' -d '{
"title" : "item 1",
"securityinfo" : [
{"group" : "1","accesstype" : "1","accesslevel" : "0","gat" : "11"},
{"group" : "2","accesstype" : "1","accesslevel" : "100","gat" : "21"}
]
}'

*No change the fieldname "securityinfo" into "security". *

$ curl -XPUT 'http://localhost:9200/test/item/1' -d '{
"title" : "item 1",
"security" : [
{"group" : "1","accesstype" : "1","accesslevel" : "0","gat" : "11"},
{"group" : "2","accesstype" : "1","accesslevel" : "100","gat" : "21"}
]
}'

This fails with the following error:
{
error: "MapperParsingException[failed to parse [security]]; nested:
ElasticSearchIllegalArgumentException[unknown property [group]]; "
status: 400
}

Obscure isn't it? :slight_smile:

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hey,

I have no problems doing your two curl calls with elasticsearch 0.90.RC2 on
an empty index. What elasticsearch version are you using? Is there anything
in the logfiles you could give us as well?
Do you have a preconfigured mapping, which prevents you from doing the
above insert? Can you show us your mapping?

--Alex

On Thu, Apr 18, 2013 at 8:52 AM, Erwin Rijss erijss@gmail.com wrote:

This works:

$ curl -XPUT 'http://localhost:9200/test/item/1' -d '{
"title" : "item 1",
"securityinfo" : [
{"group" : "1","accesstype" : "1","accesslevel" : "0","gat" : "11"},
{"group" : "2","accesstype" : "1","accesslevel" : "100","gat" : "21"}
]
}'

*No change the fieldname "securityinfo" into "security". *

$ curl -XPUT 'http://localhost:9200/test/item/1' -d '{
"title" : "item 1",
"security" : [
{"group" : "1","accesstype" : "1","accesslevel" : "0","gat" : "11"},
{"group" : "2","accesstype" : "1","accesslevel" : "100","gat" : "21"}
]
}'

This fails with the following error:
{
error: "MapperParsingException[failed to parse [security]]; nested:
ElasticSearchIllegalArgumentException[unknown property [group]]; "
status: 400
}

Obscure isn't it? :slight_smile:

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi,

Did the same you did. Empty index, ES0.90RC2. There was no preconfigured
mapping.

However,I tried again and guess what: works fine! boink boink.

I tried it yesterday and this morning. With several document layouts and
deleting and creating the index each time,and finally it seems to be caused
by the fieldname "security". Below you'll see the logentry about the
failure.

Well... case closed, i guess. Thnx!

This is what the logfiles say:

[2013-04-18 08:48:32,716][DEBUG][action.index ] [SMARTSITECMS]
[test][2], node[Asz4W-FERViuKINUywBYVg], [P], s[STARTED]: Failed to execute
[index {[test][item][1], source[{
"title" : "item 1",
"security" : [
{"group" : "1","accesstype" : "1","accesslevel" : "0","gat" : "11"},
{"group" : "2","accesstype" : "1","accesslevel" : "100","gat" : "21"}
]
}]}]
org.elasticsearch.index.mapper.MapperParsingException: failed to parse
[security]
at
org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:395)
at
org.elasticsearch.index.mapper.object.ObjectMapper.serializeObject(ObjectMapper.java:515)
at
org.elasticsearch.index.mapper.object.ObjectMapper.serializeArray(ObjectMapper.java:577)
at
org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:459)
at
org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:506)
at
org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:450)
at
org.elasticsearch.index.shard.service.InternalIndexShard.prepareIndex(InternalIndexShard.java:326)
at
org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:203)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:532)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction$1.run(TransportShardReplicationOperationAction.java:430)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.elasticsearch.ElasticSearchIllegalArgumentException: unknown
property [group]
at
org.elasticsearch.index.mapper.core.StringFieldMapper.parseCreateField(StringFieldMapper.java:281)
at
org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:384)
... 12 more

On Thursday, April 18, 2013 10:20:19 AM UTC+2, Alexander Reelsen wrote:

Hey,

I have no problems doing your two curl calls with elasticsearch 0.90.RC2
on an empty index. What elasticsearch version are you using? Is there
anything in the logfiles you could give us as well?
Do you have a preconfigured mapping, which prevents you from doing the
above insert? Can you show us your mapping?

--Alex

On Thu, Apr 18, 2013 at 8:52 AM, Erwin Rijss <eri...@gmail.com<javascript:>

wrote:

This works:

$ curl -XPUT 'http://localhost:9200/test/item/1' -d '{
"title" : "item 1",
"securityinfo" : [
{"group" : "1","accesstype" : "1","accesslevel" : "0","gat" : "11"},
{"group" : "2","accesstype" : "1","accesslevel" : "100","gat" : "21"}
]
}'

*No change the fieldname "securityinfo" into "security". *

$ curl -XPUT 'http://localhost:9200/test/item/1' -d '{
"title" : "item 1",
"security" : [
{"group" : "1","accesstype" : "1","accesslevel" : "0","gat" : "11"},
{"group" : "2","accesstype" : "1","accesslevel" : "100","gat" : "21"}
]
}'

This fails with the following error:
{
error: "MapperParsingException[failed to parse [security]]; nested:
ElasticSearchIllegalArgumentException[unknown property [group]]; "
status: 400
}

Obscure isn't it? :slight_smile:

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Just in case you will stumble upon this again or somebody will find this
thread - this error typically indicates that you are trying to index an
object into a field that is already mapped as a non-object field (string,
for example). It's very easy to reproduce this error by running the
following two commands on a newly created index:

$ curl -XPUT 'http://localhost:9200/test/item/1' -d '{"securityinfo": "foo
bar"}'

$ curl -XPUT 'http://localhost:9200/test/item/1' -d '{
"security" : [
{"group" : "1","accesstype" : "1","accesslevel" : "0","gat" : "11"},
{"group" : "2","accesstype" : "1","accesslevel" : "100","gat" : "21"}
]
}'

The first command will cause the field "security" to be mapped as a string,
and the second command will cause the error that you encountered.

On Thursday, April 18, 2013 5:55:12 AM UTC-4, Erwin Rijss wrote:

Hi,

Did the same you did. Empty index, ES0.90RC2. There was no preconfigured
mapping.

However,I tried again and guess what: works fine! boink boink.

I tried it yesterday and this morning. With several document layouts and
deleting and creating the index each time,and finally it seems to be caused
by the fieldname "security". Below you'll see the logentry about the
failure.

Well... case closed, i guess. Thnx!

This is what the logfiles say:

[2013-04-18 08:48:32,716][DEBUG][action.index ] [SMARTSITECMS]
[test][2], node[Asz4W-FERViuKINUywBYVg], [P], s[STARTED]: Failed to execute
[index {[test][item][1], source[{
"title" : "item 1",
"security" : [
{"group" : "1","accesstype" : "1","accesslevel" : "0","gat" : "11"},
{"group" : "2","accesstype" : "1","accesslevel" : "100","gat" : "21"}
]
}]}]
org.elasticsearch.index.mapper.MapperParsingException: failed to parse
[security]
at
org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:395)
at
org.elasticsearch.index.mapper.object.ObjectMapper.serializeObject(ObjectMapper.java:515)
at
org.elasticsearch.index.mapper.object.ObjectMapper.serializeArray(ObjectMapper.java:577)
at
org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:459)
at
org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:506)
at
org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:450)
at
org.elasticsearch.index.shard.service.InternalIndexShard.prepareIndex(InternalIndexShard.java:326)
at
org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:203)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:532)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction$1.run(TransportShardReplicationOperationAction.java:430)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.elasticsearch.ElasticSearchIllegalArgumentException:
unknown property [group]
at
org.elasticsearch.index.mapper.core.StringFieldMapper.parseCreateField(StringFieldMapper.java:281)
at
org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:384)
... 12 more

On Thursday, April 18, 2013 10:20:19 AM UTC+2, Alexander Reelsen wrote:

Hey,

I have no problems doing your two curl calls with elasticsearch 0.90.RC2
on an empty index. What elasticsearch version are you using? Is there
anything in the logfiles you could give us as well?
Do you have a preconfigured mapping, which prevents you from doing the
above insert? Can you show us your mapping?

--Alex

On Thu, Apr 18, 2013 at 8:52 AM, Erwin Rijss eri...@gmail.com wrote:

This works:

$ curl -XPUT 'http://localhost:9200/test/item/1' -d '{
"title" : "item 1",
"securityinfo" : [
{"group" : "1","accesstype" : "1","accesslevel" : "0","gat" : "11"},
{"group" : "2","accesstype" : "1","accesslevel" : "100","gat" : "21"}
]
}'

*No change the fieldname "securityinfo" into "security". *

$ curl -XPUT 'http://localhost:9200/test/item/1' -d '{
"title" : "item 1",
"security" : [
{"group" : "1","accesstype" : "1","accesslevel" : "0","gat" : "11"},
{"group" : "2","accesstype" : "1","accesslevel" : "100","gat" : "21"}
]
}'

This fails with the following error:
{
error: "MapperParsingException[failed to parse [security]]; nested:
ElasticSearchIllegalArgumentException[unknown property [group]]; "
status: 400
}

Obscure isn't it? :slight_smile:

--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Just a note to Igor's example. To reproduce the error, run:

curl -XDELETE localhost:9200/test

curl -XPUT 'http://localhost:9200/test/item/1' -d '{"security": "foo bar"}'

curl -XPUT 'http://localhost:9200/test/item/1' -d '{
"security" : [
{"group" : "1","accesstype" : "1","accesslevel" : "0","gat" : "11"},
{"group" : "2","accesstype" : "1","accesslevel" : "100","gat" : "21"}
]
}'

Note the security field instead of securityinfo.

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 18 avr. 2013 à 23:44, Igor Motov imotov@gmail.com a écrit :

Just in case you will stumble upon this again or somebody will find this thread - this error typically indicates that you are trying to index an object into a field that is already mapped as a non-object field (string, for example). It's very easy to reproduce this error by running the following two commands on a newly created index:

$ curl -XPUT 'http://localhost:9200/test/item/1' -d '{"securityinfo": "foo bar"}'

$ curl -XPUT 'http://localhost:9200/test/item/1' -d '{
"security" : [
{"group" : "1","accesstype" : "1","accesslevel" : "0","gat" : "11"},
{"group" : "2","accesstype" : "1","accesslevel" : "100","gat" : "21"}
]
}'

The first command will cause the field "security" to be mapped as a string, and the second command will cause the error that you encountered.

On Thursday, April 18, 2013 5:55:12 AM UTC-4, Erwin Rijss wrote:
Hi,

Did the same you did. Empty index, ES0.90RC2. There was no preconfigured mapping.

However,I tried again and guess what: works fine! boink boink.

I tried it yesterday and this morning. With several document layouts and deleting and creating the index each time,and finally it seems to be caused by the fieldname "security". Below you'll see the logentry about the failure.

Well... case closed, i guess. Thnx!

This is what the logfiles say:

[2013-04-18 08:48:32,716][DEBUG][action.index ] [SMARTSITECMS] [test][2], node[Asz4W-FERViuKINUywBYVg], [P], s[STARTED]: Failed to execute [index {[test][item][1], source[{
"title" : "item 1",
"security" : [
{"group" : "1","accesstype" : "1","accesslevel" : "0","gat" : "11"},
{"group" : "2","accesstype" : "1","accesslevel" : "100","gat" : "21"}
]
}]}]
org.elasticsearch.index.mapper.MapperParsingException: failed to parse [security]
at org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:395)
at org.elasticsearch.index.mapper.object.ObjectMapper.serializeObject(ObjectMapper.java:515)
at org.elasticsearch.index.mapper.object.ObjectMapper.serializeArray(ObjectMapper.java:577)
at org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:459)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:506)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:450)
at org.elasticsearch.index.shard.service.InternalIndexShard.prepareIndex(InternalIndexShard.java:326)
at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:203)
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:532)
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction$1.run(TransportShardReplicationOperationAction.java:430)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.elasticsearch.ElasticSearchIllegalArgumentException: unknown property [group]
at org.elasticsearch.index.mapper.core.StringFieldMapper.parseCreateField(StringFieldMapper.java:281)
at org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:384)
... 12 more

On Thursday, April 18, 2013 10:20:19 AM UTC+2, Alexander Reelsen wrote:
Hey,

I have no problems doing your two curl calls with elasticsearch 0.90.RC2 on an empty index. What elasticsearch version are you using? Is there anything in the logfiles you could give us as well?
Do you have a preconfigured mapping, which prevents you from doing the above insert? Can you show us your mapping?

--Alex

On Thu, Apr 18, 2013 at 8:52 AM, Erwin Rijss eri...@gmail.com wrote:
This works:

$ curl -XPUT 'http://localhost:9200/test/item/1' -d '{
"title" : "item 1",
"securityinfo" : [
{"group" : "1","accesstype" : "1","accesslevel" : "0","gat" : "11"},
{"group" : "2","accesstype" : "1","accesslevel" : "100","gat" : "21"}
]
}'

No change the fieldname "securityinfo" into "security".

$ curl -XPUT 'http://localhost:9200/test/item/1' -d '{
"title" : "item 1",
"security" : [
{"group" : "1","accesstype" : "1","accesslevel" : "0","gat" : "11"},
{"group" : "2","accesstype" : "1","accesslevel" : "100","gat" : "21"}
]
}'

This fails with the following error:
{
error: "MapperParsingException[failed to parse [security]]; nested: ElasticSearchIllegalArgumentException[unknown property [group]]; "
status: 400
}

Obscure isn't it? :slight_smile:

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.