Context deadline exceeded (Client.Timeout exceeded while awaiting headers) in Influxdb 2.0

I am running one container of Influxdb 2.0 and one container of telegraf and I am getting data from the AWS kinesis and using telegraf as a plugin to push into influxdb. Everything I was working fine where I was using influxdb 1.8 version and I was getting data into influxdb using kinesis as well but recently I updated my influxdb 1.8 to influxdb 2.0 now telegraf plugin is not working fine. I tried manually configuring the telegraf from the influxdb 2.0 and still, it’s giving errors.
Telegraf Configuration

   ## urls exp:
   ##urls = ["http://influxdb:8086"]
   urls = [""]
   token = "$INFLUX_TOKEN"
   organization = "airvana"
   bucket = "onecell_logs"
   region = "ap-south-1"
    access_key ="AKIAZWANSIFMDYO"
    secret_key = "mWEBI4UbErGwI9GCDE8RrFU+GPfpgyuL/yMd+8"
    profile = "arn:aws:iam::666268854852:instance-profile/ec2_to_aws_admin"
    streamname = "atlas_cu_om"
    shard_iterator_type = "TRIM_HORIZON"
   data_format = "csv"
  csv_header_row_count = 1
  csv_tag_columns = ["node","operatorName","type"]
  csv_timestamp_column = "datetime"
  csv_timestamp_format = "2006-01-02T15:04:05" 

In URLs, I am not sure we have to pass the IP and port or influxdb:port. I tried with both but still, I am getting errors.


Hello @Ravikant_Gautam,
Are you using an all access token?
Can you please include debug=true in the agent portion of your telegraf config and share the telegraf logs?
I also like to print to stdout with telegraf to help me debug/make sure the line protocol is as expected.

and what was now the solution?

Hello @costa299,
I’m not sure. I guess the user marked solution because either they a) needed an all. access token or b) were able to debug by setting debug=true ?
What problem are you having specifically?

Hi @Ravikant_Gautam - Can you please confirm what the issue was? I’m trying to troubleshoot the same issue, but haven’t been able to figure out the solution. If you can share what worked for you that would be much appreciated. Thanks!

I am using the telegraf 1.18 and InfluxDB 2.0 as docker containers in my ec2 machine.
Earlier when I was getting this error because I haven’t defined the token in my telegraf.conf file but after defining the token in telegraf.conf error still persists but telegraf able to write the data in Influxdb.
I think it’s a warning when telegraf starts it wants to communicate to the Influxdb but InfluxDB is not ready that time so it starts giving this error.
As you can see below I am getting the same error but still, my telegraf is working fine and writing data to the InfluxDB.

You can see giving the error for connection refused but I just pushed the data right now from Kinesis stream to InfluxDB using telegraf and I got the correct data in the proper format, So for me with this error, everything is working but after some time this error goes automatically that’s why I referred this as a warning.

I was facing the same issue in InfluxDB 1.8 and at that time everything was working fine even with this error as well.
If you are not getting the data in InfluxDB then it must be token error try to import the token in telegraf.conf file.

Can you tell me which input and output plugin you are using so I can help you better?