Skip to content

Seg fault when number of channels doesn't match number of items in data records #10

@chrisbartley

Description

@chrisbartley

[props to Dömötör for reporting this]

When the datastore receives more data in JSON than the number of channel names, bad stuff happens.

Example below is from data upload via ESDR, but the underlying issue is with datastore import.

For example, this:

PUT /api/v1/feeds/[FEED_API_KEY] HTTP/1.1
Host: esdr.cmucreatelab.org
User-Agent: HoneyBee/7.18 (Dylos/1.1)
Content-Type: application/json
Content-Length: 1116

[{"channel_names": ["Small","Large"],
"data": [[1523649421,155966,500,304],[1523649421,156466,500,305],[1523649422,156966,500,306],[1523649422,157466,500,307],[1523649423,157966,500,308],[1523649423,15846
6,500,309],[1523649424,158966,500,310],[1523649424,159466,500,311],[1523649425,159966,500,312],[1523649425,160466,500,313],[1523649426,160966,500,314],[1523649426,161
466,500,315],[1523649427,161966,500,316],[1523649427,162466,500,317],[1523649428,162966,500,318],[1523649429,163466,500,319],[1523649429,163966,500,320],[1523649430,1
64466,500,321],[1523649430,164966,500,322],[1523649431,165466,500,323],[1523649431,165966,500,324],[1523649432,166466,500,325],[1523649432,166966,500,326],[1523649433
,167466,500,327],[1523649433,167966,500,328],[1523649434,168466,500,329],[1523649434,168966,500,330],[1523649435,169466,500,331],[1523649435,169966,500,332],[15236494
36,170466,500,333],[1523649436,170966,500,334],[1523649437,171466,500,335],[1523649437,171966,500,336],[1523649438,172466,500,337],[1523649438,172966,500,338],[152364
9439,173466,500,339],[1523649439,173966,500,340],[1523649440,174466,500,341]]}]

gets a response like this (pretty-printed here for readability):

{
   "code" : 500,
   "status" : "fail",
   "data" : {
      "killed" : false,
      "code" : null,
      "signal" : "SIGSEGV",
      "cmd" : "/datastore1/bin/import /datastore1/data-prod 2768 feed_17466 --format json /tmp/node_bodytrack_datastore_json_data_to_import__11091_17128324_109923262_264447865_F7wtzjkGD4TF.json"
   },
   "message" : "Failed to execute datastore import command"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions