Error module name in object code is Elixir


#1

Hmm, im not sure what’s going on here. I think it started when I updated to Elixir 1.6 && Erlang/OTP 20.
The list of errors is endless, it spits errors on controllers, views etc. Until a few weeks ago everything was fine.

Btw, the umbrella application is running ok, just many errors on application boot.

 13:46:58.538 [error] beam/beam_load.c(1412): Error loading module 'Elixir.App.Web.SubscriptionController 5':
      module name in object code is Elixir.App.Web.SubscriptionController


13:46:58.538 [error] Loading of /Users/jos/Documents/Projects/app_umbrella/_build/dev/lib/app_web/ebin/Elixir.App.Web.SubscriptionController 5.beam failed: :badfile

13:46:58.538 [error] beam/beam_load.c(1412): Error loading module 'Elixir.App.Web.SubscriptionController 6':
  module name in object code is Elixir.App.Web.SubscriptionController

13:46:58.538 [error] Loading of /Users/jos/Documents/Projects/app_umbrella/_build/dev/lib/app_web/ebin/Elixir.App.Web.SubscriptionController 6.beam failed: :badfile

13:46:58.539 [error] beam/beam_load.c(1412): Error loading module 'Elixir.App.Web.SubscriptionController 7':
  module name in object code is Elixir.App.Web.SubscriptionController

13:46:58.564 [warn] Logger has 500 messages in its queue, which is above :discard_threshold. Messages will be discarded until the message queue goes back to 75% of the threshold size

:flushed:


#2

Have you rebuilt (including dependencies) and restarted after upgrading everything?


#3

I removed the _build dir :slight_smile: I think thats enough …?
and of course restarted :slight_smile:


#4

Yeah removing the build folder issues a full rebuild the next time you build.

So the problem does still persists then?


#5

I removed the _build many times, after some time the errors starting to appear again …


#6

Windows or Linux?

Do you you (or some dependency) try to rebuild and reload modules on the fly?


Looks a bit like some conflict resolution on write when a file is opened already… Windows is known to have problems with files that are open already and someone else tries to overwrite or even delete them.


#7

macOS, nope just a regular phoenix umbrella application …


#8

In development mode? Are you using phoenix autoreload feature?

What filesystem is the application on?

Is the application dockerized or virtualized?

Can you share a minimal project that does have the same problems?

Have you watched if this messages come especially after touching and saving code and does the number increase monotonically?


#9

in dev mode yes, the fs is APFS (Encrypted) and the app is not dockerized.

as we speak the errors are gone, and everything is running smooth.
I will check when it is starting to appear again …


#10

ah, aaaand the errors are back … just made a minor change to a html.eex file


#11

Hmm, if you can reliably reproduce it but the same git repo does not reproduce elsewhere, maybe an asciienema session showing wiping the _build and how you compile and/or edit files and recompile and such? Also show the iex console, make sure fully updated, etc…?


#12

Also, please include in the asciinema an find _build -name '*.beam' right after the problem occured.

Also please check if the problem persists when you clone your problem completely from scratch in a different location of your FS. Ideally you do it once on the APFS formatted drive, and once on an external device formatted with a more legacy FS, efs4, NTFS, HFS+, or something else known to work, and report if the problem is reproducable on the corresponding location(s).

Also if you have the chance to give another APFS formatted Mac a try, please do it and include the result in your report.