Nezteb

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.start in an iex session returns :ok as suggested in the GitHub issue.
  • Adding an explicit ssl: false config to my repo.
  • Adding :ssl to the Mix project’s extra_applications list.

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! :smiley:

Marked As Solved

Nezteb

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. :smiley: Thanks for all of the help!

Where Next?

Popular in Questions Top

lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
Werner
Hi, I’m using Ubuntu 18.04 and after updating to OTP-24.0 yesterday i have this warning when I run “mix local.hex”: 14:57:30.512 [warn] ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
Phillipp
Hey, I have a NanoPi-M3 and try to install Elixir on their Ubuntu image. I followed the Raspberry Pi installation instructions from the ...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
chewm
Hi guys, nice to meet you to the whole forum, I’m new here, I’m trying to configure visual studio code for elixir, right now the intellis...
New
Exadra37
Sometimes I want to check if the input into a function is not a blank string. My first approach: defmodule Example do def do_stuff(s...
New

Other popular topics Top

chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 27727 240
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

We're in Beta

About us Mission Statement