oTree Forum >

oTree has been updated. Please delete your database (db.sqlite3)

#1 by Trontatuma

Since I updated Otree to the last version, it keeps on telling me this? Even after resetting or deleting the database. Anybody else has this problem?

#2 by Trontatuma

One has to do what otree says to do --> go in the project folder and delete the file "db.sqlite3".

#3 by ClemHerm

Hello, 
I encountered the same problem. After I deleted db.sqlite3, I get the following error message: sqlite3.OperationalError: unable to open database file

Does anyone know how to fix it? Thanks

#4 by Chris_oTree

Can you run "ls" in your terminal to list the files, showing that db.sqlite3 is gone, then run the command that gives you that error you mentioned, and paste here the full output of both commands.

#5 by ClemHerm

Hello Chris,

Thanks for your help!
Here are the output for both commands.


    Directory: C:\Users\clement\interface_draft


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         2/28/2024  11:21 AM                .idea
d-----         2/28/2024  11:21 AM                end_payment
d-----         2/28/2024  11:21 AM                intro_consent
d-----         2/28/2024  11:21 AM                pandora_3_NR
d-----         2/28/2024  11:21 AM                pandora_3_R
d-----         2/28/2024  11:21 AM                risky_proj
d-----         2/28/2024  11:21 AM                venv
d-----         2/28/2024  11:21 AM                _rooms
d-----         2/28/2024  11:22 AM                _static
d-----         2/28/2024  11:22 AM                _templates
d-----         2/28/2024  11:22 AM                __pycache__
-a----         2/28/2024   9:13 AM          12292 .DS_Store
-a----         11/3/2023   9:33 AM            131 .gitignore
-a----         2/28/2024   9:50 AM          35750 combination_packs_lab.csv
-a----         2/13/2024   9:34 AM         293360 combination_packs_online.csv
-a----         2/26/2024   2:16 PM         279574 fake_data_instructions.csv
-a----        12/28/2023   5:01 AM         254261 final_sample_boxes.csv
-a----         2/28/2024   8:42 AM         379277 interface_draft.otreezip
-a----         11/3/2023   9:33 AM           1573 LICENSE
-a----         2/28/2024   9:48 AM           6757 pack_used.csv
-a----         2/28/2024  10:38 AM            502 pack_used_lab.csv
-a----         11/3/2023   9:33 AM             55 Procfile
-a----         2/11/2024   5:40 PM            117 requirements.txt
-a----         2/28/2024  11:22 AM           1890 settings.py

Traceback (most recent call last):
  File "C:\Users\experimenter\AppData\Local\Programs\Python\Python310\Scripts\otree-script.py", line 33, in <module>
    sys.exit(load_entry_point('otree==5.9.3', 'console_scripts', 'otree')())
  File "C:\Users\experimenter\AppData\Local\Programs\Python\Python310\lib\site-packages\otree\main.py", line 106, in execute_from_command_line
    setup()
  File "C:\Users\experimenter\AppData\Local\Programs\Python\Python310\lib\site-packages\otree\main.py", line 134, in setup
    from otree.database import init_orm  # noqa
  File "C:\Users\experimenter\AppData\Local\Programs\Python\Python310\lib\site-packages\otree\database.py", line 78, in <module>
    sqlite_disk_conn = get_disk_conn()
  File "C:\Users\experimenter\AppData\Local\Programs\Python\Python310\lib\site-packages\otree\database.py", line 44, in get_disk_conn
    return sqlite3.connect(DB_FILE, check_same_thread=False)
sqlite3.OperationalError: unable to open database file

#6 by Chris_oTree

What command did you run?

#7 by ClemHerm

Oh sorry ! I ran otree devserver

#8 by Chris_oTree

I guess for some reason your sqlite is not able to create a file there. Try Googling the error (sqlite unable to open database file). That lists some possibilities, it might be that you don't have write permission to that folder, your disk is full, etc....

#9 by ClemHerm

Thanks Chris! I figured out I was on an admin folder that wouldn't let me create a sql file.

Write a reply

Set forum username