mstalker
I’m getting an intermittent compilation error when building a project in Docker:
== Compilation error in file lib/sentry/logger.ex ==
** (MatchError) no match of right hand side value: {:error, :enoent}
(elixir) lib/kernel/parallel_compiler.ex:198: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
could not compile dependency :sentry, "mix compile" failed. You can recompile this dependency with "mix deps.compile sentry", update it with "mix deps.update sentry" or clean it with "mix deps.clean sentry"
Kernel.ParallelCompiler.spawn_workers/6 calls :elixir_compiler.file/2, which calls file:read_file/1, which returns {error, enoent} if it can’t find a file.
:elixir_compiler.file/2 tries to pattern-match…
{ok, Bin} = file:read_file(File)
…fails, and raises the MatchError we see above.
Here are a few thoughts:
- I could just do what the instructions tell me to do
…and recompile the dependency with mix deps.compile sentry, but this only happens intermittently, so I don’t think the problem is with how I’m compiling. This is part of an automated build, too, and recompiling one dependency occasionally isn’t ideal. - I’m using the most recent version of Sentry, so
mix deps.update sentrywon’t help. - I don’t think
mix deps.clean sentryis the answer because I’m starting off with a clean slate; I’m building the project while building a Docker image. Bothdeps/and_build/are in my.dockerignorefile. - This only seems to happen with the Sentry library.
- The issue is intermittent. On most attempts to build the project and the Docker image, everything compiles correctly.
- Even though the error was in
lib/sentry/logger.exin the code snippet above, this error sometimes springs up in other files in the Sentry library. - My Docker image is running Erlang/OTP 20, and Elixir 1.6.1 compiled with OTP 20, on Debian GNU/Linux 8.
Do you have any suggestions for how to debug this? I’m a bit flummoxed. There’s an existing issue on the Sentry project that describes the problem, but I thought it might actually be a bug in the Elixir compiler, so I posted here, just in case ![]()
Trending in Questions
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Hello,
I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter).
The diffic...
New
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
Anyone here using Honeybadger?
My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of
Bandit.HTTPError...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
Other Trending Topics
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
There are three potential reasons for members of this forum to have a look at https://vutuv.de
You are tired or annoyed of LinkedIn.
Yo...
New
Aludel - LLM Evaluation Workbench
Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 4- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
josevalim
One idea is to use
straceat the moment of compilation and trace all of the system calls happening on lib/sentry/logger.ex. Something like:For all purposes, it seems the file exists in disk. So we need to figure out if for some reasons docker is saying it does not. In case docker does say it exists and Erlang still says it doesn’t, then there is something else at play.
easco
Are you seeing the problem on a Mac?
Using my mix project and docker files (which are unrelated to Sentry) on both an Mac and on our Linux-based build server, I’ve seen similar compile problems “frequently” when running in the dev environment on my Mac laptop, but never when running the container on the build server. The Mac often finishes without error - but will fail once out of 4 or 5 times.
I suspect that it may be related to the synchronization and timing between the Macintosh file system, and the container’s virtual file system. You may choose to read https://docs.docker.com/docker-for-mac/osxfs/#performance-issues-solutions-and-roadmap
But please understand that this is just a suspicion on my part - I have no verifiable evidence to prove or disprove.
mstalker
I’m only seeing problems on the build server, unfortunately. I made a loop to clean, get, and compile deps during the build process, and I got four failures out of 100 attempts, so the problem isn’t easy to reproduce. Your suspicion of the synchronization and timing between file systems sounds like a reasonable one.
I’ll look into that.
mstalker
straceis a good idea! It looks like Docker won’t let me usestraceas part of the build process, due to permissions issues. I had todocker exec -itinto the running container to use it. I ranstrace mix deps.compile.stracegave around 1000 lines of output, but the output stopped when the files started compiling. I may see if something like tracefile does the trick.As I was playing around with this, I got some more failures. The weird thing is that one compilation failure was in a file that only depended on
:os.system_time,DateTime,Map,String,Mix.Dep, andEnum. All of those should have been available.