Skip to content

Beam error : corrupt file header #12317

@LaurianePace

Description

@LaurianePace

Elixir and Erlang/OTP versions

Erlang/OTP 25 [erts-13.0.4] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Elixir 1.14.2 (compiled with Erlang/OTP 25)

Operating system

Windows 11

Current behavior

Everytime i do any mix command I get this error:

14:19:19.734 [error] beam\beam_load.c(144): Error loading module 'Elixir.MyAppWeb.Endpoint':
  corrupt file header

14:19:19.734 [error] Loading of c:/Users/lauri/OneDrive/Bureau/my_app/_build/dev/lib/my_app/ebin/Elixir.MyAppWeb.Endpoint.beam failed: :badfile

Compiling 95 files (.ex)
warning: function fill_certificate/1 is unused
  lib/my_app/crm_integrations/ftp/netty.ex:115


14:19:34.990 [error] Process #PID<0.994.0> raised an exception
** (Module.Types.Error) found error while checking types for MyApp.Mailer.AuctionStartedUserEmail.perform/1

def perform(%Oban.Job{args: %{"auction_id" => auction_id}}) do
  auction = MyApp.Auctions.get_auction!(auction_id)
  accepted_participants = MyApp.Auctions.list_auction_accepted_participants(auction)
  property = MyApp.Properties.get_property_by_next_auction!(auction)
  local_start_datetime = MyApp.Auctions.Auction.start_date!(auction)
  start_date = MyAppWeb.Helpers.format_utc_datetime_date(local_start_datetime)
  start_time = MyAppWeb.Helpers.format_utc_datetime_time(local_start_datetime)
  end_local_datetime = MyApp.Auctions.Auction.end_date!(auction)
  end_date = MyAppWeb.Helpers.format_utc_datetime_date(end_local_datetime)
  end_time = MyAppWeb.Helpers.format_utc_datetime_time(end_local_datetime)

  Enum.each(accepted_participants, fn participant ->
    {:ok, %HTTPoison.Response{status_code: 201}} =
      Sendinblue.send_email(participant.email, 154, %{
        first_name: participant.first_name,
        last_name: participant.last_name,
        property_name: property.name,
        auction_start_date: start_date,
        auction_start_time: start_time,
        auction_end_date: end_date,
        auction_end_time: end_time,
        property_url:
          <<MyAppWeb.Endpoint.url()::binary,
            MyAppWeb.Router.Helpers.property_show_path(
              MyAppWeb.Endpoint,
              :show,
              property.slug
            )::binary>>
      })
  end)

  :ok
end

Please report this bug: https://github.com/elixir-lang/elixir/issues

** (FunctionClauseError) no function clause matching in Keyword.fetch/2
    (elixir 1.14.2) lib/keyword.ex:571: Keyword.fetch({:error, :beam_lib, {:not_a_beam_file, ""}}, :module)
    (elixir 1.14.2) lib/module/parallel_checker.ex:327: Module.ParallelChecker.cache_from_chunk/2
    (elixir 1.14.2) lib/module/parallel_checker.ex:320: Module.ParallelChecker.cache_module/2
    (elixir 1.14.2) lib/module/types/of.ex:243: Module.Types.Of.remote/5
    (elixir 1.14.2) lib/module/types/expr.ex:397: Module.Types.Expr.of_expr/4
    (elixir 1.14.2) lib/module/types/of.ex:195: Module.Types.Of.binary_segment/4
    (elixir 1.14.2) lib/module/types/of.ex:158: Module.Types.Of.binary/4
    (elixir 1.14.2) lib/module/types/expr.ex:39: Module.Types.Expr.of_expr/4
    (elixir 1.14.2) lib/module/types/of.ex:75: anonymous fn/4 in Module.Types.Of.map_pairs/4
    (elixir 1.14.2) lib/module/types/helpers.ex:93: Module.Types.Helpers.do_map_reduce_ok/3
    (elixir 1.14.2) lib/module/types/of.ex:67: Module.Types.Of.closed_map/4
    (elixir 1.14.2) lib/module/types/helpers.ex:93: Module.Types.Helpers.do_map_reduce_ok/3
    (elixir 1.14.2) lib/module/types/expr.ex:403: Module.Types.Expr.of_expr/4
    (elixir 1.14.2) lib/module/types/expr.ex:140: Module.Types.Expr.of_expr/4
    (elixir 1.14.2) lib/module/types/expr.ex:505: anonymous fn/3 in Module.Types.Expr.of_clauses/3
    (elixir 1.14.2) lib/module/types/helpers.ex:37: Module.Types.Helpers.do_reduce_ok/3
    (elixir 1.14.2) lib/module/types/expr.ex:260: Module.Types.Expr.of_expr/4
    (elixir 1.14.2) lib/module/types/helpers.ex:93: Module.Types.Helpers.do_map_reduce_ok/3
    (elixir 1.14.2) lib/module/types/expr.ex:403: Module.Types.Expr.of_expr/4
    (elixir 1.14.2) lib/module/types/helpers.ex:93: Module.Types.Helpers.do_map_reduce_ok/3
