kxkannan
Error upgrading to 1.15.x - associated module xyz is not an Ecto Schema
We are trying to upgrade to 1.15.x and running into this issue:
Compiling nnn files (.ex)
warning: invalid association `logs` in schema MyProject.Data.Alert: associated module MyProject.Data.AlertLog is not an Ecto schema
lib/my_project/data/alert.ex:1: MyProject.Data.Alert (module)
Compilation failed due to warnings while using the --warnings-as-errors option
Though the associated module AlertLog is in fact an Ecto.Schema. Does this have to do with the order in which these files (Alert, AlertLog) appear in Code path?
I tried adding prune_code_paths: false in mix.exs and that worked. But the warning in the Changelog for Elixir v1.15 — Elixir v1.15.7 documentation about runtime bug is a big concern.
So, not sure how to resolve this compile time warning/error. Any help/suggestions would be appreciated.
Most Liked
kxkannan
@sodapopcan Yes, I did this step and it works locally.
This failure consistently happens in our build pipeline. Not able to reproduce this error consistently in local machine (multiple developers tries this on their machines but no error).
LostKobrakai
Did you try resetting caches for CI as well?
joey_the_snake
This looks similar to what you are saying Intermittent "invalid association" warnings at compile time · Issue #4293 · elixir-ecto/ecto · GitHub







