title: Mnesia doesn't recognize data after sys restart (no_exists error)
body: <p>I'm building an erlang app in a docker container.
  My data directory is connected as a docker volume.
  I'm using:
  <code>application:set_env(mnesia, schema_location, disc),</code>
  and <code>{disc_copies, Nodes}</code>.</p>
  
  <p>When I restart the app with:</p>
  
  <pre><code>docker-composer stop myapp &amp;&amp; docker-composer up myapp
  </code></pre>
  
  <p>all works fine but when I turn it off completely with:</p>
  
  <pre><code>sudo systemctl restart docker
  docker-composer up -d
  </code></pre>
  
  <p>Mnesia stops recognizing my data. The same is true when I restart my computer.</p>
  
  <p>Basically (after this "hard" restart) Mnesia starts normally but when I try to read anything from it, I get an error:</p>
  
  <pre><code>{running_method,getTasksByProjectId}
  terminate reason: {aborted,{no_exists,mtm_tasks}}
  terminate reason: {{aborted,{no_exists,mtm_tasks}},
                     {gen_server,call,
                         [{global,tasks_da_serv},
                          {get_tasks_by_project_id,
                              "j1xvqric-2oj2q784xieccowg8880"}]}}
  
  =ERROR REPORT==== 8-Jun-2017::10:29:04 ===
  ** Generic server tasks_da_serv terminating 
  ** Last message in was {get_tasks_by_project_id,
                             "j1xvqric-2oj2q784xieccowg8880"}
  ** When Server state == {tasks_da_state}
  ** Reason for termination == 
  ** {{aborted,{no_exists,mtm_tasks}},
      [{mnesia,wrap_trans,6,[{file,"mnesia.erl"},{line,404}]},
       {tasks_logic,get_tasks_by_project_id,1,
                    [{file,"/release/_build/default/lib/tasks/src/tasks_logic.erl"},
                     {line,70}]},
       {tasks_da_serv,handle_call,3,
                      [{file,"/release/_build/default/lib/tasks/src/tasks_da_serv.erl"},
                       {line,52}]},
       {gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,615}]},
       {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,647}]},
       {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
  Starting {global,tasks_da_serv} (&lt;0.492.0&gt;)
  Starting {global,tasks_manager_serv} (&lt;0.497.0&gt;)
  
  =ERROR REPORT==== 8-Jun-2017::10:29:04 ===
  ** Generic server tasks_manager_serv terminating 
  ** Last message in was {{'basic.deliver',
                              &lt;&lt;"amq.ctag-pt-OySikx5BShVLRASvIPw"&gt;&gt;,1,false,
                              &lt;&lt;&gt;&gt;,&lt;&lt;"tasks"&gt;&gt;},
                          {amqp_msg,
                              {'P_basic',undefined,undefined,[],undefined,
                                  undefined,undefined,undefined,undefined,
                                  undefined,undefined,undefined,undefined,
                                  undefined,undefined},
                              &lt;&lt;"{\"correlationId\":\"j3oa5b84-pcxn9ld6mswsck8kw48\",\"replyTo\":\"amq.gen-8h_kLqz4sHB-qjJ2cj8Y6w\",\"method\":\"getTasksByProjectId\",\"params\":{\"projectId\":\"j1xvqric-2oj2q784xieccowg8880\"}}"&gt;&gt;}}
  ** When Server state == {tasks_manager_state,&lt;0.481.0&gt;,&lt;0.490.0&gt;}
  ** Reason for termination == 
  ** {{{aborted,{no_exists,mtm_tasks}},
       {gen_server,call,
                   [{global,tasks_da_serv},
                    {get_tasks_by_project_id,"j1xvqric-2oj2q784xieccowg8880"}]}},
      [{gen_server,call,2,[{file,"gen_server.erl"},{line,204}]},
       {tasks_manager_logic,handle_message,2,
                            [{file,"/release/_build/default/lib/tasks/src/tasks_manager_logic.erl"},
                             {line,7}]},
       {tasks_manager_serv,handle_info,2,
                           [{file,"/release/_build/default/lib/tasks/src/tasks_manager_serv.erl"},
                            {line,45}]},
       {gen_server,try_dispatch,4,[{file,"gen_server.erl"},{line,601}]},
       {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,667}]},
       {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
  </code></pre>
  
  <p>At this point the only way to make it work again is to remove the data from the docker volume.</p>