That error isn’t super helpful but there’s a good chance you’re hitting a permissions problem. The Elixir process might not have permissions to write to /mnesia.
Hey, glad to hear you resolved the issue! Can you share what you did to fix the problem? It may help other developers in the future. Thanks in advance!
Sorry, kind of missed notifications on this thread. I thought I managed to fix it at some point, but then errors appear again after redeploy. I eventually gave it up, and we switched from Pow to a custom auth solution that does not require Mnesia. So, unfortunately - no solution
I just went ahead and cd-ed into mnesia and ran chown nobody ./* and that may have fixed it. This is definitely weird since AFAICT the files in mnesia can’t be created until the Pow store is initialized, and that process fails unless the files are given the proper permissions. Don’t have much confidence that this build process won’t fail again in the future.
It no longer seems to be working, which was as I expected.
As I alluded to before, when the app first initializes mnesia it appears to create a few files that don’t inherit the permissions of the parent directory. Of course, I then won’t have any active instances of my server running to be able to manually SSH in and fix the permissions myself unless I redeploy with a change that removes Pow.Store.Backend.MnesiaCache from my application’s start.
Here are the files created:
drwxr-xr-x 3 nobody nogroup 4096 Mar 1 16:20 .
drwxr-xr-x 24 root root 4096 Mar 1 16:20 ..
-rw-r--r-- 1 nobody nogroup 153 Mar 1 16:20 DECISION_TAB.LOG
-rw-r--r-- 1 nobody nogroup 8 Nov 18 16:24 Elixir.Pow.Store.Backend.MnesiaCache.DCD
-rw-r--r-- 1 nobody nogroup 92 Mar 1 16:20 LATEST.LOG
drwx------ 2 nobody root 16384 Nov 18 16:24 lost+found
-rw-r--r-- 1 nobody nogroup 9412 Nov 18 16:24 schema.DAT
I can’t even replicate the fix that I had suggested above. It’s totally broken with the same error as the original poster and no change I make seems to affect it at all.
@jstiebs More interesting discoveries. I blew away the volume and recreated it and everything seemed to work just fine. However, I then restarted my app and the error has returned. I’m not sure why this would be the case, but may help us narrow down the cause of the problem.
I put together a minimal test case that would exercise the mnesia code erroring here GitHub - jeregrine/perm_error and I also cannot reproduce the error seen here.