{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/16032","labels_url":"https://api.github.com/repos/elastic/elasticsearch/issues/16032/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/16032/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/16032/events","html_url":"https://github.com/elastic/elasticsearch/issues/16032","id":126994366,"number":16032,"title":"Setting invalid codec causes shard to keep failing and stuck in initializing state","user":{"login":"ppf2","id":7216393,"avatar_url":"https://avatars.githubusercontent.com/u/7216393?v=3","gravatar_id":"","url":"https://api.github.com/users/ppf2","html_url":"https://github.com/ppf2","followers_url":"https://api.github.com/users/ppf2/followers","following_url":"https://api.github.com/users/ppf2/following{/other_user}","gists_url":"https://api.github.com/users/ppf2/gists{/gist_id}","starred_url":"https://api.github.com/users/ppf2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppf2/subscriptions","organizations_url":"https://api.github.com/users/ppf2/orgs","repos_url":"https://api.github.com/users/ppf2/repos","events_url":"https://api.github.com/users/ppf2/events{/privacy}","received_events_url":"https://api.github.com/users/ppf2/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/bug","name":"bug","color":"9e2c2c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-16T02:18:43Z","updated_at":"2016-01-18T13:01:18Z","closed_at":"2016-01-18T13:01:18Z","body":"On ES 2.1.1.  Ran into this when trying to verify if a setting has persisted.  In this case, I am purposely setting the codec to an invalid codec name `best_compression1` instead of `best_compression`:\r\n\r\n```\r\nPOST /largeevent/_close\r\nPUT /largeevent/_settings\r\n{\r\n  \"index.codec\":\"best_compression1\"\r\n}\r\nPOST /largeevent/_open\r\nGET /largeevent/_settings\r\n```\r\n\r\nAs soon as, I reopen the index after making the setting change, the shard gets into a failure loop trying to initialize the shard and will not start up.\r\n\r\n```\r\n[2016-01-15 18:12:18,597][WARN ][cluster.action.shard     ] [node-1] [largeevent][1] received shard failed for [largeevent][1], node[O373snrkTTGclRFL0t7H5g], [P], v[1553], s[INITIALIZING], a[id=w3VoZACfQKq_QcsDGLaZ3Q], unassigned_info[[reason=ALLOCATION_FAILED], at[2016-01-16T02:12:18.563Z], details[failed recovery, failure IndexShardRecoveryException[failed recovery]; nested: IllegalArgumentException[failed to find codec [best_compression1]]; ]], indexUUID [JEPoX4QkR_Om-W69VKV6iQ], message [failed recovery], failure [IndexShardRecoveryException[failed recovery]; nested: IllegalArgumentException[failed to find codec [best_compression1]]; ]\r\n[largeevent][[largeevent][1]] IndexShardRecoveryException[failed recovery]; nested: IllegalArgumentException[failed to find codec [best_compression1]];\r\n\tat org.elasticsearch.index.shard.StoreRecoveryService$1.run(StoreRecoveryService.java:179)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\nCaused by: java.lang.IllegalArgumentException: failed to find codec [best_compression1]\r\n\tat org.elasticsearch.index.codec.CodecService.codec(CodecService.java:94)\r\n\tat org.elasticsearch.index.engine.EngineConfig.getCodec(EngineConfig.java:255)\r\n\tat org.elasticsearch.index.engine.InternalEngine.createWriter(InternalEngine.java:1057)\r\n\tat org.elasticsearch.index.engine.InternalEngine.<init>(InternalEngine.java:150)\r\n\tat org.elasticsearch.index.engine.InternalEngineFactory.newReadWriteEngine(InternalEngineFactory.java:25)\r\n\tat org.elasticsearch.index.shard.IndexShard.newEngine(IndexShard.java:1408)\r\n\tat org.elasticsearch.index.shard.IndexShard.createNewEngine(IndexShard.java:1403)\r\n\tat org.elasticsearch.index.shard.IndexShard.internalPerformTranslogRecovery(IndexShard.java:906)\r\n\tat org.elasticsearch.index.shard.IndexShard.performTranslogRecovery(IndexShard.java:883)\r\n\tat org.elasticsearch.index.shard.StoreRecoveryService.recoverFromStore(StoreRecoveryService.java:245)\r\n\tat org.elasticsearch.index.shard.StoreRecoveryService.access$100(StoreRecoveryService.java:56)\r\n\tat org.elasticsearch.index.shard.StoreRecoveryService$1.run(StoreRecoveryService.java:129)\r\n\t... 3 more\r\n```\r\n\r\nWill be nice if we can handle this better."},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments/172521693","html_url":"https://github.com/elastic/elasticsearch/issues/16032#issuecomment-172521693","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/16032","id":172521693,"user":{"login":"clintongormley","id":56599,"avatar_url":"https://avatars.githubusercontent.com/u/56599?v=3","gravatar_id":"","url":"https://api.github.com/users/clintongormley","html_url":"https://github.com/clintongormley","followers_url":"https://api.github.com/users/clintongormley/followers","following_url":"https://api.github.com/users/clintongormley/following{/other_user}","gists_url":"https://api.github.com/users/clintongormley/gists{/gist_id}","starred_url":"https://api.github.com/users/clintongormley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clintongormley/subscriptions","organizations_url":"https://api.github.com/users/clintongormley/orgs","repos_url":"https://api.github.com/users/clintongormley/repos","events_url":"https://api.github.com/users/clintongormley/events{/privacy}","received_events_url":"https://api.github.com/users/clintongormley/received_events","type":"User","site_admin":false},"created_at":"2016-01-18T13:01:17Z","updated_at":"2016-01-18T13:01:17Z","body":"With the changes coming in #16054 you will be able to close the index, update the settings, and reopen the index.  The continuous failures can only be prevented once we remove Guice. "}}