PacktPublishing / Learn-Grafana-7.0

Learn Grafana 7.0, published by packt
MIT License
66 stars 46 forks source link

Unable to create influx db in chap05 #11

Closed kiranchavala closed 2 years ago

kiranchavala commented 3 years ago

I was following steps mentioned in chap05 and getting the following authentication error

Has anything changed in influx db version 2.0.8

https://github.com/PacktPublishing/Learn-Grafana-7.0/tree/master/Chapter05

docker run --rm --network host -v "$(PWD):/usr/src/app" weather --input wx.txt --db weatherdb

INFO:root:http://localhost:8086/query?q=CREATE+DATABASE+weatherdb ERROR:root:create_database: 401:Unauthorized Traceback (most recent call last): File "/usr/src/app/./weather.py", line 164, in sys.exit(main()) File "/usr/src/app/./weather.py", line 159, in main load_wx_data(db_host=args.host, db_port=args.port, db_name=args.database, input_file=args.input_file) File "/usr/src/app/./weather.py", line 80, in load_wx_data create_database(db_host=db_host, db_port=db_port, db_name=db_name) File "/usr/src/app/./weather.py", line 19, in create_database raise Exception(f'create_database: {response.status_code}:{response.reason}') Exception: create_database: 401:Unauthorized

vl306 commented 2 years ago

I encountered the same issue and worked around it by adding the following .env file to each chapter to select specific versions of each container.

~/Learn-Grafana-7.0/Chapter06# cat .env INFL_TAG=1.7.8 GRAF_TAG=7.5.0

esalituro commented 2 years ago

@vl306 : I'm sorry, I just now saw your issue.

This issue was first surfaced in #2. You are correct, you can pin the influxDB version by modifying the docker-compose.yml or override it with an .env file.