{"action":"opened","issue":{"url":"https://api.github.com/repos/influxdb/influxdb/issues/4270","labels_url":"https://api.github.com/repos/influxdb/influxdb/issues/4270/labels{/name}","comments_url":"https://api.github.com/repos/influxdb/influxdb/issues/4270/comments","events_url":"https://api.github.com/repos/influxdb/influxdb/issues/4270/events","html_url":"https://github.com/influxdb/influxdb/issues/4270","id":108853446,"number":4270,"title":"Selecting multiple measurements where one doesn't exist may lead to panic","user":{"login":"naag","id":416860,"avatar_url":"https://avatars.githubusercontent.com/u/416860?v=3","gravatar_id":"","url":"https://api.github.com/users/naag","html_url":"https://github.com/naag","followers_url":"https://api.github.com/users/naag/followers","following_url":"https://api.github.com/users/naag/following{/other_user}","gists_url":"https://api.github.com/users/naag/gists{/gist_id}","starred_url":"https://api.github.com/users/naag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naag/subscriptions","organizations_url":"https://api.github.com/users/naag/orgs","repos_url":"https://api.github.com/users/naag/repos","events_url":"https://api.github.com/users/naag/events{/privacy}","received_events_url":"https://api.github.com/users/naag/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-29T11:50:17Z","updated_at":"2015-09-29T11:50:17Z","closed_at":null,"body":"We're pretty new to InfluxDB and wanted to try it out quickly. So we pulled the docker image from tutum/influxdb (version 0.9.4.1) and ran some experiments. When trying out multi measurement queries where one measurement doesn't exist, the server crashed, but only for certain measurement names like ```z```:\r\n\r\n```\r\n$ docker run -d -p 8086:8086 --name influxdb tutum/influxdb\r\n1f699f07971db75d0e1bf377f1aa50ad0367952c4fdb5a7c00e717cce29f76da\r\n\r\n$ curl -G http://localhost:8086/query --data-urlencode \"q=CREATE DATABASE events\"\r\n{\"results\":[{}]}\r\n\r\n$ curl -i -XPOST 'http://localhost:8086/write?db=events' --data-binary 'measurement_a value=76'\r\nHTTP/1.1 204 No Content\r\nRequest-Id: f85b6916-669e-11e5-8002-000000000000\r\nX-Influxdb-Version: 0.9.4.1\r\nDate: Tue, 29 Sep 2015 11:41:06 GMT\r\n\r\n$ curl -G http://localhost:8086/query --data-urlencode \"db=events\" --data-urlencode \"q=SELECT value FROM measurement_a, z\"\r\ncurl: (52) Empty reply from server\r\n```\r\n\r\nInfluxDB reports:\r\n\r\n```\r\npanic: runtime error: index out of range\r\n```\r\n\r\nFull output from ```docker logs influxdb``` is here: https://gist.github.com/naag/4ebaa85d3576e2cbe654.\r\n\r\nStrangely enough, all letters from a to m (including) work, n to z (including) crash... See this demo script:\r\n\r\n```\r\nfor char in {a..z}\r\ndo\r\n\tbroken_measurement=\"$char\"\r\n\tcontainer_name=\"influxdb-$broken_measurement\"\r\n\r\n\techo \"SELECT value FROM trying measurement_a, $broken_measurement\"\r\n\techo \"------------------------------------------------\"\r\n\r\n\tdocker rm -f \"$container_name\"\r\n\tdocker run -d -p 8086:8086 --name \"$container_name\" tutum/influxdb\r\n\tsleep 5\r\n\r\n\tcurl -w\"\\n\" -G http://localhost:8086/query --data-urlencode \"q=CREATE DATABASE events\"\r\n\tcurl -w\"\\n\" -i -XPOST 'http://localhost:8086/write?db=events' --data-binary 'measurement_a value=76'\r\n\tcurl -w\"\\n\" -G http://localhost:8086/query --data-urlencode \"db=events\" --data-urlencode \"q=SELECT value FROM measurement_a, $broken_measurement\"\r\n\r\n\tdocker kill \"$container_name\"\r\n\r\n\techo\r\n\techo\r\ndone\r\n```\r\n\r\nDetails on the docker image:\r\n\r\n```\r\n$ docker run -it tutum/influxdb bash -l\r\n\r\nroot@38bf2bb9cc9b:/# lsb_release -a\r\nNo LSB modules are available.\r\nDistributor ID:\tUbuntu\r\nDescription:\tUbuntu 14.04.1 LTS\r\nRelease:\t14.04\r\nCodename:\ttrusty\r\n\r\nroot@38bf2bb9cc9b:/# dpkg -l influx*\r\nDesired=Unknown/Install/Remove/Purge/Hold\r\n| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend\r\n|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)\r\n||/ Name                                                          Version                             Architecture                        Description\r\n+++-=============================================================-===================================-===================================-================================================================================================================================\r\nii  influxdb                                                      0.9.4.1                             amd64                               Distributed time-series database\r\n```\r\n\r\nObviously such queries aren't the norm in the real world, but we'd still like InfluxDB to handle such cases gracefully. If you need any more information, we'd be happy to provide it :-)"}}