elastic / stream2es

Stream data into ES (Wikipedia, Twitter, stdin, or other ESes)
355 stars 62 forks source link

stream2es is failing on my es index #31

Open fasher opened 10 years ago

fasher commented 10 years ago

I invoke stream2es es in order to reindex an index and it fails with e following exception

{:throwable #<ExceptionInfo clojure.lang.ExceptionInfo: clj-http: status 500 {:object {:trace-redirects ["http://uatelasticui5:9200/deals"], :request-time 10, :status 500, :headers {"content-type" "application/json; charset=UTF-8", "content-length" "93"}, :body "{\"error\":\"ClassCastException[java.lang.String cannot be cast to java.util.Map]\",\"status\":500}"}, :environment {client #<client$wrap_output_coercion$fn994 clj_http.client$wrap_output_coercion$fn__994@1b1f578c>, req {:request-method :put, :url "http://uatelasticui5:9200/deals", :body "{\"settings\":{\"index.version.created\":\"900599\",\"index.number_of_replicas\":\"3\",\"index.number_of_shards\":\"1\",\"index.auto_expand_replicas\":\"0-all\"},\"mappings\":{\"dynamic\":\"strict\",\"_all\":{\"enabled\":false},\"properties\":{\"lastUpdate\":{\"type\":\"long\"},\"storeIds\":{\"type\":\"long\"},\"categoryPath\":{\"type\":\"long\"},\"endDate\":{\"type\":\"long\"},\"productTags\":{\"type\":\"long\"},\"discountPercent\":{\"type\":\"integer\"},\"priceBucket\":{\"type\":\"integer\"},\"key\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"externalProductId\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"offerType\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"regularPrice\":{\"type\":\"double\",\"index\":\"no\"},\"dealPrice\":{\"type\":\"double\"},\"startDate\":{\"type\":\"long\"},\"feedSource\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"brandName\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"searchField\":{\"type\":\"string\",\"analyzer\":\"snowball\"},\"productId\":{\"type\":\"long\"},\"storesKey\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"shares\":{\"type\":\"integer\"},\"id\":{\"type\":\"long\"},\"description\":{\"type\":\"string\",\"index\":\"no\"},\"productName\":{\"type\":\"string\",\"index\":\"no\"},\"tags\":{\"type\":\"long\"}}}}"}, map916 {:trace-redirects ["http://uatelasticui5:9200/deals"], :request-time 10, :status 500, :headers {"content-type" "application/json; charset=UTF-8", "content-length" "93"}, :body "{\"error\":\"ClassCastException[java.lang.String cannot be cast to java.util.Map]\",\"status\":500}"}, resp {:trace-redirects ["http://uatelasticui5:9200/deals"], :request-time 10, :status 500, :headers {"content-type" "application/json; charset=UTF-8", "content-length" "93"}, :body "{\"error\":\"ClassCastException[java.lang.String cannot be cast to java.util.Map]\",\"status\":500}"}, status 500}}>, :wrapper #<ExceptionInfo clojure.lang.ExceptionInfo: clj-http: status 500 {:object {:trace-redirects ["http://uatelasticui5:9200/deals"], :request-time 10, :status 500, :headers {"content-type" "application/json; charset=UTF-8", "content-length" "93"}, :body "{\"error\":\"ClassCastException[java.lang.String cannot be cast to java.util.Map]\",\"status\":500}"}, :environment {client #<client$wrap_output_coercion$fn994 clj_http.client$wrap_output_coercion$fn__994@1b1f578c>, req {:request-method :put, :url "http://uatelasticui5:9200/deals", :body "{\"settings\":{\"index.version.created\":\"900599\",\"index.number_of_replicas\":\"3\",\"index.number_of_shards\":\"1\",\"index.auto_expand_replicas\":\"0-all\"},\"mappings\":{\"dynamic\":\"strict\",\"_all\":{\"enabled\":false},\"properties\":{\"lastUpdate\":{\"type\":\"long\"},\"storeIds\":{\"type\":\"long\"},\"categoryPath\":{\"type\":\"long\"},\"endDate\":{\"type\":\"long\"},\"productTags\":{\"type\":\"long\"},\"discountPercent\":{\"type\":\"integer\"},\"priceBucket\":{\"type\":\"integer\"},\"key\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"externalProductId\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"offerType\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"regularPrice\":{\"type\":\"double\",\"index\":\"no\"},\"dealPrice\":{\"type\":\"double\"},\"startDate\":{\"type\":\"long\"},\"feedSource\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"brandName\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"searchField\":{\"type\":\"string\",\"analyzer\":\"snowball\"},\"productId\":{\"type\":\"long\"},\"storesKey\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"shares\":{\"type\":\"integer\"},\"id\":{\"type\":\"long\"},\"description\":{\"type\":\"string\",\"index\":\"no\"},\"productName\":{\"type\":\"string\",\"index\":\"no\"},\"tags\":{\"type\":\"long\"}}}}"}, map916 {:trace-redirects ["http://uatelasticui5:9200/deals"], :request-time 10, :status 500, :headers {"content-type" "application/json; charset=UTF-8", "content-length" "93"}, :body "{\"error\":\"ClassCastException[java.lang.String cannot be cast to java.util.Map]\",\"status\":500}"}, resp {:trace-redirects ["http://uatelasticui5:9200/deals"], :request-time 10, :status 500, :headers {"content-type" "application/json; charset=UTF-8", "content-length" "93"}, :body "{\"error\":\"ClassCastException[java.lang.String cannot be cast to java.util.Map]\",\"status\":500}"}, status 500}}>, :stack-trace #<StackTraceElement[] [Ljava.lang.StackTraceElement;@35f5b2c4>, :cause nil, :message "clj-http: status 500", :object {:trace-redirects ["http://uatelasticui5:9200/deals"], :request-time 10, :status 500, :headers {"content-type" "application/json; charset=UTF-8", "content-length" "93"}, :body "{\"error\":\"ClassCastException[java.lang.String cannot be cast to java.util.Map]\",\"status\":500}"}, :environment {client #<client$wrap_output_coercion$fn994 clj_http.client$wrap_output_coercion$fn__994@1b1f578c>, req {:request-method :put, :url "http://uatelasticui5:9200/deals", :body "{\"settings\":{\"index.version.created\":\"900599\",\"index.number_of_replicas\":\"3\",\"index.number_of_shards\":\"1\",\"index.auto_expand_replicas\":\"0-all\"},\"mappings\":{\"dynamic\":\"strict\",\"_all\":{\"enabled\":false},\"properties\":{\"lastUpdate\":{\"type\":\"long\"},\"storeIds\":{\"type\":\"long\"},\"categoryPath\":{\"type\":\"long\"},\"endDate\":{\"type\":\"long\"},\"productTags\":{\"type\":\"long\"},\"discountPercent\":{\"type\":\"integer\"},\"priceBucket\":{\"type\":\"integer\"},\"key\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"externalProductId\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"offerType\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"regularPrice\":{\"type\":\"double\",\"index\":\"no\"},\"dealPrice\":{\"type\":\"double\"},\"startDate\":{\"type\":\"long\"},\"feedSource\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"brandName\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"searchField\":{\"type\":\"string\",\"analyzer\":\"snowball\"},\"productId\":{\"type\":\"long\"},\"storesKey\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"shares\":{\"type\":\"integer\"},\"id\":{\"type\":\"long\"},\"description\":{\"type\":\"string\",\"index\":\"no\"},\"productName\":{\"type\":\"string\",\"index\":\"no\"},\"tags\":{\"type\":\"long\"}}}}"}, map916 {:trace-redirects ["http://uatelasticui5:9200/deals"], :request-time 10, :status 500, :headers {"content-type" "application/json; charset=UTF-8", "content-length" "93"}, :body "{\"error\":\"ClassCastException[java.lang.String cannot be cast to java.util.Map]\",\"status\":500}"}, resp {:trace-redirects ["http://uatelasticui5:9200/deals"], :request-time 10, :status 500, :headers {"content-type" "application/json; charset=UTF-8", "content-length" "93"}, :body "{\"error\":\"ClassCastException[java.lang.String cannot be cast to java.util.Map]\",\"status\":500}"}, status 500}} clojure.lang.ExceptionInfo: clj-http: status 500 {:object {:trace-redirects ["http://uatelasticui5:9200/deals"], :request-time 10, :status 500, :headers {"content-type" "application/json; charset=UTF-8", "content-length" "93"}, :body "{\"error\":\"ClassCastException[java.lang.String cannot be cast to java.util.Map]\",\"status\":500}"}, :environment {client #<client$wrap_output_coercion$fn994 clj_http.client$wrap_output_coercion$fn__994@1b1f578c>, req {:request-method :put, :url "http://uatelasticui5:9200/deals", :body "{\"settings\":{\"index.version.created\":\"900599\",\"index.number_of_replicas\":\"3\",\"index.number_of_shards\":\"1\",\"index.auto_expand_replicas\":\"0-all\"},\"mappings\":{\"dynamic\":\"strict\",\"_all\":{\"enabled\":false},\"properties\":{\"lastUpdate\":{\"type\":\"long\"},\"storeIds\":{\"type\":\"long\"},\"categoryPath\":{\"type\":\"long\"},\"endDate\":{\"type\":\"long\"},\"productTags\":{\"type\":\"long\"},\"discountPercent\":{\"type\":\"integer\"},\"priceBucket\":{\"type\":\"integer\"},\"key\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"externalProductId\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"offerType\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"regularPrice\":{\"type\":\"double\",\"index\":\"no\"},\"dealPrice\":{\"type\":\"double\"},\"startDate\":{\"type\":\"long\"},\"feedSource\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"brandName\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"searchField\":{\"type\":\"string\",\"analyzer\":\"snowball\"},\"productId\":{\"type\":\"long\"},\"storesKey\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"omit_norms\":true,\"index_options\":\"docs\"},\"shares\":{\"type\":\"integer\"},\"id\":{\"type\":\"long\"},\"description\":{\"type\":\"string\",\"index\":\"no\"},\"productName\":{\"type\":\"string\",\"index\":\"no\"},\"tags\":{\"type\":\"long\"}}}}"}, map916 {:trace-redirects ["http://uatelasticui5:9200/deals"], :request-time 10, :status 500, :headers {"content-type" "application/json; charset=UTF-8", "content-length" "93"}, :body "{\"error\":\"ClassCastException[java.lang.String cannot be cast to java.util.Map]\",\"status\":500}"}, resp {:trace-redirects ["http://uatelasticui5:9200/deals"], :request-time 10, :status 500, :headers {"content-type" "application/json; charset=UTF-8", "content-length" "93"}, :body "{\"error\":\"ClassCastException[java.lang.String cannot be cast to java.util.Map]\",\"status\":500}"}, status 500}} at clj_http.client$wrap_exceptions$fn915.invoke(client.clj:111) at clj_http.client$wrap_accept$fn1035.invoke(client.clj:380) at clj_http.client$wrap_accept_encoding$fn1041.invoke(client.clj:394) at clj_http.client$wrap_content_type$fn__1030.invoke(client.clj:370) at clj_http.client$wrap_form_params$fn1079.invoke(client.clj:481) at clj_http.client$wrap_nested_params$fn1097.invoke(client.clj:505) at clj_http.client$wrap_method$fn1074.invoke(client.clj:464) at clj_http.cookies$wrap_cookies$fn526.invoke(cookies.clj:118) at clj_http.links$wrap_links$fn556.invoke(links.clj:50) at clj_http.client$wrap_unknown_host$fn__1106.invoke(client.clj:524) at clj_http.client$put.doInvoke(client.clj:633) at clojure.lang.RestFn.invoke(RestFn.java:423) at stream2es.es$put.invoke(es.clj:29) at stream2es.main$ensure_index.invoke(main.clj:395) at stream2es.main$main.invoke(main.clj:403) at stream2es.main$_main.doInvoke(main.clj:435) at clojure.lang.RestFn.applyTo(RestFn.java:137) at stream2es.main.main(Unknown Source)

drewr commented 10 years ago

Hey @fasher. Do you have the latest stream2es? I believe this was a bug I fixed. I would ask what version you have, but I had to fix stream2es --version. :relaxed: