-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to Connect to Database Error #8
Comments
Hi Drew, I've just responded to your posts on the TMC forum but I'll summarize it here for others who may run into this issue. The connection string contains Server, Database, User Id and Password, these correspond to the Using the default TeslaMate docker setup from their documentation your connection string would be: Would it be useful to support the same env variables as TeslaMate / Grafana as an alternate configuration? I think perhaps that would make it clearer for people to know what to put in them |
Thanks for the quick reply. I've updated it to:
But it's still giving the same error. I checked the Docker compose file and the connection string values match those used by TeslaMate itself so I know they are correct as that's still working.
|
Ah just done some reading on the docker default network mode and looks like hostname lookup only works if you put teslamate inside the docker-compose.yml with the other services. You could try that, or you can lookup the ip address using Let me know how it goes! I'm currently running TeslaMateAgile myself on top of Kubernetes so the networking abstraction is a little different to the normal Docker one that I imagine most TeslaMate users are doing and I would like to improve the documentation for this |
OK - I added it to the docker-compose file for Teslamate and that did the trick! Thanks. I'll document this and submit a pull request to help others out. Quick one - does this work historically or is it only point in time forward? |
Perfect, yes if you could document about adding it to the TeslaMate docker-compose in particular that would be very useful to others I think, and yes it does work historically too, it calculates the cost for any charges within your geofence with no cost set (null value). Might also be worth documenting that too as I've had a few questions of that nature 🤣 |
I went ahead and updated the app to support the same env variables as TeslaMate itself and added instructions on how to add it to docker-compose so don't worry about that documentation |
Running this:
docker run --env-file /home/pi/TeslaMateAgile/variables.env mattjeanes/teslamateagile
With an variables.env file containing this:
Returns this:
I've confirmed that PostGres is listening on the correct port:
I'm running this on a RaspberryPi 4 running Raspian 10 Buster - all of the latest updates applied as of the submission of this issue.
Any ideas?
The text was updated successfully, but these errors were encountered: