Error module name in object code is Elixir

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



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

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

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

So the problem does still persists then?

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

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.

macOS, nope just a regular phoenix umbrella application …

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?

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 …

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

1 Like

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…?

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.

1 Like

Have you figured out what was the problem? I’m facing the same issue

Hmm, the OP never followed up with answers to what was asked, if you could then we could try to help figure out what is up. :slight_smile:

1 Like

Hmm, a thought, how do you use it all? Like what specific command do you run from the commandline, what IDE are you using and what elixir-related plugins does it have, what filesystem, what OS, etc…?

I’m sorry, I was testing and the thread got of my radar.

It is indeed a tricky one to reproduce, sometimes the error stays away for hours, sometimes it goes away for months. mix clean seems to help (for a while …)

For me it started when I got a new laptop, this was also the time I upgraded to macOS Mojave and APFS.
I’m using Atom with the following packages, language-elixir, atom-elixir, atom-elixir-formatter.
The application is not dockerized of virtualized.

I havent seen this error for a while, and didn’t change much at application level.
Will keep an eye on it …

1 Like

I’m curious if it ever happens while the IDE is not running. Specifically I wonder if the IDE is recompiling it at the same time as you manually recompile it because the IDE notices build files changing. Be sure your IDE and your console are always run in different mix environments, like I have my IDE set to run in the test environment.

1 Like

I just use Atom as a texteditor, I’m not sure if there an Elixir process running. Maybe formatting and auto completion.

For me it happens when the compile triggers when a file is changed by Atom.

Wow, I thought my Mac had a bug because it’s old or something, but I’ve been experiencing the same issue since upgrading to APFS (encrypted). Not able to reproduce it consistently, but it does not only seem to occur with .beam files - I also have around 100 copies of my KeePassXC database flying around here by now…

My only “fix” for this so far was always cleaning the build and recompiling as suggested above. The main issue I have with this is that I haven’t found anything related around the web :(.

1 Like

maybe APFS (encrypted) is the smoking gun, that’s the moment when it started for me.
on my old laptop, no problemo, when I transferred to my new laptop (with APSS enc. and Mojave) the firework started.

1 Like