influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

ApiException: 404

Open xinjaylin opened this issue 1 year ago • 3 comments

Hello, I try to use python to write data to influxdb, code like below: client = InfluxDBClient(url=url, token=token, org=org) write_api = client.write_api(write_options=SYNCHRONOUS) point = ( Point('measurement1') .tag('tagname1', 'tagval1') .field('field1', val) ) write_api.write(bucket=bucket, org=org, record=point) But I get "ApiException: (404)": Reason: Not Found HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json; charset=utf-8', 'X-Influxdb-Build': 'OSS', 'X-Influxdb- Version': 'v2.7.6', 'X-Platform-Error-Code': 'not found', 'Date': 'Mon, 10 Jun 2024 04:50:59 GMT', 'Content-Length': '68'}) HTTP response body: {"code":"not found","message":"bucket "\u003cgg\u003e" not found"} Any recommend or suggestion is appreciated! Thank you

xinjaylin avatar Jun 10 '24 05:06 xinjaylin

write_client = influxdb_client.InfluxDBClient(url=url, token=token, org=org)
bucket = '<gg>'
write_api = write_client.write_api(write_options=SYNCHRONOUS)
for val in range(5):
    point = (
        Point('measurement1')
        .tag('tagname1', 'tagval1')
        .field('field1', val)
    )
    write_api.write(bucket=bucket, org=org, record=point)
    time.sleep(1)

xinjaylin avatar Jun 10 '24 05:06 xinjaylin

ApiException: (404) Reason: Not Found HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json; charset=utf-8', 'X-Influxdb-Build': 'OSS', 'X-Influxdb-Version': 'v2.7.6', 'X-Platform-Error-Code': 'not found', 'Date': 'Mon, 10 Jun 2024 05:42:47 GMT', 'Content-Length': '68'}) HTTP response body: {"code":"not found","message":"bucket "\u003cgg\u003e" not found"}

xinjaylin avatar Jun 10 '24 05:06 xinjaylin

You appear to be writing to a bucket named "\u003cgg\u003e", which is not found. Do you have a bucket named those two unicode characters?

davidby-influx avatar Jul 11 '24 17:07 davidby-influx