influxdata / influxdata/kapacitor

How to debug stream task - httpOut always returns series: null

Open
#1,653 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2.4k
Forks
479
Avg merge
4d 16h
Merged PRs (30d)
4

Description

I am writing here after i spent hours of trying to debug my stream task and failed. I am out of ideas and hope that you can point me to the mistake i made. I lack ways to debug that stream, even though log nodes were added i see no errors anywhere and believe some major step is missing?

It's a simple test where i want to have a httpOut() node print out some data. At this point i do not even care what data, just some small *hello world*.

## My Problem

I created the stream task in Chronograf but whenever i issue a call to the API endpoint i receive a null series.

**URL**: `http://localhost:9092/kapacitor/v1/tasks/httpout-test/sensor`
**Response**: `{"series":null}`

## Version ##
```
~ ❯❯❯ kapacitor version
Kapacitor v1.3.3 (git: ce586f35e89e75a1779e2b493caba15d66295a15)
```

## Data

**Query:** `SELECT * FROM "azeti"."autogen"."Value" WHERE time > now() - 20s`

**Raw**
```
11/6/2017 5:25:21 PM,,5e908c8b-75a5-4116-a9b6-2113a9da3b43,0,2b7b223f-6f68-4c0d-beb2-2a4bbe8a90d5,Analogue_Output_1,0,
11/6/2017 5:25:21 PM,,5e908c8b-75a5-4116-a9b6-2113a9da3b43,0,7bbc56a4-e8d6-4c24-b575-7249b76973f3,Analogue_Input_1,0,
```

## The Task

```
~ ❯❯❯ kapacitor show httpout-test
ID: httpout-test
Error:
Template:
Type: stream
Status: enabled
Executing: true
Created: 06 Nov 17 15:33 CET
Modified: 06 Nov 17 17:19 CET
LastEnabled: 06 Nov 17 17:19 CET
Databases Retention Policies: ["azeti"."autogen"]
TICKscript:
stream
|from()
.database('azeti')
// .retentionPolicy('autogen')
.measurement('Value')
// .groupBy('sensor_guid', 'location_guid')
|window()
.period(2m)
.every(30s)
.align()
|log()
|last('processing_level')
// .where(lambda: "state" == 'WARNING')
|log()
|httpOut('sensor')

DOT:
digraph httpout-test {
graph [throughput="0.00 points/s"];

stream0 [avg_exec_time_ns="0s" errors="0" working_cardinality="0" ];
stream0 -> from1 [processed="0"];

from1 [avg_exec_time_ns="0s" errors="0" working_cardinality="0" ];
from1 -> window2 [processed="0"];

window2 [avg_exec_time_ns="0s" errors="0" working_cardinality="0" ];
window2 -> log3 [processed="0"];

log3 [avg_exec_time_ns="0s" errors="0" working_cardinality="0" ];
log3 -> last4 [processed="0"];

last4 [avg_exec_time_ns="0s" errors="0" working_cardinality="0" ];
last4 -> log5 [processed="0"];

log5 [avg_exec_time_ns="0s" errors="0" working_cardinality="0" ];
log5 -> http_out6 [processed="0"];

http_out6 [avg_exec_time_ns="0s" errors="0" working_cardinality="0" ];
}
```

## Questions ##

1. How can i troubleshoot stream tasks? None of my '|log()' logged anything into the logfile, i got DEBUG log level enabled. I can only see the HTTP requests.

```
[httpd] ::1 - - [06/Nov/2017:17:27:57 +0100] "GET /kapacitor/v1/tasks/httpout-test/sensor HTTP/1.1" 200 39 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36" 72d2efb9-c30f-11e7-840b-000000000000 260
```

2. Do stream tasks require a record&replay like batch tasks do? My understanding from the docs is that stream tasks live by the data collection from incoming data, e.g. my influxdb that receives new values every n seconds.
I found nothing in the docs but wonder if i miss any important enabling step? I did enable the task in Chronograf.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the request to /kapacitor/v1/tasks/httpout-test/sensor and inspect the task output from `kapacitor show httpout-test`, including its DOT metrics and log nodes. Trace whether the stream receives the shown InfluxDB data; done means explaining the null series and the missing stream-task debugging or enabling step.

Written by the indexing model from the issue text.

Assessment

Domain
stream-processing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.