bitshares / bitshares-core

BitShares Blockchain node and command-line wallet
https://bitshares.github.io/
Other
1.17k stars 643 forks source link

ES error: Limit of mapping depth [20] has been exceeded #2577

Closed abitmore closed 2 years ago

abitmore commented 2 years ago

Bug Description

The develop branch is unable to sync if ElasticSearch plugin is enabled. Error message:

{"index":{"_index":"btsdev-mainnet-his-2016-05","_type":"_doc","_id":"2.9.3018878","status":400,"error":{"type":"illegal_argument_exception","reason":"Limit of mapping depth [20] has been exceeded due to object field [operation_history.op_object.proposed_ops_object.op_object.data_object.proposed_ops_object.op_object.data_object.proposed_ops_object.op_object.data_object.proposed_ops_object.op_object.data_object.proposed_ops_object.op_object.data_object.proposed_ops_object.op_object.data_object]"}}}

The operation was in block number 6394824:

[22,{"fee":{"amount":2315394,"asset_id":"1.3.0"},"fee_paying_account":"1.2.121","expiration_time":"2016-06-20T00:00:00","proposed_ops":[{"op":[22,{"fee":{"amount":2299628,"asset_id":"1.3.0"},"fee_paying_account":"1.2.121","expiration_time":"2016-06-22T00:00:00","proposed_ops":[{"op":[22,{"fee":{"amount":2283863,"asset_id":"1.3.0"},"fee_paying_account":"1.2.121","expiration_time":"2016-06-23T00:00:00","proposed_ops":[{"op":[22,{"fee":{"amount":2268097,"asset_id":"1.3.0"},"fee_paying_account":"1.2.121","expiration_time":"2016-06-24T00:00:00","proposed_ops":[{"op":[22,{"fee":{"amount":2252331,"asset_id":"1.3.0"},"fee_paying_account":"1.2.121","expiration_time":"2015-06-24T00:00:00","proposed_ops":[{"op":[22,{"fee":{"amount":2236566,"asset_id":"1.3.0"},"fee_paying_account":"1.2.121","expiration_time":"2015-06-24T00:00:00","proposed_ops":[{"op":[12,{"fee":{"amount":100000000,"asset_id":"1.3.0"},"issuer":"1.2.0","asset_to_update":"1.3.113","new_options":{"feed_lifetime_sec":86400,"minimum_feeds":7,"force_settlement_delay_sec":86400,"force_settlement_offset_percent":100,"maximum_force_settlement_volume":50,"short_backing_asset":"1.3.0","extensions":{}},"extensions":[]}]}],"review_period_seconds":3600,"extensions":[]}]}],"review_period_seconds":3600,"extensions":[]}]}],"review_period_seconds":3600,"extensions":[]}]}],"review_period_seconds":3600,"extensions":[]}]}],"review_period_seconds":3600,"extensions":[]}]}],"review_period_seconds":3600,"extensions":[]}]

I believe it was introduced in https://github.com/bitshares/bitshares-core/pull/2565.

According to ES docs(https://www.elastic.co/guide/en/elasticsearch/reference/7.16/mapping-settings-limit.html), the setting can be updated if really required,

index.mapping.depth.limit - The maximum depth for a field, which is measured as the number of inner objects. For instance, if all fields are defined at the root object level, then the depth is 1. If there is one object mapping, then the depth is 2, etc. The default is 20.

Impacts Describe which portion(s) of BitShares Core may be impacted by this bug. Please tick at least one box.

CORE TEAM TASK LIST

abitmore commented 2 years ago

Fixed by #2609.