Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Error Cannot read property 'byName' of undefined #1561

Closed
JulienPalard opened this issue Oct 7, 2014 · 34 comments · Fixed by #1617
Closed

Fatal Error Cannot read property 'byName' of undefined #1561

JulienPalard opened this issue Oct 7, 2014 · 34 comments · Fixed by #1617
Assignees
Labels
bug Fixes for quality problems that affect the customer experience
Milestone

Comments

@JulienPalard
Copy link

Hi, just got thins on kibana 4 beta 1, hop it helps, tell me if you want more:

Fatal Error
Cannot read property 'byName' of undefined
TypeError: Cannot read property 'byName' of undefined
    at BaseAggParam.FieldAggParamFactory.FieldAggParam.deserialize (http://.../index.js:103023:47)
    at http://.../index.js:104513:28
    at Array.forEach (native)
    at AggConfigFactory.AggConfig.fillDefaults (http://.../index.js:104502:27)
    at new AggConfig (.../index.js:104487:12)
    at http://.../index.js:104620:18
    at Array.map (native)
    at Registry.AggConfigs (http://.../index.js:104618:42)
    at VisFactory.Vis.setState (http://.../index.js:104757:19)
    at new Vis (http://.../index.js:104706:12)
@ghost
Copy link

ghost commented Oct 7, 2014

I am getting the same error when I try to save a visualization

@clever-trevor
Copy link

Same here. Created two visualisations, and added them to a dashboard. Then started on a third visualisation, got this error and now I can't access any of the views.
I deleted the last visualisation I added but still can't access anything previously created.

@MiikaJ
Copy link

MiikaJ commented Oct 7, 2014

I'm getting this too sometimes. It gets fixed if I remove the index pattern and add it back again.

@clever-trevor
Copy link

Yep, that fixed it. Had to go through Settings -> Indices, select the index pattern again and a suitable timestamp field, then save it.

Update.....it's down again.

Was working, didn't make any changes and it just stopped

Again, readding the index pattern fixes it.
Interestingly, if I refresh the page with F5, it breaks immediately. If I navigate through the menu options, it's fine.

@dmlbarrett
Copy link

I'm getting the same issue here. Readding the index fixes it. F5 breaks it.

@rashidkpc
Copy link
Contributor

Definitely a bug, we believe it to be a race condition and are trying to track it down. I've seen this also but have been unable to replicate it. As mentioned above, deleting the index pattern and recreating it seems to solve the problem for awhile.

@rashidkpc rashidkpc added the bug Fixes for quality problems that affect the customer experience label Oct 7, 2014
@rashidkpc rashidkpc added this to the 4.0.0-BETA2 milestone Oct 7, 2014
@spalger spalger self-assigned this Oct 7, 2014
@clever-trevor
Copy link

I've recreated this on two completely separate installations with different datasets.
The consistent factor (for me at least) is to create a chart with a date histogram on the first aggregation, and then a term sub-aggregation.
Save the visualisation, add it to a dashboard, save the dashboard - all good so far.
Then simply hitting F5 (page reload) and the error shows.

For reference, I'm using Chrome 37.0.2062.124.

@clever-trevor
Copy link

Latest. Downloaded clean copies of Elasticsearch 1.4, Kibana 4 and Logstash 1.4.2

Created dummy /tmp/data.log file with various records in this format :

2014-10-07 10:00:06 Country=UK City=London
2014-10-07 10:00:07 Country=USA City=Washington
2014-10-07 10:00:12 Country=Holland City=Amsterdam

Create logstash config

input {
  file {
    path => "/tmp/data.log"
    type => "logstash-data"
  }
}

filter {
  kv { }
  grok {
    match => ["message","^{TIMESTAMP_ISO8601:logdate} .*$"]
  }
  date {
    match => [ "logdate", "yyyy-dd-MM HH:mm:ss" ]
    target => "@timestamp"
  }
}

output {
  elasticsearch {
    host => "localhost"
    protocol => "http"
    index => "logstash-data"
  }
}

Start logstash to load dummy data

Now in Kibana 4, create the new index pattern using @timestamp as the "time field name"
Under visualize, create from new search (*) using above index.
-> Vertical Bar Chart -> Add Aggregation -> X-Axis -> Date Histogram
Field=@timestamp
Add Sub-Aggregation
Split-Bars -> Terms -> Field -> Country.raw -> Apply
Save visualization as "Test1"

Now hitting F5 will give the "byName" error.

Logs in console show this

{"@timestamp":"2014-10-07T21:50:34+01:00","status":"200","level":"INFO","name":"Kibana","request_method":"GET","request":"/","path":"/","query_string":"","remote_addr":"0:0:0:0:0:0:0:1","remote_user":null,"http_version":"HTTP/1.1","content_length":"2933","response_time":7,"message":"GET / 200 7ms -2933"}
{"@timestamp":"2014-10-07T21:50:34+01:00","status":"304","level":"INFO","name":"Kibana","request_method":"GET","request":"/bower_components/requirejs/require.js","path":"/bower_components/requirejs/require.js","query_string":"","remote_addr":"0:0:0:0:0:0:0:1","remote_user":null,"http_version":"HTTP/1.1","content_length":"-","response_time":6,"message":"GET /bower_components/requirejs/require.js 304 6ms - -"}
{"@timestamp":"2014-10-07T21:50:34+01:00","status":"304","level":"INFO","name":"Kibana","request_method":"GET","request":"/styles/main.css","path":"/styles/main.css","query_string":"","remote_addr":"0:0:0:0:0:0:0:1","remote_user":null,"http_version":"HTTP/1.1","content_length":"-","response_time":8,"message":"GET /styles/main.css 304 8ms - -"}
{"@timestamp":"2014-10-07T21:50:34+01:00","status":"304","level":"INFO","name":"Kibana","request_method":"GET","request":"/require.config.js","path":"/require.config.js","query_string":"","remote_addr":"0:0:0:0:0:0:0:1","remote_user":null,"http_version":"HTTP/1.1","content_length":"-","response_time":8,"message":"GET /require.config.js 304 8ms - -"}
{"@timestamp":"2014-10-07T21:50:34+01:00","status":"304","level":"INFO","name":"Kibana","request_method":"GET","request":"/index.js","path":"/index.js","query_string":"","remote_addr":"0:0:0:0:0:0:0:1","remote_user":null,"http_version":"HTTP/1.1","content_length":"-","response_time":5,"message":"GET /index.js 304 5ms - -"}
{"@timestamp":"2014-10-07T21:50:35+01:00","status":"200","level":"INFO","name":"Kibana","request_method":"GET","request":"/config","path":"/config","query_string":"","remote_addr":"0:0:0:0:0:0:0:1","remote_user":null,"http_version":"HTTP/1.1","content_length":"277","response_time":6,"message":"GET config 200 6ms - 277"}
{"@timestamp":"2014-10-07T21:50:35+01:00","status":"200","level":"INFO","name":"Kibana","request_method":"HEAD","request":"/elasticsearch/","path":"/elasticsearch/","query_string":"","remote_addr":"0:0:0:0:0:0:0:1","remote_user":null,"http_version":"HTTP/1.1","content_length":"-","response_time":56,"message":"HEAD /elasticsearch/ 200 56ms - -"}
{"@timestamp":"2014-10-07T21:50:35+01:00","status":"200","level":"INFO","name":"Kibana","request_method":"GET","request":"/elasticsearch/_nodes","path":"/elasticsearch/_nodes","query_string":"","remote_addr":"0:0:0:0:0:0:0:1","remote_user":null,"http_version":"HTTP/1.1","content_length":"2901","response_time":49,"message":"GET /elasticsearch/_nodes 200 49ms - 2901"}
{"@timestamp":"2014-10-07T21:50:35+01:00","status":"200","level":"INFO","name":"Kibana","request_method":"HEAD","request":"/elasticsearch/kibana-int","path":"/elasticsearch/kibana-int","query_string":"","remote_addr":"0:0:0:0:0:0:0:1","remote_user":null,"http_version":"HTTP/1.1","content_length":"-","response_time":50,"message":"HEAD /elasticsearch/kibana-int 200 50ms - -"}
{"@timestamp":"2014-10-07T21:50:35+01:00","status":"200","level":"INFO","name":"Kibana","request_method":"POST","request":"/elasticsearch/_mgetpreference=1412715035238","path":"/elasticsearch/_mget","query_string":"preference=1412715035238","remote_addr":"0:0:0:0:0:0:0:1","remote_user":null,"http_version":"HTTP/1.1","content_length":"131","response_time":39,"message":"POST /elasticsearch/_mget?preference=1412715035238 200 39ms - 131"}
{"@timestamp":"2014-10-07T21:50:36+01:00","status":"200","level":"INFO","name":"Kibana","request_method":"POST","request":"/elasticsearch/kibana-int/index-pattern/_searchfields=","path":"/elasticsearch/kibana-int/index-pattern/_search","query_string":"fields=","remote_addr":"0:0:0:0:0:0:0:1","remote_user":null,"http_version":"HTTP/1.1","content_length":"200","response_time":41,"message":"POST /elasticsearch/kibana-int/index-pattern/_search?fields= 200 41ms - 200"}
{"@timestamp":"2014-10-07T21:50:36+01:00","status":"200","level":"INFO","name":"Kibana","request_method":"GET","request":"/elasticsearch/kibana-int/_mapping/*/field/_source","path":"/elasticsearch/kibana-int/_mapping/*/field/_source","query_string":"","remote_addr":"0:0:0:0:0:0:0:1","remote_user":null,"http_version":"HTTP/1.1","content_length":"336","response_time":36,"message":"GET /elasticsearch/kibana-int/_mapping/*/field/_source 200 36ms - 336"}
{"@timestamp":"2014-10-07T21:50:36+01:00","status":"200","level":"INFO","name":"Kibana","request_method":"POST","request":"/elasticsearch/_mgetpreference=1412715035238","path":"/elasticsearch/_mget","query_string":"preference=1412715035238","remote_addr":"0:0:0:0:0:0:0:1","remote_user":null,"http_version":"HTTP/1.1","content_length":"594","response_time":39,"message":"POST /elasticsearch/_mget?preference=1412715035238 200 39ms - 594"}
{"@timestamp":"2014-10-07T21:50:36+01:00","status":"200","level":"INFO","name":"Kibana","request_method":"POST","request":"/elasticsearch/_mgetpreference=1412715035238","path":"/elasticsearch/_mget","query_string":"preference=1412715035238","remote_addr":"0:0:0:0:0:0:0:1","remote_user":null,"http_version":"HTTP/1.1","content_length":"2466","response_time":33,"message":"POST /elasticsearch/_mget?preference=1412715035238 200 33ms - 2466"}
{"@timestamp":"2014-10-07T21:50:36+01:00","status":"304","level":"INFO","name":"Kibana","request_method":"GET","request":"/bower_components/font-awesome/fonts/fontawesome-webfont.woffv=4.2.0","path":"/bower_components/font-awesome/fonts/fontawesome-webfont.woff","query_string":"v=4.2.0","remote_addr":"0:0:0:0:0:0:0:1","remote_user":null,"http_version":"HTTP/1.1","content_length":"-","response_time":6,"message":"GET /bower_components/font-awesome/fonts/fontawesome-webfont.woff?v=4.2.0 304 6ms - -"}

Tried this a couple of times with same results so seems to be recreatable on my system at least.

Let me know if you need any more info

@JulienPalard
Copy link
Author

Tried to delete almost everything on my Kibana 4, recreate a simple query, and a pie representation of it, two aggregations, so nice two level pie, and the bugs comes back.

It seems to appear while saving but I think it's wrong, it's when opening the visualisation, but as saving it seems to kind of reopen it, the bugs appear. Because when I open the visualisation from saved items, I got the message too.

@rashidkpc: Tell me if we can help more than copy/pasting the message, as I'm not a ruby / java runtime pro, I do not have an idea, but if I can help by dumping something, just tell us :)

@rodofumi
Copy link

rodofumi commented Oct 8, 2014

as suggested: dropping the index pattern gets rid of the error message (for a while) but trying to save a new simple visualization (with for instance just a date histogram) throws the same error message again.

@CullyB
Copy link

CullyB commented Oct 8, 2014

I was getting this very consistently, deleting the visualization pattern was not helping. The pattern would save, however on refresh the errors would come up. And on any attempt to load the visualization (closing browser, using new browser...even different computer) the load would fail.

I deleted the index kibana was saving to and that was helpful (we have been using kibana-4-int and running parallel instances of kibana as we test out the beta).

On the new 'clean' kibana-4-int index I created 2 saved searches and 2 visualizations without a problem.

However, when trying to load the first visualization I get the error - every time. Loading the second one seems to work just fine - every time. I can also reliably add the second to a dashboard, but not the first.

If there would be any helpful logs or error messages that we can share - please let me know.

@phobos182
Copy link

Getting the same issue here. Clean install, brand new index with only 3 documents. Etc..

@haiguo
Copy link

haiguo commented Oct 8, 2014

Getting the same issue.
create a single search/visualization and add that visualization to dashboard and save. reload kibana 4 in another browser window and open the saved dashboard hit this error. From there on, any new visualization cannot save.
Dropped all kibana 4 related indicies and tried to start over. follow the same sequence, things break at the same place as before.

@CullyB
Copy link

CullyB commented Oct 8, 2014

From what I have noticed...there seems to be a heavy amount of lag when clicking the save button on a visualization that errors out (I get this error: aggConfig.vis.indexPattern.fields is undefined). When the save button is nice and responsive the save works fine and the visualization can be viewed later and added to a dashboard. When it lags it's as if it is predicting that it will fail (save is sucessful but seemingly not complete).

@smayzak
Copy link

smayzak commented Oct 8, 2014

Was able to reproduce with the DateHistorgram then Term sub agg -> Dashboard -> F5 (Refresh).

@lramosar
Copy link

Just to confirm, Is this bug expected to be fixed on the November 7th 2014 release?

@clever-trevor
Copy link

This bug is already fixed in the Beta 1.1 release - at least it was fixed for me

@lramosar
Copy link

I am running BETA 1.1 and I still see the issue..

@w33ble
Copy link
Contributor

w33ble commented Nov 3, 2014

@lramosar can you provide any details about how you're getting that error? Steps to reproduce would be fantastic, but any insight would be helpful.

@mathias-work
Copy link

I still see it Version 4.0.0-rc1; Build 5827

bildschirmfoto 2015-02-16 um 19 18 13

Request:

{
  "query": {
    "filtered": {
      "query": {
        "query_string": {
          "query": "region:asia AND component:frontend",
          "analyze_wildcard": true
        }
      },
      "filter": {
        "bool": {
          "must": [
            {
              "range": {
                "@timestamp": {
                  "gte": 1424088800835,
                  "lte": 1424110400835
                }
              }
            }
          ],
          "must_not": []
        }
      }
    }
  },
  "size": 0,
  "aggs": {
    "2": {
      "date_histogram": {
        "field": "@timestamp",
        "interval": "1h",
        "pre_zone": "+01:00",
        "pre_zone_adjust_large_interval": true,
        "min_doc_count": 1,
        "extended_bounds": {
          "min": 1424088800835,
          "max": 1424110400835
        }
      },
      "aggs": {
        "1": {
          "cardinality": {
            "field": "ec2_ip.raw"
          }
        }
      }
    }
  }
}

@Binitkumarsingh
Copy link

i am using kibana latest version 4.0 .I am getting below error .
Fatal error : uncaught type error :cann't read property "length " ...how this bug will be fixed . I have to change in js or something else ? .. please help me
regards
Binit

@luckycse
Copy link

I am also getting above error "Fatal Error Cannot read property 'byName' of undefined" .Actually Earlied I never faced this issue when I had number of visualisation <100 but now I am having number of visualisation >100 and when I import json file containing dashboard and visulisation it shows above error.But when I import it again , I am able to see dashboard without any error. Can you please suggest some points . My ELK configuartion is Elastic search 2.2.1 and logstash 2.2.1 and kibana 4.4.2

@spalger
Copy link
Contributor

spalger commented Apr 17, 2016

@luckycse this error message is unfortunately pretty vague, and can be caused by a number of things, but I'm guessing in your case it's caused by visualizations that were saved with custom visualization type (maybe ones from timelion?) that are not available in the new installation you are importing them into.

@luckycse
Copy link

@spalger Error in detail :
Saved Objects: Cannot read property 'byName' of undefined
OK
TypeError: Cannot read property 'byName' of undefined
at FieldAggParamFactory.FieldAggParam.deserialize (http://:5601/bundles/kibana.bundle.js?v=9732:84771:53)
at http://:5601/bundles/kibana.bundle.js?v=9732:90104:29
at Array.forEach (native)
at AggConfigFactory.AggConfig.fillDefaults (http://:5601/bundles/kibana.bundle.js?v=9732:90082:28)
at new AggConfig (http://:5601/bundles/kibana.bundle.js?v=9732:89996:13)
at http://:5601/bundles/kibana.bundle.js?v=9732:90695:19
at Array.map (native)
at new AggConfigs (http://:5601/bundles/kibana.bundle.js?v=9732:90693:35)
at VisFactory.Vis.setState (http://:5601/bundles/kibana.bundle.js?v=9732:84236:20)
at SavedVis._updateVis (http://:5601/bundles/kibana.bundle.js?v=9732:92582:17)

@chiefy
Copy link

chiefy commented Jun 15, 2016

This is happening in 4.4.2 shouldn't it be re-opened?

commons.bundle.js?v=9732:39568 TypeError: Cannot read property 'byName' of undefined
    at FieldAggParamFactory.FieldAggParam.deserialize (http://test:7000/logging-ui/bundles/kibana.bundle.js?v=9732:93012:53)
    at http://test:7000/logging-ui/bundles/kibana.bundle.js?v=9732:97315:29
    at Array.forEach (native)
    at AggConfigFactory.AggConfig.fillDefaults (http://test:7000/logging-ui/bundles/kibana.bundle.js?v=9732:97293:28)
    at new AggConfig (http://test:7000/logging-ui/bundles/kibana.bundle.js?v=9732:97207:13)
    at http://test:7000/logging-ui/bundles/kibana.bundle.js?v=9732:97906:19
    at Array.map (native)
    at new AggConfigs (http://test:7000/logging-ui/bundles/kibana.bundle.js?v=9732:97904:35)
    at VisFactory.Vis.setState (http://test:7000/logging-ui/bundles/kibana.bundle.js?v=9732:92477:20)
    at new Vis (http://test:7000/logging-ui/bundles/kibana.bundle.js?v=9732:92425:13)(anonymous function) @ commons.bundle.js?v=9732:39568(anonymous function) @ commons.bundle.js?v=9732:36337processQueue @ commons.bundle.js?v=9732:41844(anonymous function) @ commons.bundle.js?v=9732:41852$eval @ commons.bundle.js?v=9732:43080$digest @ commons.bundle.js?v=9732:42891$apply @ commons.bundle.js?v=9732:43188done @ commons.bundle.js?v=9732:37637completeRequest @ commons.bundle.js?v=9732:37835requestLoaded @ commons.bundle.js?v=9732:37776
commons.bundle.js?v=9732:62929 reflow dashboard
Version 4.4.2
Build   9732
Commit SHA  b0ef773

@Bargs
Copy link
Contributor

Bargs commented Jun 16, 2016

@chiefy did you encounter this error after importing some visualizations/dashboards? If so, are there any objects those visualizations might rely on, like index patterns or specific fields, that don't exist in your new installation? Or perhaps you have custom visualizations from a plugin that's no longer installed (e.g. timelion) as @spalger mentioned above?

@chiefy
Copy link

chiefy commented Jun 16, 2016

@Bargs no, this was after I created a brand new dashboard from visualizations I also created within the same hour.

@Bargs
Copy link
Contributor

Bargs commented Jun 16, 2016

@chiefy ah interesting. When exactly did the error appear? Right after saving the dashboard? Do you have concrete steps to reproduce?

@chiefy
Copy link

chiefy commented Jun 16, 2016

@Bargs it's hard to describe what's going on - so naturally I made a gif.

Things work fine sometimes, but it seems like when I am on the dashboard page, and I refresh the page, it always barfs.

@Bargs
Copy link
Contributor

Bargs commented Jun 16, 2016

Thanks for the extra info @chiefy. I'm gonna re-open this. Do all three of those visualizations on your dashboard target the same index pattern? Is it the default index pattern?

@Bargs Bargs reopened this Jun 16, 2016
@luckycse
Copy link

luckycse commented Jul 1, 2016

I am still facing the issue. While Importing it gives the issue but after refreshing things work fine and I am able to see my dashboard.

@Bargs Bargs added P3 and removed P3 labels Jul 1, 2016
@chiefy
Copy link

chiefy commented Jul 1, 2016

@Bargs as it turns out my issue was caused by the fact that our index had something in the neighborhood of 14k fields. The POST request to Kibana was barfing due to exceeding max message size.

@spalger
Copy link
Contributor

spalger commented Aug 23, 2016

closing as @chiefy identified the underlying issue, and it's unrelated to this one.

@spalger spalger closed this as completed Aug 23, 2016
@bvanbleyenbergh
Copy link

Having the same error in Kibana 4.6.1
Index has 50 fields at max so I doubt it fails due to exceeding max message size.
Error does shows up 50% of the time (mostly fist time I open a dashboard). Refreshing (1-2 times) seems to fix the issue.

"TypeError: Cannot read property 'byName' of undefined at FieldAggParamFactory.FieldAggParam.deserialize"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.