Interpreting the GenServer error

If your question is related to Phoenix or Nerves, please post it in the Phoenix or Nerves Questions / Help section. Thanks!

This is a very short information but I’ve just picked up Elixir and have a long way to go with very little time to focus on after the work.
I picked an open source library on [Github](https://github.com/Bluetab/td-bg) and followed the instructions to run it. However when I run ‘mix phx.server’ I encounter the error as posted below.

2020-07-09T12:29:14.586Z [error] pid=<0.332.0> module=gen_server GenServer TdCache.ConceptCache terminating
** (Redix.ConnectionError) the connection to Redis is closed
    (redix 0.11.1) lib/redix.ex:608: Redix.command!/3
    (td_cache 4.0.0) lib/td_cache/concept_cache.ex:388: anonymous fn/1 in TdCache.ConceptCache.migration_commands/0
    (elixir 1.10.4) lib/enum.ex:921: anonymous fn/3 in Enum.filter/2
    (stdlib 3.13) maps.erl:233: :maps.fold_1/3
    (elixir 1.10.4) lib/enum.ex:2127: Enum.filter/2
    (td_cache 4.0.0) lib/td_cache/concept_cache.ex:388: TdCache.ConceptCache.migration_commands/0
    (td_cache 4.0.0) lib/td_cache/concept_cache.ex:363: TdCache.ConceptCache.migrate/0
    (td_cache 4.0.0) lib/td_cache/concept_cache.ex:116: TdCache.ConceptCache.handle_info/2
    (stdlib 3.13) gen_server.erl:680: :gen_server.try_dispatch/4
    (stdlib 3.13) gen_server.erl:756: :gen_server.handle_msg/6
    (stdlib 3.13) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: :migrate
State: %{}

I would like to know where to look for the issue in the files. So can you let me know if just by looking at the error message can be interpret whether the issue is with the Elixir setup itself or the scripts by the author.
I’m going to start learning Elixir next week and would love to see the issue here exposed by you.

I have provided very little info but if the error message is decisive maybe you can help me identify the root cause of the issue. I wish I could provide more insight into the issue but I can’t understand the labyrinth/complexity of the code yet.

Thank you and happy weekend.

Here:

The code is calling Redix.command!(["TYPE", from]) == "set" and with the error message the connection to Redis is closed I assume that it is neither an error in the Elixir setup nor in the scripts but just because your Redis server is not running, or not accessible, or something alike.

1 Like

Thank you.

I went through the code and am not sure where to provide the necessary credentials to enable the connection to Redis server. I’m asking because the stack trace is un-followable for me.
Also how do I get the stack trace for the source of the error in elixir or is this the stack trace?

Yes this is the stack trace, you can see files and line numbers so …

Look in config/dev.exs there is a hostname for redis. Also look at the Redix docs maybe they tell how to configure the ibrary.

2 Likes