-
-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] String.binary_to_existing_atom #140
Comments
Hey @EdBondRSA We're using Are you manually defining Could you please share your Kaffy configs so I have a better understanding of what's going on? |
👋 In local development it works fine, doing the release mode is what is coming up funky. So:
I went to admin -> clickd on the context -> clicked on the account row. We are also behind a load balancer and the nodes are not clusterd. Also on the live view dashboard I don't see the atom list etc. |
Interesting. I'm not exactly sure of the root cause of this issue. I'd try to list resources manually and see if this fixes the problem. If you have a long list of schema/admin modules, you could start an config :kaffy,
otp_app: :abc,
ecto_repo: Abc.Repo,
router: AbcWeb.Router,
resources: # Kaffy.Utils.full_resources/1 output goes here
Let me know if this helps. |
once I get this deployed and tested I will let you know |
Manually specifying the resources fixes it for now, so it's a work around, yay! 👏 |
This is interesting. If this is the case, the real fix is to somehow load the resources list as soon as the application starts. It's a bit tricky, but it needs to be fixed. |
I got permission to be able to contribute to bugfix this so, I might be able to tackle it later. On application start I could just trigger the initial load, or quite literally just trigger
|
I had a working system and then tried to install authentication using mix phx.gen.auth Accounts User users as per the phx.gen.auth documentaiton. Now Kaffy falls over with this same error and Kaffy.Utils.full_resources(nil) returns Adding an account to the system database fixes this problem. So it appears when the authentication database is empty there is some strange issues. So I think you can ignore this comment completely. |
Versions Used
Kaffy: 0.9.0
Phoenix: 1.5
Elixir: 1.10.3
What's actually happening?
When a string that isn't already an atom is tried to be converted it barfs.
Request: GET /admin/accounts/user/1
** (exit) an exception was raised:
** (ArgumentError) argument error
:erlang.binary_to_existing_atom("accounts", :utf8)
(kaffy 0.9.0) lib/kaffy/utils.ex:339: Kaffy.Utils.convert_to_atom/1
(kaffy 0.9.0) lib/kaffy/utils.ex:335: Kaffy.Utils.convert_to_atoms/2
(kaffy 0.9.0) lib/kaffy/utils.ex:194: Kaffy.Utils.get_resource/3
What should happen instead?
Maybe don't require it to be an existing atom?
The text was updated successfully, but these errors were encountered: