tmate-io / tmate-master

Homepage and HTML client
15 stars 19 forks source link

Docker image - argument error - :erlang.binary_to_integer #13

Open pini-gh opened 3 years ago

pini-gh commented 3 years ago

Hi,

Still trying to setup a working docker-compose configuration. Here is my snippet for tmate-master:

  tmate-master:
    image: tmate/tmate-master:latest
    container_name: tmate-master
    restart: unless-stopped
    expose:
    - 4000
    environment:
      MASTER_BASE_URL: https://master-tmate.example.com/
      SECRET_KEY_BASE: secretkeybase
      INTERNAL_API_AUTH_TOKEN: internalapitoken
      PG_URI: postgres://tmate:postgrespassword@tmate-db:5432/tmate
      PG_POOLSIZE: 1
      ERL_COOKIE: erlcookie
      ERL_NODE_NAME: master-tmate.example.com
    networks:
      bridge:
      internal:

  tmate-db:
    image: postgres:12-alpine
    container_name: tmate-db
    restart: unless-stopped
    environment:
      POSTGRES_USER: tmate
      POSTGRES_PASSWORD: postgrespassword
      POSTGRES_DB: tmate
    volumes:
    - pgdata:/var/lib/postgresql/data
    networks:
      internal:

Environment variables guessed from [1] and [2]. |1] https://github.com/tmate-io/tmate-kube/blob/master/prod/master.yaml [2] https://github.com/tmate-io/tmate-master/blob/master/config/prod.exs

As I understand it, PG_SSL_CA_CERT and MAILGUN_* variables are not mandatory.

With these settings, tmate-master fails at startup with:

init terminating in do_boot ({,[{erlang,binary_to_integer,[],[]},{erl_eval,do_apply,6,[{_},{_}]},{erl_eval,expr,5,[{_},{_}]},{erl_eval,exprs,5,[{_},{_}]},{elixir,eval_forms,4,[{_},{_}]},{Elixir.Code,e

=INFO REPORT==== 28-Feb-2021::15:07:50.086563 ===  
    application: mix                           
    exited: stopped                             
    type: temporary                                  
argument error                                  
    :erlang.binary_to_integer("5b33eff2b1cf")                              
    (stdlib) erl_eval.erl:680: :erl_eval.do_apply/6               
    (stdlib) erl_eval.erl:449: :erl_eval.expr/5
    (stdlib) erl_eval.erl:126: :erl_eval.exprs/5                                                                                                                                                                       (elixir) src/elixir.erl:275: :elixir.eval_forms/4                                                                                                                                                                  (elixir) lib/code.ex:240: Code.eval_string/3                                                                                                                                                                       (mix) lib/mix/config.ex:158: anonymous fn/2 in Mix.Config.__import__!/2
    (elixir) lib/enum.ex:1948: Enum."-reduce/3-lists^foldl/2-0-"/3
                                                                                                                                                                                                                   {"init terminating in do_boot",{#{'__exception__'=>true,'__struct__'=>'Elixir.ArgumentError',message=><<"argument error">>},[{erlang,binary_to_integer,[<<"5b33eff2b1cf">>],[]},{erl_eval,do_apply,6,[{file,"erl_ev
al.erl"},{line,680}]},{erl_eval,expr,5,[{file,"erl_eval.erl"},{line,449}]},{erl_eval,exprs,5,[{file,"erl_eval.erl"},{line,126}]},{elixir,eval_forms,4,[{file,"src/elixir.erl"},{line,275}]},{'Elixir.Code',eval_str
ing,3,[{file,"lib/code.ex"},{line,240}]},{'Elixir.Mix.Config','-__import__!/2-fun-0-',2,[{file,"lib/mix/config.ex"},{line,158}]},{'Elixir.Enum','-reduce/3-lists^foldl/2-0-',3,[{file,"lib/enum.ex"},{line,1948}]}]
}}                  
Unable to configure release!

What could be missing?

Thanks in advance.

pini-gh commented 3 years ago

Thanks to gitmemory.com (which is issue #1 actually) I found out that I had to set the container's hostname to something like master-1. Else the hostname defaults to the container id (5b33eff2b1cf in the above error).

  tmate-master:
    image: tmate/tmate-master:latest
    container_name: tmate-master
    hostname: master-1
    restart: unless-stopped
...

Leaving this issue open as it may help others.