Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phoenix with burrito: Error when calling MFA defined by measurement #116

Open
relax2code opened this issue Oct 23, 2023 · 4 comments
Open

Comments

@relax2code
Copy link

Hi , first I want to thank you for making this, it's very helpful for deploying elixir app.
I have some issue with burrito releasing phoenix , the app successfully build and running , but it has error printed out :

 [error] Error when calling MFA defined by measurement: :telemetry_poller_builtin :memory []
Class=:error
Reason=:notsup
Stacktrace=[
  {:erlang, :memory, 0, []},
  {:telemetry_poller_builtin, :memory, 0,
   [
     file: ~c".../deps/telemetry_poller/src/telemetry_poller_builtin.erl",
     line: 24
   ]},
  {:telemetry_poller, :make_measurement, 1,
   [
     file: ~c".../deps/telemetry_poller/src/telemetry_poller.erl",
     line: 322
   ]},
  {:telemetry_poller, :"-make_measurements_and_filter_misbehaving/1-lc$^0/1-0-",
   1,
   [
     file: ~c".../deps/telemetry_poller/src/telemetry_poller.erl",
     line: 318
   ]},
  {:telemetry_poller, :handle_info, 2,
   [
     file: ~c".../deps/telemetry_poller/src/telemetry_poller.erl",
     line: 340
   ]},
  {:gen_server, :try_handle_info, 3, [file: ~c"gen_server.erl", line: 1077]},
  {:gen_server, :handle_msg, 6, [file: ~c"gen_server.erl", line: 1165]},
  {:proc_lib, :init_p_do_apply, 3, [file: ~c"proc_lib.erl", line: 241]}
]

Elixir: 1.15.5
Erlang: 26.0.2
Phoenix: ~> 1.7.9

mix.exs


  def application do
    [
      mod: {MyApp.Application, []},
      extra_applications: [:logger, :runtime_tools]
    ]
  end
...

  defp releases() do
    [
      my_app: [
        steps: [:assemble, &Burrito.wrap/1],
        burrito: [
          targets: [
            linux: [os: :linux, cpu: :x86_64]
          ]
        ]
      ]
    ]

Is there any settings that I missed ?
Thank you

@doawoo
Copy link
Contributor

doawoo commented Oct 27, 2023

Hm, I'm going to have to build an example app that matches your setup to debug this, that error isn't directing me to anything specific at the moment.

I'll try to build a test app in a little bit and see if I can get it to behave in a similar manner.

@relax2code
Copy link
Author

Thank you very much

@doawoo
Copy link
Contributor

doawoo commented Nov 1, 2023

Are you building this app with your MIX_ENV set to prod? or is it set to dev?

@relax2code
Copy link
Author

relax2code commented Nov 3, 2023

Sorry, I set it to prod, btw I'm using linux mint 21 (ubuntu 22 based) ,
here is my steps to release:

 MIX_ENV=prod  mix assets.deploy
 mix phx.digest
 MIX_ENV=prod mix release

prod.exs :

 import Config
config :pg_panel, PgPanelWeb.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json"
config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: PgPanel.Finch
config :swoosh, local: false
config :logger, level: :info

runtime.exs :

import Config
if System.get_env("PHX_SERVER") do
  config :pg_panel, PgPanelWeb.Endpoint, server: true
end

if config_env() == :prod do
  database_path =
    System.get_env("DATABASE_PATH") ||
      raise """
      environment variable DATABASE_PATH is missing.
      For example: /etc/pg_panel/pg_panel.db
      """

  config :pg_panel, PgPanel.Repo,
    database: database_path,
    pool_size: String.to_integer(System.get_env("POOL_SIZE") || "5")

  secret_key_base =
    System.get_env("SECRET_KEY_BASE") ||
      raise """
      environment variable SECRET_KEY_BASE is missing.
      You can generate one by calling: mix phx.gen.secret
      """

  host = System.get_env("PHX_HOST") || "example.com"
  port = String.to_integer(System.get_env("PORT") || "4000")

  config :pg_panel, :dns_cluster_query, System.get_env("DNS_CLUSTER_QUERY")

  config :pg_panel, PgPanelWeb.Endpoint,
    url: [host: host, port: 443, scheme: "https"],
    http: [
  
      ip: {0, 0, 0, 0, 0, 0, 0, 0},
      port: port
    ],
    secret_key_base: secret_key_base
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants