Okay, so this is SUPER WEIRD.
Instead of return an id for a query, Ecto is returning a \v
for an id!
This is on our production box. Never seen anything like this. Never had even a minor glitch with Ecto.
Any thought on how to troubleshoot this?
As you can see, all of the ids are proper integers.
Am I missing something obvious?
Any help would be most appreciated!
iex(web-phoenix-79-1@192.168.0.12)23> query = from s in Schedule, select: s.id
#Ecto.Query<from s in Polo.Apex.Transfer.Schedule, select: s.id>
iex(web-phoenix-79-1@192.168.0.12)24> Polo.Repo.all(query)
15:18:26.520 [debug] Processed SELECT a0."id" FROM "apex_transfer_schedule" AS a0 in 0ms
[2, 5, 3, 6, 11, 7, 4, 8, 1, 9, 10, 12]
iex(web-phoenix-79-1@192.168.0.12)25> query =
...(web-phoenix-79-1@192.168.0.12)25> from s in Schedule,
...(web-phoenix-79-1@192.168.0.12)25> where: s.status == "TRANSFER_READY" or s.status == "TRANSFER_ERROR",
...(web-phoenix-79-1@192.168.0.12)25> select: s.id
#Ecto.Query<from s in Polo.Apex.Transfer.Schedule,
where: s.status == "TRANSFER_READY" or s.status == "TRANSFER_ERROR",
select: s.id>
iex(web-phoenix-79-1@192.168.0.12)26> Polo.Repo.all(query)
15:19:14.796 [debug] Processed SELECT a0."id" FROM "apex_transfer_schedule" AS a0 WHERE ((a0."status" = 'TRANSFER_READY') OR (a0."status" = 'TRANSFER_ERROR')) in 0ms
'\v'
iex(web-phoenix-79-1@192.168.0.12)27> Polo.Repo.all(query)|> inspect
15:19:28.379 [debug] Processed SELECT a0."id" FROM "apex_transfer_schedule" AS a0 WHERE ((a0."status" = 'TRANSFER_READY') OR (a0."status" = 'TRANSFER_ERROR')) in 0ms
"'\\v'"
iex(web-phoenix-79-1@192.168.0.12)28>
Now the same query without the select: s.id
:
iex(web-phoenix-79-1@192.168.0.12)30> query =
...(web-phoenix-79-1@192.168.0.12)30> from s in Schedule,
...(web-phoenix-79-1@192.168.0.12)30> where: s.status == "TRANSFER_READY" or s.status == "TRANSFER_ERROR"
#Ecto.Query<from s in Polo.Apex.Transfer.Schedule,
where: s.status == "TRANSFER_READY" or s.status == "TRANSFER_ERROR">
iex(web-phoenix-79-1@192.168.0.12)31> Polo.Repo.all(query)
15:34:24.140 [debug] Processed SELECT a0."id", a0."apex_account_id", a0."template_id", a0."status", a0."apex_status", a0."target_sell_date", a0."target_transfer_date", a0."response", a0."inserted_at", a0."updated_at" FROM "apex_transfer_schedule" AS a0 WHERE ((a0."status" = 'TRANSFER_READY') OR (a0."status" = 'TRANSFER_ERROR')) in 1ms
[%Polo.Apex.Transfer.Schedule{__meta__: #Ecto.Schema.Metadata<:loaded, "apex_transfer_schedule">,
apex_account: #Ecto.Association.NotLoaded<association :apex_account is not loaded>,
apex_account_id: "8CM05208", apex_status: nil,
apex_transfer_template: #Ecto.Association.NotLoaded<association :apex_transfer_template is not loaded>,
id: 11, inserted_at: ~N[2018-01-25 01:41:26.289576], response: nil,
status: "TRANSFER_READY", target_sell_date: nil,
target_transfer_date: ~D[2018-01-24], template_id: 11,
updated_at: ~N[2018-01-25 01:41:26.360090]}]
as you can see, the id
returned should be 11
, not \v
.