-
Notifications
You must be signed in to change notification settings - Fork 30
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
ArgumentError :erlang.binary_to_existing_atom/2 #26
Comments
Hey there, thank you for using the package and for reporting this. How many BEAM notes are you running? I wonder to what extent this could be caused by the GET request landing on a cold node that has never loaded the flag in memory before (that's what creates the flag-name atom for the first time). |
Hello @tompave! Thanks for the answer. It happened while having 3 nodes. |
I see. Then that happens because your The reason I'm hesitant to replace |
Oh, I got it. I'll try to provide force early visiting of |
It's still not a great solution though. Even if just a few nodes, refreshing This is not normally a problem when the flag is actually checked by the application at runtime (outside Perhaps the right solution is to wrap that |
Ok, I've just realized that I had already solved this problem ages ago. That flag lookup is wrapped with fun_with_flags_ui/lib/fun_with_flags/ui/utils.ex Lines 75 to 77 in caca4f7
Which basically does what I described above: fun_with_flags_ui/lib/fun_with_flags/ui/utils.ex Lines 151 to 158 in caca4f7
I'm not sure why you're getting that error then. |
Your stacktrace:
Ok, so that's happening on different endpoints, not on The line numbers don't perfectly align. What version of FWF.UI are you using? |
Hmm, as I see in my mix.lock: |
Ok, it might be an effect of the Plug macros. Anyway, I can see what's happening here. The fix would be to make the other endpoints safe the same way that GET is. |
We encountered this issue when trying to clean up after a feature flag that we removed from our code, so its atom name was no longer referenced/created anywhere. |
While trying to work with
FunWithFlagsUI
(especially with any new flag) from time to time we get such weird error:I think it comes from there:
https://github.com/tompave/fun_with_flags_ui/blob/master/lib/fun_with_flags/ui/router.ex
https://github.com/tompave/fun_with_flags_ui/blob/master/lib/fun_with_flags/ui/utils.ex
Maybe it's worth to replace
String.to_existing_atom
withString.to_atom
to avoid the issue, what do you think?The text was updated successfully, but these errors were encountered: