Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FunctionClauseError in Ecto.RepoPreloader #4344

Closed
whatyouhide opened this issue Jan 4, 2024 · 2 comments
Closed

FunctionClauseError in Ecto.RepoPreloader #4344

whatyouhide opened this issue Jan 4, 2024 · 2 comments
Labels

Comments

@whatyouhide
Copy link
Contributor

Elixir version

1.16.0

Database and Version

PostgreSQL 13.3

Ecto Versions

3.11.1

Database Adapter and Versions (postgrex, myxql, etc)

Postgrex 0.17.4

Current behavior

I've recently seen this error:

** (FunctionClauseError) no function clause matching in anonymous fn/1 in Ecto.Repo.Preloader.maybe_pmap/3

This is the stacktrace:

lib/enum.ex in anonymous fn/3 in Enum.map/2 at line 1708
lib/enum.ex in anonymous fn/3 in Enum.map/2 at line 4399
lib/task/supervised.ex in Task.Supervised.stream_deliver/7 at line 386
lib/enum.ex in Enum.map/2 at line 4399

I’m not sure if this is an Ecto issue or an application issue, but seems like an Ecto issue from my investigation. I’m still trying to debug, but figured I're report this in case I’m missing something obvious 🙃

Expected behavior

No FunctionClauseError if this is indeed happening in Ecto.

@josevalim
Copy link
Member

I think Ecto is hiding the actual bug here. I think you are calling it from a process that is trapping exits, hiding the underlying pmap failure. We will improve it.

@whatyouhide
Copy link
Contributor Author

Fantastique, this will definitely help debug it. Thanks @josevalim! 💟

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants