Buggy code:
public class TransportNodesListShardStoreMetaData extends TransportNodesOperationAction < TransportNodesListShardStoreMetaData . Request , TransportNodesListShardStoreMetaData . NodesStoreFilesMetaData , TransportNodesListShardStoreMetaData . NodeRequest , TransportNodesListShardStoreMetaData . NodeStoreFilesMetaData > { public static final String ACTION_NAME = "internal:cluster//nodes//indices//shard//store" ; private final IndicesService indicesService ; private final NodeEnvironment nodeEnv ; @ Inject public TransportNodesListShardStoreMetaData ( Settings settings , ClusterName clusterName , ThreadPool threadPool , ClusterService clusterService , TransportService transportService , IndicesService indicesService , NodeEnvironment nodeEnv , ActionFilters actionFilters ) { } public ActionFuture < TransportNodesListShardStoreMetaData . NodesStoreFilesMetaData > list ( ShardId shardId , boolean onlyUnallocated , String [ ] nodesIds , @ Nullable TimeValue timeout ) { } @ Override protected String executor ( ) { } @ Override protected TransportNodesListShardStoreMetaData . Request newRequest ( ) { } @ Override protected TransportNodesListShardStoreMetaData . NodeRequest newNodeRequest ( ) { } @ Override protected TransportNodesListShardStoreMetaData . NodeRequest newNodeRequest ( String nodeId , TransportNodesListShardStoreMetaData . Request request ) { } @ Override protected TransportNodesListShardStoreMetaData . NodeStoreFilesMetaData newNodeResponse ( ) { } @ Override protected TransportNodesListShardStoreMetaData . NodesStoreFilesMetaData newResponse ( TransportNodesListShardStoreMetaData . Request request , AtomicReferenceArray responses ) { } @ Override protected TransportNodesListShardStoreMetaData . NodeStoreFilesMetaData nodeOperation ( TransportNodesListShardStoreMetaData . NodeRequest request ) throws ElasticsearchException { } private TransportNodesListShardStoreMetaData . StoreFilesMetaData listStoreMetaData ( ShardId shardId ) throws IOException { IndexService indexService = indicesService . indexService ( shardId . index ( ) . name ( ) ) ; if ( indexService != null ) { IndexShard indexShard = indexService . shard ( shardId . id ( ) ) ; if ( indexShard != null ) { final Store store = indexShard . store ( ) ; store . incRef ( ) ; try { return new TransportNodesListShardStoreMetaData . StoreFilesMetaData ( true , shardId , store . getMetadataOrEmpty ( ) . asMap ( ) ) ; } finally { store . decRef ( ) ; } } } IndexMetaData metaData = clusterService . state ( ) . metaData ( ) . index ( shardId . index ( ) . name ( ) ) ; if ( metaData == null ) { return new TransportNodesListShardStoreMetaData . StoreFilesMetaData ( false , shardId , ImmutableMap . < String , StoreFileMetaData > of ( ) ) ; } String storeType = metaData . settings ( ) . get ( "index.store.type" , "fs" ) ; if ( ! ( storeType . contains ( "fs" ) ) ) { return new TransportNodesListShardStoreMetaData . StoreFilesMetaData ( false , shardId , ImmutableMap . < String , StoreFileMetaData > of ( ) ) ; } <START_BUG> Path [ ] shardLocations = nodeEnv . shardPaths ( shardId ) ; <END_BUG> Path [ ] shardIndexLocations = new Path [ shardLocations . length ] ; for ( int i = 0 ; i < ( shardLocations . length ) ; i ++ ) { shardIndexLocations [ i ] = shardLocations [ i ] . resolve ( "index" ) ; } final boolean exists = FileSystemUtils . exists ( shardIndexLocations ) ; if ( ! exists ) { return new TransportNodesListShardStoreMetaData . StoreFilesMetaData ( false , shardId , ImmutableMap . < String , StoreFileMetaData > of ( ) ) ; } return new TransportNodesListShardStoreMetaData . StoreFilesMetaData ( false , shardId , Store . readMetadataSnapshot ( shardIndexLocations , logger ) . asMap ( ) ) ; } @ Override protected boolean accumulateExceptions ( ) { } public static class StoreFilesMetaData implements Iterable < StoreFileMetaData > , Streamable { private boolean allocated ; private ShardId shardId ; private Map < String , StoreFileMetaData > files ; StoreFilesMetaData ( ) { } public StoreFilesMetaData ( boolean allocated , ShardId shardId , Map < String , StoreFileMetaData > files ) { } public boolean allocated ( ) { } public ShardId shardId ( ) { } public long totalSizeInBytes ( ) { } @ Override public Iterator < StoreFileMetaData > iterator ( ) { } public boolean fileExists ( String name ) { } public StoreFileMetaData file ( String name ) { } public static TransportNodesListShardStoreMetaData . StoreFilesMetaData readStoreFilesMetaData ( StreamInput in ) throws IOException { } @ Override public void readFrom ( StreamInput in ) throws IOException { } @ Override public void writeTo ( StreamOutput out ) throws IOException { } } static class Request extends NodesOperationRequest < TransportNodesListShardStoreMetaData . Request > { private ShardId shardId ; private boolean unallocated ; public Request ( ) { } public Request ( ShardId shardId , boolean unallocated , Set < String > nodesIds ) { } public Request ( ShardId shardId , boolean unallocated , String ... nodesIds ) { } @ Override public void readFrom ( StreamInput in ) throws IOException { } @ Override public void writeTo ( StreamOutput out ) throws IOException { } } public static class NodesStoreFilesMetaData extends NodesOperationResponse < TransportNodesListShardStoreMetaData . NodeStoreFilesMetaData > { private FailedNodeException [ ] failures ; NodesStoreFilesMetaData ( ) { } public NodesStoreFilesMetaData ( ClusterName clusterName , TransportNodesListShardStoreMetaData . NodeStoreFilesMetaData [ ] nodes , FailedNodeException [ ] failures ) { } public FailedNodeException [ ] failures ( ) { } @ Override public void readFrom ( StreamInput in ) throws IOException { } @ Override public void writeTo ( StreamOutput out ) throws IOException { } } static class NodeRequest extends NodeOperationRequest { private ShardId shardId ; private boolean unallocated ; NodeRequest ( ) { } NodeRequest ( String nodeId , TransportNodesListShardStoreMetaData . Request request ) { } @ Override public void readFrom ( StreamInput in ) throws IOException { } @ Override public void writeTo ( StreamOutput out ) throws IOException { } } public static class NodeStoreFilesMetaData extends NodeOperationResponse { private TransportNodesListShardStoreMetaData . StoreFilesMetaData storeFilesMetaData ; NodeStoreFilesMetaData ( ) { } public NodeStoreFilesMetaData ( DiscoveryNode node , TransportNodesListShardStoreMetaData . StoreFilesMetaData storeFilesMetaData ) { } public TransportNodesListShardStoreMetaData . StoreFilesMetaData storeFilesMetaData ( ) { } public static TransportNodesListShardStoreMetaData . NodeStoreFilesMetaData readListShardStoreNodeOperationResponse ( StreamInput in ) throws IOException { } @ Override public void readFrom ( StreamInput in ) throws IOException { } @ Override public void writeTo ( StreamOutput out ) throws IOException { } } }

Fix:
Path [ ] shardLocations = nodeEnv . shardDataPaths ( shardId , metaData . settings ( ) ) ;