Nezteb
(Postgrex.Error) ssl not available
When starting Elixir application, I get the “errors” screenshotted below. This is a basic Phoenix application that has been working fine for me up until recently.
Elixir: 1.14.1-otp-25
Erlang: 25.1.1
Postgres: postgis/postgis:13-3.1
The redacted part is just an app-specific environment variable; MIX_ENV is set to dev. As far as I know SSL shouldn’t be used; I don’t have any special config options set anywhere, neither in the mix project nor Postgres itself.
The most relevant Google result for this error message is this GitHub issue: SSL not available · Issue #387 · elixir-ecto/postgrex · GitHub
Things I’ve tried:
- Running
:ssl.startin aniexsession returns:okas suggested in the GitHub issue. - Adding an explicit
ssl: falseconfig to my repo. - Adding
:sslto the Mix project’sextra_applicationslist.
So far nothing seem to work. The only other relevant thing I can think to mention is that I’m on an M2 macOS laptop; I’ve tried running Postgres with both Docker Desktop and locally using Postgres.app, but both give me the same errors.
Any ideas would be greatly appreciated! ![]()
Marked As Solved
Nezteb
Turns out I misunderstood some of the application I’m working on!
It has a config for an AWS Redshift repo, but it was supposedly disabled when running locally. Despite that, the application.ex file will still try to start up the Redshift connection regardless of the value in the config file.
So now I’ve added a helper in the application children list like so:
# An application children helper function
defp common_backend_children(mode) do
[
# ...
maybe_enable_redshift(),
# ...
]
|> Enum.reject(&is_nil/1)
end
defp maybe_enable_redshift() do
# cfg!/1 is a configuration helper that reads a YAML file for extra config
if cfg!([:redshift, :enabled]) do
MyApp.RedshiftRepo
else
nil
end
end
Sooooooo disregard this entire thread.
Thanks for all of the help!
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #javascript
- #code-sync
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









