Open cwanja opened 4 months ago
Thanks for reporting.
But according to the PSQL logs (below), there is no password set.
Not sure if I get this right, but I do understand, that TeslaMate could not know your Postgres Password in dev environment. https://docs.teslamate.org/docs/development is only the TeslaMate part, not Mosquitto nor Postgres. Brian created a nix flake to spin up a whole dev environment #3485 and #3760
But the mix setup
and MIX_ENV=test mix ecto.setup
should establish the database. But it does not work.
Would be curious if others could get a GitHub code space to work? It's free for a certain number of hours.
Will give it a try in the next weeks
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
@JakobLichterfeld have you had a chance to look at this? Would love to leverage this as I do not have a spare development environment. And this seems like a great way to spin up and down a developer instance. Thanks!
I am not sure if I understand this issue.
"mix ecto.setup" is just an an alias fro "mix ecto.create" and "mix ecto.migrate".
https://github.com/teslamate-org/teslamate/blob/master/mix.exs#L77
mix create will connect to an existing postgresql server, using connection configuration (username, password, host, etc) that has been already been provided and issue a "CREATE DATABASE" command.
i.e. you must already have a connection to the database server in order to run "mix ecto.create".
Apologies if I misunderstood.
Guess I am confused. And fully admitting mix and all of this is well outside my wheelhouse. Spent way longer than I would like to admit to trying to get it setup.
Our documentation says a database already needs to be created:
To run the TeslaMate test suite you need a database named teslamate_test:
Yet you are saying the mix create
as part of mix ecto.setup
will issue a create database command.
mix create will connect to an existing postgresql server, using connection configuration (username, password, host, etc) that has been already been provided and issue a "CREATE DATABASE" command.
The test database is a special case, that should be created automatically if it doesn't exist.
The mix create command is for the non-test database.
I am still confused. Are you saying I need to establish a database, user and password that matches the mix commands?
And if I do not need to do that because the mix commands take care of it, my issue is then that the commands do not work given the errors above.
I'd be really curious if anyone can setup a Codespace and get it working (it's free minus your time). It's entirely possible that the commands work (I am sure they do) and my environment is missing something.
@JakobLichterfeld have you had a chance to look at this? Would love to leverage this as I do not have a spare development environment. And this seems like a great way to spin up and down a developer instance. Thanks!
Sorry not yet
Like I said, mix ecto.setup is just a wrapper function that sends certain commands to the database for convenience.
You are expected to setup the database server and have authentication work yourself.
Or use the nix flake to set up dev environment, innit?
Yes, that should work also. If the dev environment is active (I have this setup using direnv), then devenv up
will bring up all the required dependencies. And the environment variables should be configured, so commands like "mix setup" will just work.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
Is there an existing issue for this?
What happened?
Not necessarily a TeslaMate issue, but in light of #4007, I stood up a GitHub code space in my forked repo. However, when following the documentation I cannot get
mix setup
orMIX_ENV=test mix ecto.setup
to run.I would have expected the password in the
runtime.exs
to establish the database and authentication. But according to the PSQL logs (below), there is no password set.Expected Behavior
Codespace is compile and establish app.
Steps To Reproduce
Relevant log output
Screenshots
No response
Additional data
No response
Type of installation
GitHub Codespaces
Version
v1.29.X