** (EXIT from #PID<0.94.0>) an exception was raised:
    ** (Module.Types.Error) found error while checking types for MyApp.Mailer.AuctionStartedUserEmail.perform/1

def perform(%Oban.Job{args: %{"auction_id" => auction_id}}) do
  auction = MyApp.Auctions.get_auction!(auction_id)
  accepted_participants = MyApp.Auctions.list_auction_accepted_participants(auction)
  property = MyApp.Properties.get_property_by_next_auction!(auction)
  local_start_datetime = MyApp.Auctions.Auction.start_date!(auction)
  start_date = MyAppWeb.Helpers.format_utc_datetime_date(local_start_datetime)
  start_time = MyAppWeb.Helpers.format_utc_datetime_time(local_start_datetime)
  end_local_datetime = MyApp.Auctions.Auction.end_date!(auction)
  end_date = MyAppWeb.Helpers.format_utc_datetime_date(end_local_datetime)
  end_time = MyAppWeb.Helpers.format_utc_datetime_time(end_local_datetime)

  Enum.each(accepted_participants, fn participant ->
    {:ok, %HTTPoison.Response{status_code: 201}} =
      Sendinblue.send_email(participant.email, 154, %{
        first_name: participant.first_name,
        last_name: participant.last_name,
        property_name: property.name,
        auction_start_date: start_date,
        auction_start_time: start_time,
        auction_end_date: end_date,
        auction_end_time: end_time,
        property_url:
          <<MyAppWeb.Endpoint.url()::binary,
            MyAppWeb.Router.Helpers.property_show_path(
              MyAppWeb.Endpoint,
              :show,
              property.slug
            )::binary>>
      })
  end)

  :ok
end

Please report this bug: https://github.com/elixir-lang/elixir/issues

** (FunctionClauseError) no function clause matching in Keyword.fetch/2
        (elixir 1.14.2) lib/keyword.ex:571: Keyword.fetch({:error, :beam_lib, {:not_a_beam_file, ""}}, :module)
        (elixir 1.14.2) lib/module/parallel_checker.ex:327: Module.ParallelChecker.cache_from_chunk/2
        (elixir 1.14.2) lib/module/parallel_checker.ex:320: Module.ParallelChecker.cache_module/2
        (elixir 1.14.2) lib/module/types/of.ex:243: Module.Types.Of.remote/5
        (elixir 1.14.2) lib/module/types/expr.ex:397: Module.Types.Expr.of_expr/4
        (elixir 1.14.2) lib/module/types/of.ex:195: Module.Types.Of.binary_segment/4
        (elixir 1.14.2) lib/module/types/of.ex:158: Module.Types.Of.binary/4
        (elixir 1.14.2) lib/module/types/expr.ex:39: Module.Types.Expr.of_expr/4
        (elixir 1.14.2) lib/module/types/of.ex:75: anonymous fn/4 in Module.Types.Of.map_pairs/4
        (elixir 1.14.2) lib/module/types/helpers.ex:93: Module.Types.Helpers.do_map_reduce_ok/3
        (elixir 1.14.2) lib/module/types/of.ex:67: Module.Types.Of.closed_map/4
        (elixir 1.14.2) lib/module/types/helpers.ex:93: Module.Types.Helpers.do_map_reduce_ok/3
        (elixir 1.14.2) lib/module/types/expr.ex:403: Module.Types.Expr.of_expr/4
        (elixir 1.14.2) lib/module/types/expr.ex:140: Module.Types.Expr.of_expr/4
        (elixir 1.14.2) lib/module/types/expr.ex:505: anonymous fn/3 in Module.Types.Expr.of_clauses/3
        (elixir 1.14.2) lib/module/types/helpers.ex:37: Module.Types.Helpers.do_reduce_ok/3
        (elixir 1.14.2) lib/module/types/expr.ex:260: Module.Types.Expr.of_expr/4
        (elixir 1.14.2) lib/module/types/helpers.ex:93: Module.Types.Helpers.do_map_reduce_ok/3
        (elixir 1.14.2) lib/module/types/expr.ex:403: Module.Types.Expr.of_expr/4
        (elixir 1.14.2) lib/module/types/helpers.ex:93: Module.Types.Helpers.do_map_reduce_ok/3

Expected behavior

Should compile or give a more readable error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions