Closed xxhenglyxx closed 5 years ago
Sorry for this silly issue lol, the problem was actually about the System.get_env("DB_POOL")
, which my environment variable name was DB_POOL_SIZE=10
, after changing it back to DB_POOL, it works as expected now.
Sorry for this silly issue lol, the problem was actually about the
System.get_env("DB_POOL")
, which my environment variable name wasDB_POOL_SIZE=10
, after changing it back to DB_POOL, it works as expected now.
@xxhenglyxx How did you get the incorrect line in your runtime_config.exs? Sometimes it becomes quite a task as there is no runtime_config line number in stack_trace
Steps to reproduce
path to run
bin/app_server/foreground
Verbose Logs
Paste the output of the release command you ran with the
--verbose
flag below in the summary tags (this helps keep the issue easy to navigate):Description of issue
your app is running on :::port
, and here is the error when running it2.0.14
alpine:3.9
,elixir:1.8.2
rel/config.exs
, as it is often my first troubleshooting question, and you'll save us both time :)use Mix.Releases.Config, default_release: :default, default_environment: Mix.env()
environment :dev do set dev_mode: true set includeerts: false set cookie: :"l5IbBfyF]$21)C)uk?K88<cQj(UpeFD(*9FSotIg!}&{S0HVE,q.te59Q}X%Z" end
environment :prod do set include_erts: true set includesrc: false set cookie: :"IP)x/}2r:c@uJpHBIKm4%=N|t3BAgyP^d2)wv0vw!mhNdES3k.Bl,i&Io<N/sXg" set vm_args: "rel/vm.args"
set config_providers: [ {Mix.Releases.Config.Providers.Elixir, ["${RELEASE_ROOT_DIR}/etc/runtime_config.exs"]} ]
set overlays: [ {:copy, "rel/runtime_config.exs", "etc/runtime_config.exs"} ] end
release :app_server do set version: current_version(:app_server) set applications: [ :runtime_tools ] end
rel/runtime_config.exs
use Mix.Config
db_pool = String.to_integer(System.get_env("DB_POOL") || 10) smtp_port = String.to_integer(System.get_env("SMTP_PORT") || 587) server_port = String.to_integer(System.get_env("SERVER_PORT") || 5000) redis_pool = String.to_integer(System.get_env("REDIS_POOL_SIZE") || 5)
config :app_server, AppServer.Mailer, server: System.get_env("SMTP_SERVER"), hostname: System.get_env("SMTP_HOST"), port: smtp_port, username: System.get_env("SMTP_USER"), password: System.get_env("SMTP_PASSWORD")
config :app_server, AppServer.Repo, username: System.get_env("DB_USER"), password: System.get_env("DB_PASSWORD"), database: System.get_env("DB_NAME"), hostname: System.get_env("DB_HOST"), pool_size: db_pool
config :app_server, AppServerWeb.Endpoint, secret_key_base: System.get_env("SECRET_KEY_BASE"), url: [host: System.get_env("SERVER_HOST"), port: server_port], http: [:inet6, port: server_port], pubsub: [ adapter: Phoenix.PubSub.Redis, node_name: System.get_env("REDIS_NODE"), host: System.get_env("REDIS_HOST"), name: AppServer.PubSub, pool_size: redis_pool ]
config :app_server, AppServer.Guardian, issuer: System.get_env("JWT_TOKEN_ISSUER"), secret_key: System.get_env("JWT_SECRET_KEY")
config :ex_aws, debug_requests: false, access_key_id: System.get_env("AWS_API_KEY"), secret_access_key: System.get_env("AWS_API_SECRET"), s3: [ scheme: "https://", host: System.get_env("AWS_BUCKET_NAME") <> ".s3.amazonaws.com", region: System.get_env("AWS_BUCKET_REGION") ]
config :app_server, :aws_bucket_name, System.get_env("AWS_BUCKET_NAME")
config :app_server, :smtp_user, System.get_env("SMTP_USER")
config :app_server, :redis_cache_host, System.get_env("REDIS_CACHE_HOST")
config :app_server, :cors_origin, System.get_env("CORS_ORIGIN")
config :app_server, :nexmo_api_key, System.get_env("NEXMO_API_KEY") config :app_server, :nexmo_api_secret, System.get_env("NEXMO_API_SECRET")