<div dir="ltr">Hi all,<div><br></div><div>I recently converted an existing application to a release using relx. After that the application isn't able to create any Mnesia tables. I can't reproduce the problem in the Erlang shell (except by creating the table before creating the schema). This is confusing because the app code creates the schema prior to creating the table.</div><div><br></div><div>Here is the error:</div><div><div>12:20:18.929 [info] Creating a new schema from scratch...</div><div>12:20:18.929 [info] Mnesia started, creating tables...</div><div>12:20:18.929 [info] Attempting to create table with TableDef {pe_properties,{disc_copies,[{attributes,[key,value]},{record_name,pe_kvpair}]}}</div><div>12:20:18.931 [error] gen_server pe_membership terminated with reason: bad return value: {error,{unable_to_init_schema,{aborted,{bad_type,pe_properties,disc_copies,'<a href="mailto:prospero@subpubone.ecollege-dev.com">prospero@subpubone.ecollege-dev.com</a>'}}}}</div></div><div><br></div><div><br></div><div>Here's the associated application code:<br></div><div>
<p class=""> error_logger:info_msg("Creating a new schema from scratch...~n"),</p><p class=""> %% TODO: TEMP WORKAROUND TO DEBUG MNESIA SCHEMA CREATION PROBLEM</p><p class=""> application:set_env(mnesia, dir, "/var/data/prospero"),</p><p class=""> mnesia:create_schema([node()]),</p><p class=""> mnesia:start(),</p><p class=""> error_logger:info_msg("Mnesia started, creating tables...", []),</p><p class=""> case create_tables(pe_migrate:get_schema()) of</p><p class=""><br></p><p class="">The line application:set_env(...) was added in case the Mnesia directory wasn't getting created properly due to the move to a relx-built release. I had a similar entry in vm.args that I may have gotten wrong (-mnesia dir '"/var/data/prospero"'). Interestingly enough, I don't see any artifacts associated with the schema creation in the Mnesia dir (e.g., schema.DAT). I'm wondering if this is a clue as to what the cause is.</p><p class="">pe_migrate:get_schema()) returns a list of TableDefs. create_tables iterates through that list creating the tables one at a time. The failure occurs when attempting to create the first table.<br></p><p class="">Thanks, Rich</p></div></div>