# MedCATTrainer docker-compose sqlite3.OperationalError no such table error

**URL:** <https://discourse.cogstack.org/t/medcattrainer-docker-compose-sqlite3-operationalerror-no-such-table-error/244>\
**Category:** CogStack\
**Created:** [November 7, 2023, 12:27pm UTC](https://discourse.cogstack.org/t/medcattrainer-docker-compose-sqlite3-operationalerror-no-such-table-error/244 "2023-11-07T12:27:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tapak](https://avatars.discourse-cdn.com/v4/letter/t/f19dbf/32.png) [@tapak](https://discourse.cogstack.org/u/tapak)\
**Post date:** [November 7, 2023, 12:27pm UTC](https://discourse.cogstack.org/t/medcattrainer-docker-compose-sqlite3-operationalerror-no-such-table-error/244/1 "2023-11-07T12:27:27Z")

</div>

Hello,

I’m currently in the process of installing MedCATTrainer v2.12.3 via Dockerhub. While running `docker-compose up`, I encountered an `sqlite3.OperationalError`. The issue seems to be related to the `RESUBMIT_ALL_ON_STARTUP` environment variable, which is set to `1` by default in the env file. The problem appears to be resolved when I set this variable to `0`. However, as a relative newcomer to Docker, I’m unsure if this is a safe change. Should I keep it as `0` and look into modifying it later, or are there alternative solutions to address this issue?

log message for reference:

medcattrainer | INFO 2023-11-07 12:06:32,072 apps.py l:17:Found env var RESUBMIT\_ALL\_ON\_STARTUP is True. Attempting to resubmit all currently submitted state documents  
medcattrainer | Traceback (most recent call last):  
medcattrainer | File “/usr/local/lib/python3.11/site-packages/django/db/backends/utils.py”, line 84, in \_execute  
medcattrainer | return self.cursor.execute(sql, params)  
medcattrainer | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
medcattrainer | File “/usr/local/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py”, line 383, in execute  
medcattrainer | return Database.Cursor.execute(self, query, params)  
medcattrainer | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
medcattrainer | sqlite3.OperationalError: no such table: api\_projectannotateentities

Thanks for the assistance

---

<div class="post-metadata">

**Author:** ![mart.ratas](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@mart.ratas](https://discourse.cogstack.org/u/mart.ratas)\
**Post date:** [November 8, 2023, 9:40am UTC](https://discourse.cogstack.org/t/medcattrainer-docker-compose-sqlite3-operationalerror-no-such-table-error/244/2 "2023-11-08T09:40:13Z")

</div>

I’ll prefix this with the fact that I’m not intimately familiar with entire codebase.

However, as far as I know, the `RESUBMIT_ALL_ON_STARTUP` environmental variable is only really applicable for existing deployments of the trainer. The idea is to re-submit all the documents that have been annotated when the service starts up.

As such, turning it off (to `0`) should not really have any adverse effects. Especially on a first time run. The only thing that should change is that the user would need to manually re-submit the annotated documents if they wish to do so.

With that said, by the sound of it, you should be able to change this back to `1` after you’ve initially run the container since that _should_ ensure that the table already exists.  
Though you may need to define some projects or even annotate a document to make sure the table exists.

But again, take this as a word of guidance from someone with tangential knowledge of this piece of software.

---

<div class="post-metadata">

**Author:** ![tapak](https://avatars.discourse-cdn.com/v4/letter/t/f19dbf/32.png) [@tapak](https://discourse.cogstack.org/u/tapak)\
**Post date:** [November 8, 2023, 3:35pm UTC](https://discourse.cogstack.org/t/medcattrainer-docker-compose-sqlite3-operationalerror-no-such-table-error/244/3 "2023-11-08T15:35:47Z")

</div>

Thank you very much!  
I’ll turn it off for now and change it back after annotation of the first document.

---

<div class="post-metadata">

**Author:** ![tomolopolis](https://avatars.discourse-cdn.com/v4/letter/t/6de8d8/32.png) [@tomolopolis](https://discourse.cogstack.org/u/tomolopolis)\
**Post date:** [November 21, 2023, 1:48pm UTC](https://discourse.cogstack.org/t/medcattrainer-docker-compose-sqlite3-operationalerror-no-such-table-error/244/4 "2023-11-21T13:48:31Z")

</div>

hi @tapak - yes - this is safe to remove on initial startup, I’ll fix this in the next release.
