%Inspect.Error{message: "got UndefinedFunctionError with message \"function Inspect.DateTime.inspect/2 is undefined (module Inspect.DateTime is not available)\" while inspecting %{__struct__: DateTime, calendar: Calendar.ISO, day: 31, hour: 10, microsecond: {806000, 6}, minute: 6, month: 5, second: 42, std_offset: 0, time_zone: \"Etc/UTC\", utc_offset: 0, year: 2017, zone_abbr: \"UTC\"}"}
%DateTime{calendar: Calendar.ISO, day: 31, hour: 11, microsecond: {450449, 6},
minute: 25, month: 5, second: 38, std_offset: 0, time_zone: "Etc/UTC",
utc_offset: 0, year: 2017, zone_abbr: "UTC"}
when i am trying to convert, utc_datetime(Ecto data type) from postgresql, it is giving above current behaviour. i am not able to understand why it is happening.
I am building release, after that it is returning like this. when i do run release with console, and try to do DateTime.utc_now(), it is giving me the same error.
thank you in advance.
Hrm, something unexpected is happening. It should not try to invoke Inspect.DateTime because Inspect.DateTime does not implement such protocol. Maybe something wrong is happening during protocol consolidation or during releases?
_build and compile again, can you still reproduce it inside a release?MIX_ENV=prod iex -S mix?Doesn't timex or calendar implement Inspect for DateTime? Are you using one of them? Also, are you using an umbrella?
yes, i am using umbrella app. and no i am not using timex, this is pure DateTime and for ecto it is :utc_datetime datatype column. @michalmuskala
@josevalim I tried deleting _build and then generating release again. same error.
@i-m-v-j can you reproduce it using only mix (without releases)? And can you isolate the bug or provide me private access to the application so we can try it out? We suspect this may be related to an Elixir bug with protocols.
same error here. Had umbrella app. Trying to build DateTime struct like this
%DateTime{ year: 2017, month: 6, day: 14, hour: 13, minute: 53, second: 20, microsecond: {0, 0}, time_zone: "Etc/UTC", zone_abbr: "UTC", utc_offset: 0, std_offset: 0 }
got same errors as @0freeman00
Elixir version 1.4.0
will provide more details soon
This was indeed related to a bug in Elixir: https://github.com/elixir-lang/elixir/issues/5987
It is permanently fixed in the 1.5 release. For earlier releases recompiling the project withmix compile --force should fix the issue temporarily.
No, i don't think it is bug. because in my case, i was trying to convert nil value to date. so that is why it was throwing error. so, @mkaravaev please check and make sure you are by mistake not trying to convert date of nil value.
The error that was in the initial report message - Inspect.Error instead of the proper output is exactly because of this bug.
Most helpful comment
This was indeed related to a bug in Elixir: https://github.com/elixir-lang/elixir/issues/5987
It is permanently fixed in the 1.5 release. For earlier releases recompiling the project with
mix compile --forceshould fix the issue temporarily.