{"action":"created","issue":{"url":"https://api.github.com/repos/trenpixster/addict/issues/56","labels_url":"https://api.github.com/repos/trenpixster/addict/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/trenpixster/addict/issues/56/comments","events_url":"https://api.github.com/repos/trenpixster/addict/issues/56/events","html_url":"https://github.com/trenpixster/addict/issues/56","id":101466608,"number":56,"title":"All routes return (Poison.EncodeError) unable to encode value: {nil, \"users\"}","user":{"login":"mrluc","id":38204,"avatar_url":"https://avatars.githubusercontent.com/u/38204?v=3","gravatar_id":"","url":"https://api.github.com/users/mrluc","html_url":"https://github.com/mrluc","followers_url":"https://api.github.com/users/mrluc/followers","following_url":"https://api.github.com/users/mrluc/following{/other_user}","gists_url":"https://api.github.com/users/mrluc/gists{/gist_id}","starred_url":"https://api.github.com/users/mrluc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrluc/subscriptions","organizations_url":"https://api.github.com/users/mrluc/orgs","repos_url":"https://api.github.com/users/mrluc/repos","events_url":"https://api.github.com/users/mrluc/events{/privacy}","received_events_url":"https://api.github.com/users/mrluc/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-17T17:08:44Z","updated_at":"2015-11-27T14:15:15Z","closed_at":"2015-08-18T11:52:06Z","body":"So, actions like /register take appropriate database effect, but explode trying to return a json response with the aforementioned error.\r\n\r\nUnfortunately the Poison error thrown gives a stacktrace that's very unhelpful! So I rather have to guess that this is happening in `Addict.Controller`'s `register` code when it tries to call `json conn, message`, as this happens with default addict routes handling the `/register` POST:\r\n\r\n```\r\n[info] POST /register\r\n[debug] Processing by Addict.Controller.register/2\r\n  Parameters: %{\"_csrf_token\" => \"QDFUHx4yDgxVF3tCHwVaHzBzQVMZEAAApe6hzuyNfdC8MlhEBKr4Jw==\", \"email\" => \"hambone@example.com\", \"format\" => \"html\", \"password\" => \"[FILTERED]\", \"username\" => \"mrluc\"}\r\n  Pipelines: [:browser]\r\n[debug] BEGIN [] OK query=0.4ms\r\n[debug] INSERT INTO \"users\" (\"email\", \"hash\", \"inserted_at\", \"recovery_hash\", \"updated_at\", \"username\") VALUES ($1, $2, $3, $4, $5, $6) RETURNING \"id\" [\"hambone@example.com\", \"$pbkdf2-sha512$60000$Aji.Gc/s3A7oiM/TWWH3WA$E7eill52.Jg7KMhYifgOW0ZXG/A8mebWrlsfaHyM14WdDhSa9yEDAN6C6UFpikGYsUMpH74WcpMNwE6jGUVOGw\", {{2015, 8, 14}, {23, 17, 4, 0}}, nil, {{2015, 8, 14}, {23, 17, 4, 0}}, \"mrluc\"] OK query=0.9ms\r\n[debug] COMMIT [] OK query=6.4ms\r\n[info] Sent 500 in 968ms\r\n[error] #PID<0.490.0> running Flashbang.Endpoint terminated\r\nServer: localhost:4000 (http)\r\nRequest: POST /register\r\n** (exit) an exception was raised:\r\n    ** (Poison.EncodeError) unable to encode value: {nil, \"users\"}\r\n        (poison) lib/poison/encoder.ex:213: Poison.Encoder.Any.encode/2\r\n        (poison) lib/poison/encoder.ex:156: anonymous fn/4 in Poison.Encoder.Map.encode/2\r\n        (stdlib) lists.erl:1261: :lists.foldl/3\r\n        (poison) lib/poison/encoder.ex:157: Poison.Encoder.Map.encode/2\r\n        (poison) lib/poison/encoder.ex:156: anonymous fn/4 in Poison.Encoder.Map.encode/2\r\n        (stdlib) lists.erl:1261: :lists.foldl/3\r\n        (poison) lib/poison/encoder.ex:157: Poison.Encoder.Map.encode/2\r\n        (poison) lib/poison/encoder.ex:156: anonymous fn/4 in Poison.Encoder.Map.encode/2\r\n```"},"comment":{"url":"https://api.github.com/repos/trenpixster/addict/issues/comments/160148251","html_url":"https://github.com/trenpixster/addict/issues/56#issuecomment-160148251","issue_url":"https://api.github.com/repos/trenpixster/addict/issues/56","id":160148251,"user":{"login":"srajappa","id":9093383,"avatar_url":"https://avatars.githubusercontent.com/u/9093383?v=3","gravatar_id":"","url":"https://api.github.com/users/srajappa","html_url":"https://github.com/srajappa","followers_url":"https://api.github.com/users/srajappa/followers","following_url":"https://api.github.com/users/srajappa/following{/other_user}","gists_url":"https://api.github.com/users/srajappa/gists{/gist_id}","starred_url":"https://api.github.com/users/srajappa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srajappa/subscriptions","organizations_url":"https://api.github.com/users/srajappa/orgs","repos_url":"https://api.github.com/users/srajappa/repos","events_url":"https://api.github.com/users/srajappa/events{/privacy}","received_events_url":"https://api.github.com/users/srajappa/received_events","type":"User","site_admin":false},"created_at":"2015-11-27T14:15:15Z","updated_at":"2015-11-27T14:15:15Z","body":"I am sure it is an encoding error which gets reflected in the stack-trace here. I guess I should look for answers in the controller **AppController**. Is that the case ? \r\n\r\n```Elixir\r\n08:40:17.418 request_id=nMaM8lZOYm06c6PuI4C3 [info] Processing by Grandcentral.Api.AppController.index/2\r\n  Parameters: %{\"format\" => \"json\"}\r\n  Pipelines: [:api, :any_auth]\r\n08:40:17.639 request_id=nMaM8lZOYm06c6PuI4C3 [info] Sent 500 in 240ms\r\n08:40:17.656 [error] #PID<0.495.0> running Grandcentral.Endpoint terminated\r\nServer: gc-dev.zappos.biz:4000 (http)\r\nRequest: GET /api/apps\r\n** (exit) an exception was raised:\r\n    ** (Poison.EncodeError) unable to encode value: {nil, \"apps\"}\r\n        (poison) lib/poison/encoder.ex:339: Poison.Encoder.Any.encode/2\r\n        (poison) lib/poison/encoder.ex:213: anonymous fn/4 in Poison.Encoder.Map.encode/3\r\n        (poison) lib/poison/encoder.ex:214: Poison.Encoder.Map.\"-encode/3-lists^foldl/2-0-\"/3\r\n        (poison) lib/poison/encoder.ex:214: Poison.Encoder.Map.encode/3\r\n        (poison) lib/poison/encoder.ex:213: anonymous fn/4 in Poison.Encoder.Map.encode/3\r\n        (poison) lib/poison/encoder.ex:214: Poison.Encoder.Map.\"-encode/3-lists^foldl/2-0-\"/3\r\n        (poison) lib/poison/encoder.ex:214: Poison.Encoder.Map.encode/3\r\n        (poison) lib/poison/encoder.ex:232: anonymous fn/3 in Poison.Encoder.List.encode/3\r\n```"}}