Query function only works on nix, not windows, due to hardcoded file name
Closed this issue · 1 comments
Specifications
- Client Version: V3 0.8.0
- InfluxDB Version: InfluxDB cloud/serverless
- Platform: windows 11/raspbian
Code sample to reproduce problem
import os, time
from influxdb_client_3 import InfluxDBClient3, Point
token = "TOKEN"
org = "ORG"
host = "HOST"
database="BUCKET"
#client = InfluxDBClient3(host=host, token=token, org=org)
client = InfluxDBClient3(host=host, token=token, database=database)
query = """SELECT *
FROM "home"
WHERE
time >= now() - interval '1 day'
"""
# Execute the query
table = client.query(query=query, database="LES demo", language="sql")
Expected behavior
table returns query data
Actual behavior
table returns query data only on raspbian. On windows, error occurred where a hardcoded nix-style file path filename:"/usr/share/grpc/roots.pem" caused error. Relevant error printout:
E0908 21:07:15.016000000 20408 ssl_utils.cc:606] load_file: UNKNOWN:Failed to load file {created_time:"2024-09-09T02:07:14.9588837+00:00", filename:"/usr/share/grpc/roots.pem", children:[UNKNOWN:No such file or directory {syscall:"fopen", os_error:"No such file or directory", errno:2, created_time:"2024-09-09T02:07:14.9588693+00:00"}]}
E0908 21:07:15.026000000 20408 ssl_security_connector.cc:425] Could not get default pem root certs.
E0908 21:07:15.028000000 20408 chttp2_connector.cc:263] Failed to create channel args during subchannel creation: INTERNAL: Failed to create secure subchannel for secure name 'us-east-1-1.aws.cloud2.influxdata.com:443'; Got args: {grpc.client_channel_factory=0x14051cdec30, grpc.default_authority=us-east-1-1.aws.cloud2.influxdata.com:443, grpc.initial_reconnect_backoff_ms=100, grpc.internal.channel_credentials=0x14079e9a1f0, grpc.internal.event_engine=0x1407a6586a0, grpc.internal.subchannel_pool=0x1407a84a120, grpc.max_receive_message_length=-1, grpc.primary_user_agent=grpc-c++/1.51.1, grpc.resource_quota=0x1407a6987a0, grpc.secondary_user_agent=influxdb3-python/0.8.0, grpc.server_uri=dns:///us-east-1-1.aws.cloud2.influxdata.com:443, grpc.use_local_subchannel_pool=1}
Traceback (most recent call last):
Additional info
No response
Hi @liudr,
Please follow this instructions: https://github.com/InfluxCommunity/influxdb3-python?tab=readme-ov-file#windows-users
Best Regards