Something broken

I use “InfluxDB 2.1.1 (git: 657e1839de) build_date: 2021-11-09T03:03:48Z” for Windows. I setup it in Jan 2022. Setup one bucket (never data override). I used python client to store and query data. Everything was ok. I did not touch it for 4 or 5 months, but today I found there is no data at all. My queries returns 0 records and so on. I open the Data explorer, but no data at all, no tags and so on :frowning: My script still is writing data to the bucket without any errors. but I cannot see any data.

Questions:

  1. Is there way to enable logging for Windows version (for Linux I understand how to od it, but in Windows I don’t see the config file)?
  2. I tried ‘influx server-config -t “xxxx”’ and got ‘Error: failed to retrieve config: 404 Not Found: path not found’: Is it expected?
  3. How I can determine what data is still in InfluxDB? It would be great to get examples and so on
  4. Any ideas what is broken? and how to fix it?

Thanks,
Valery.

Hello @gwg605,
Welcome!
I’m sorry to hear that.
Can you tell me a little bit more about your use case?
Can you successfully write any data to InfluxDB? Like with cURL?

What client library are you using?
Can you verify that it’s this one:

I might suggest also creating an issue above ^

Thank you.

Hello @Anaisdg ,
Thanks for the reply. It seems the situation is better than I though before.

  1. I use Python client v1.30.0
  2. I fixed write by adding ‘WritePrecision.NS’: write_api.write(info[‘bucket’], info[‘org’], data, WritePrecision.NS), ie I can see/select new data.
  3. I have idea that write works all time, but timestamps were interpreted in wrong way and all data is still in bucket but has wrong timestamps.

There are questions:

  • How I can dump everything from bucket to analyze what bucket actually contains?
  • Is it possible correct timestamps without recreating bucket?
  • Is it possible to delete part of data? How it may affect on the performance?

Thanks,
Valery.

Hello @gwg605,
Of course! That’s what we’re here for :slight_smile:

  1. Perhaps you want to specify the timezone?
    Specify for pandas DataFrame example:
port pandas as pd

from influxdb_client import InfluxDBClient
from influxdb_client.client.write_api import SYNCHRONOUS

url = "http://localhost:8086"
token = "my-token"
org = "my-org"

with InfluxDBClient(url=url, token=token, org=org) as client:

    data_frame = pd.read_csv("path/to/1dSCCOPLMCOPX.csv")
    client \
        .write_api(write_options=SYNCHRONOUS) \
        .write(bucket="my-bucket",
               record=data_frame,
               data_frame_measurement_name="scco",
               data_frame_timestamp_column="Date",
               data_frame_timestamp_timezone="EST")

Specify for point example:

 point = Point.measurement("h2o") \
            .tag("location", "europe") \
            .field("level", True) \
            .time(datetime.now(timezone.utc), WritePrecision.S)

Does that help?

PS what are you using Influx for? I love to hear about what users are doing with Influx but most people just like to get help and leave :stuck_out_tongue: If you want to make my day, feel free to share :slight_smile:

Hello @Anaisdg ,
Thanks for you help. Now I can see all data, but I don’t know what to do with it. All old data has the same timestamp: 1970-01-20 05:24:46 GMT :)))

  • Maybe influxdb store some internal timestamp when record added or something like this? otherwise I don’t see way how to restore original timestamps.

I use influxDB for storing telemetry of my smart house :slight_smile: it is about 50 records per minute, not so big.

Best regards,
Valery.

Hello @gwg605,
It looks like your timestamp was written incorrectly. I’d double check the precision of your timestamp.
Note: InfluxDB often uses epoch 0 ( 1970-01-01T00:00:00Z ) as a null timestamp equivalent. When you get timestamps from 1970 that tells me that theres some small error in writing or formatting your timestamp correctly.

@gwg605,
That’s really cool that you’re using InfluxDB to monitor your smart house!