# Error module name in object code is Elixir

**URL:** <https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469>\
**Category:** Questions\
**Tags:** phoenix\
**Created:** [February 13, 2018, 12:59pm UTC](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469 "2018-02-13T12:59:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jos](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jos/32/6355_2.png) [@jos](https://forum.elixirforum.com/u/jos)\
**Post date:** [February 13, 2018, 12:59pm UTC](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469/1 "2018-02-13T12:59:52Z")

</div>

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

😳

---

<div class="post-metadata">

**Author:** ![NobbZ](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nobbz/32/27235_2.png) [@NobbZ](https://forum.elixirforum.com/u/NobbZ)\
**Post date:** [February 13, 2018, 1:10pm UTC](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469/2 "2018-02-13T13:10:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jos](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jos/32/6355_2.png) [@jos](https://forum.elixirforum.com/u/jos)\
**Post date:** [February 13, 2018, 1:11pm UTC](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469/3 "2018-02-13T13:11:20Z")

</div>

I removed the \_build dir 🙂 I think thats enough ..?  
and of course restarted 🙂

---

<div class="post-metadata">

**Author:** ![NobbZ](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nobbz/32/27235_2.png) [@NobbZ](https://forum.elixirforum.com/u/NobbZ)\
**Post date:** [February 13, 2018, 1:13pm UTC](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469/4 "2018-02-13T13:13:32Z")

</div>

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

So the problem does still persists then?

---

<div class="post-metadata">

**Author:** ![jos](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jos/32/6355_2.png) [@jos](https://forum.elixirforum.com/u/jos)\
**Post date:** [February 13, 2018, 1:14pm UTC](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469/5 "2018-02-13T13:14:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![NobbZ](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nobbz/32/27235_2.png) [@NobbZ](https://forum.elixirforum.com/u/NobbZ)\
**Post date:** [February 13, 2018, 1:17pm UTC](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469/6 "2018-02-13T13:17:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jos](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jos/32/6355_2.png) [@jos](https://forum.elixirforum.com/u/jos)\
**Post date:** [February 13, 2018, 1:18pm UTC](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469/7 "2018-02-13T13:18:45Z")

</div>

macOS, nope just a regular phoenix umbrella application ..

---

<div class="post-metadata">

**Author:** ![NobbZ](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nobbz/32/27235_2.png) [@NobbZ](https://forum.elixirforum.com/u/NobbZ)\
**Post date:** [February 13, 2018, 1:29pm UTC](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469/8 "2018-02-13T13:29:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jos](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jos/32/6355_2.png) [@jos](https://forum.elixirforum.com/u/jos)\
**Post date:** [February 13, 2018, 1:48pm UTC](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469/9 "2018-02-13T13:48:12Z")

</div>

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 …

---

<div class="post-metadata">

**Author:** ![jos](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jos/32/6355_2.png) [@jos](https://forum.elixirforum.com/u/jos)\
**Post date:** [February 13, 2018, 2:09pm UTC](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469/10 "2018-02-13T14:09:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![OvermindDL1](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/32/2677_2.png) [@OvermindDL1](https://forum.elixirforum.com/u/OvermindDL1)\
**Post date:** [February 13, 2018, 4:35pm UTC](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469/11 "2018-02-13T16:35:16Z")

</div>

> [@jos](#):
>
> ah, aaaand the errors are back .. just made a minor change to a html.eex file

Hmm, if you can reliably reproduce it but the same git repo does not reproduce elsewhere, maybe an [asciienema](https://asciinema.org/) 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…?

---

<div class="post-metadata">

**Author:** ![NobbZ](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nobbz/32/27235_2.png) [@NobbZ](https://forum.elixirforum.com/u/NobbZ)\
**Post date:** [February 13, 2018, 4:42pm UTC](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469/12 "2018-02-13T16:42:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gabrielpra](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/gabrielpra/32/14418_2.png) [@gabrielpra](https://forum.elixirforum.com/u/gabrielpra)\
**Post date:** [March 8, 2019, 12:45pm UTC](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469/13 "2019-03-08T12:45:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![OvermindDL1](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/32/2677_2.png) [@OvermindDL1](https://forum.elixirforum.com/u/OvermindDL1)\
**Post date:** [March 8, 2019, 4:52pm UTC](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469/14 "2019-03-08T16:52:50Z")

</div>

> [@gabrielpra](#):
>
> 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. 🙂

---

<div class="post-metadata">

**Author:** ![OvermindDL1](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/32/2677_2.png) [@OvermindDL1](https://forum.elixirforum.com/u/OvermindDL1)\
**Post date:** [March 12, 2019, 2:54pm UTC](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469/16 "2019-03-12T14:54:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jos](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jos/32/6355_2.png) [@jos](https://forum.elixirforum.com/u/jos)\
**Post date:** [March 12, 2019, 3:54pm UTC](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469/17 "2019-03-12T15:54:07Z")

</div>

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 ..

---

<div class="post-metadata">

**Author:** ![OvermindDL1](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/32/2677_2.png) [@OvermindDL1](https://forum.elixirforum.com/u/OvermindDL1)\
**Post date:** [March 12, 2019, 5:30pm UTC](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469/18 "2019-03-12T17:30:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jos](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jos/32/6355_2.png) [@jos](https://forum.elixirforum.com/u/jos)\
**Post date:** [March 12, 2019, 5:46pm UTC](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469/19 "2019-03-12T17:46:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jchrist](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@jchrist](https://forum.elixirforum.com/u/jchrist)\
**Post date:** [March 12, 2019, 6:33pm UTC](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469/20 "2019-03-12T18:33:11Z")

</div>

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 :(.

---

<div class="post-metadata">

**Author:** ![jos](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jos/32/6355_2.png) [@jos](https://forum.elixirforum.com/u/jos)\
**Post date:** [March 12, 2019, 6:49pm UTC](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469/21 "2019-03-12T18:49:13Z")

</div>

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.

[Next page](https://forum.elixirforum.com/t/error-module-name-in-object-code-is-elixir/12469.md?page=2)
