Closed snewcomer closed 7 years ago
So what is interesting is building for production, I see this stack trace (_authorize_resource
). This is pre this commit. However, locally I have the correct canary code in my deps folder. I am using {:canary, github: "cpjk/canary"},
. Any thoughts on why this is occurring when building and deploying to prod?
If you're using Canary in production, I would recommend using the version on hex, rather than github, as it is more stable.
As for the error, would you mind posting the whole stack trace? https://github.com/cpjk/canary/blob/master/lib/canary/plugs.ex#L207 doesn't look like it's doing much.
@cpjk Definitely. Will do. I actually just realized it might be an old cached version (before the above commit ref) on my build server (rather than an unpublished pkg or something like that, if that is even possible)
@cpjk Sorry terrible theories on my part :). So here is the undefined function from my error log. Expands to Canada.Can.can?(%MyApp.User{...}, :update, %MyApp.Resource{...})
. So it has an arity of 3, I'm passing 3 arguments, etc. It works locally but not after building and deploying (w/ distillery and edeliver) to a server. Any thoughts on other debugging techniques to figure out this problem?
Elixir 1.4.2 Erlang 19.2
Then when jumping into iex -S mix locally
:
but on my server bin/myapp console
or bin/myapp remote_console
while it is running:
Turns out I had to add canada
to extra_applications in my mix file.
After deploying to a server, I am getting:
Abilities file:
Any thoughts on why this is failing after building and deploying (using distillery) to a server, but working locally? Not much to go on, but if you have encountered something similar, it would be great to hear! Otherwise will close this issue.