System wide hex error: `failed to start child: Hex.State`

,

I was tinkering with my current project, when I accidentally stopped my iex session. When I tried to restart I was greeted with the following error:

$ mix hex

14:16:25.094 [notice] Application hex exited: Hex.Application.start(:normal, []) returned an error: shutdown: failed to start child: Hex.State
    ** (EXIT) an exception was raised:
        ** (SyntaxError) invalid syntax found on nofile:9:56:
    error: unexpected token: }
    │
  9 │                         <<"expires_at">> => 1776426831}}}}.
    │                                                        ^
    │
    └─ nofile:9:56
            (elixir 1.19.5) lib/code.ex:628: Code.validated_eval_string/3
            (hex 2.4.1) lib/hex/config.ex:97: Hex.Config.decode_elixir/1
            (hex 2.4.1) lib/hex/config.ex:12: Hex.Config.read/0
            (hex 2.4.1) lib/hex/state.ex:135: Hex.State.start_link/1
            (stdlib 7.2.1) supervisor.erl:996: :supervisor.do_start_child_i/3
            (stdlib 7.2.1) supervisor.erl:982: :supervisor.do_start_child/3
            (stdlib 7.2.1) supervisor.erl:966: anonymous fn/3 in :supervisor.start_children/2

What happend? This happens system wide when trying any hex command. I even tried re-installing both hex and Elixir itself, but to no avail.

1 Like

Have you tried removing ~/.hex, or its alternative locations, if you have one of the relevant env-vars set?

4 Likes

Ah, that I missed - only had a look at the `~/.mix`.

1 Like