-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Associated module is not an Ecto schema #4371
Comments
Hi @paulo-silva. We need a mechanism to reproduce the warning, otherwise there isn't much we can do about it. :( |
@josevalim that makes sense, I'll try to reproduce it in a project example |
@josevalim I tried to reproduce that in a project example, but I'm unable to; I guess the issue is related to the project size. Is there any chance we can huddle and I can show you the issue in the real project? I tried the strategy proposed in slack ecto channel as a temp workaround, but I started getting deadlocks |
After some puzzling with this same error for me it was caused by having a module attribute reference to a different schema. Though most of the times doing that doesn't seem to cause any issues but in 1 case it caused the same error for me. Giving a warning everytime trying to build it.
Schema gets warning from has_many in organizations -> organization_memberships while this memberships references a third schema with the module attribute. I guess because it waits for the belongs_to to be ready and the organization waits for the has_many to be ready causing the issue. |
I saw another difference in our project from before the refactor that the has_many was removed from organization_role -> organization_memberships When I readd the has_many it will solve the warning. I guess because it is referenced in the has_many it knows to wait for it or something and no longer give the compile warning. |
After changing so probably some race condition in the compiler like nulian said. |
Closing it as #4293 was reopened. |
Elixir version
1.16.0
Database and Version
PostgreSQL 15.2
Ecto Versions
3.11.1
Database Adapter and Versions (postgrex, myxql, etc)
postgrex 0.17.4
Current behavior
While bumping elixir on my project, I noticed while compiling a warning like:
Checking this previous issue: #4293 - elixir 1.16 was meant to fix this problem, but some devs are still experiencing this problem.
Expected behavior
This warn should not happen, like it wasn't when using previous versions of elixir.
The text was updated successfully, but these errors were encountered: