https://prefect.io logo
Title
u

Usman Abdulkareem Adedayo

06/10/2022, 8:46 AM
The error is simply sqlalchemy.exec.OperationalError: (sqlite3.OperationalError) table flow already exists
1
a

Anna Geller

06/10/2022, 11:38 AM
Since you didn't move the traceback, I will move the conversation here 😄 Question: Hello I am having an error after I uninstall prefect==2.0b5 and install the prefect==2.0b6 for Windows into my python virtual environment.. I got an error after deletion of the .prefect folder and installation of prefect==2.0b6 The log error is stated below: Traceback (most recent call last): File "C:\Users\Usman\Desktop\ml_zoomcamp\venv\lib\site-packages\sqlalchemy\engine\base.py", line 1819, in _execute_context self.dialect.do_execute( File "C:\Users\Usman\Desktop\ml_zoomcamp\venv\lib\site-packages\sqlalchemy\engine\default.py", line 732, in do_execute cursor.execute(statement, parameters) File "C:\Users\Usman\Desktop\ml_zoomcamp\venv\lib\site-packages\sqlalchemy\dialects\sqlite\aiosqlite.py", line 100, in execute self._adapt_connection._handle_exception(error) File "C:\Users\Usman\Desktop\ml_zoomcamp\venv\lib\site-packages\sqlalchemy\dialects\sqlite\aiosqlite.py", line 229, in _handle_exception raise error File "C:\Users\Usman\Desktop\ml_zoomcamp\venv\lib\site-packages\sqlalchemy\dialects\sqlite\aiosqlite.py", line 82, in execute self.await_(_cursor.execute(operation, parameters)) File "C:\Users\Usman\Desktop\ml_zoomcamp\venv\lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 68, in await_only return current.driver.switch(awaitable) File "C:\Users\Usman\Desktop\ml_zoomcamp\venv\lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 121, in greenlet_spawn value = await result File "C:\Users\Usman\Desktop\ml_zoomcamp\venv\lib\site-packages\aiosqlite\cursor.py", line 37, in execute await self._execute(self._cursor.execute, sql, parameters) File "C:\Users\Usman\Desktop\ml_zoomcamp\venv\lib\site-packages\aiosqlite\cursor.py", line 31, in _execute return await self._conn._execute(fn, *args, **kwargs) File "C:\Users\Usman\Desktop\ml_zoomcamp\venv\lib\site-packages\aiosqlite\core.py", line 129, in _execute return await future File "C:\Users\Usman\Desktop\ml_zoomcamp\venv\lib\site-packages\aiosqlite\core.py", line 102, in run result = function() sqlite3.OperationalError: table flow already exists sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) table flow already exists [SQL: CREATE TABLE flow ( id CHAR(36) DEFAULT ( ( lower(hex(randomblob(4))) || '-' || lower(hex(randomblob(2))) || '-4' || substr(lower(hex(randomblob(2))),2) || '-' || substr('89ab',abs(random()) % 4 + 1, 1) || substr(lower(hex(randomblob(2))),2) || '-' || lower(hex(randomblob(6))) ) ) NOT NULL, created DATETIME DEFAULT (strftime('%Y-%m-%d %H:%M:%f000', 'now')) NOT NULL, updated DATETIME DEFAULT (strftime('%Y-%m-%d %H:%M:%f000', 'now')) NOT NULL, name VARCHAR NOT NULL, tags JSON DEFAULT '[]' NOT NULL, CONSTRAINT pk_flow PRIMARY KEY (id), CONSTRAINT uq_flow__name UNIQUE (name) ) ] (Background on this error at: https://sqlalche.me/e/14/e3q8)
Response: can you delete also the orion.db database and then reinstall Orion?
@Usman Abdulkareem Adedayo LMK if this is still not resolved after deleting the DB file and reinstalling/restarting Orion - thanks and keep us posted!
u

Usman Abdulkareem Adedayo

06/10/2022, 11:41 AM
Thanks @Anna Geller I am sorry I will give you feedback when I get on to my PC .
How will I find the Orion database with the pip install prefect==2.0b6 I did
a

Anna Geller

06/10/2022, 11:43 AM
in ~/.prefect/orion.db
u

Usman Abdulkareem Adedayo

06/10/2022, 11:44 AM
Alright I will do so immediately I get my PC back to work I really appreciate Thanks
a

Anna Geller

06/10/2022, 11:45 AM
awesome, keep us posted on how it goes, and good luck with your Zoomcamp homework! 🙌
u

Usman Abdulkareem Adedayo

06/10/2022, 11:46 AM
Thanks @Anna Geller
f

flurven

06/10/2022, 12:09 PM
Seems like more people are getting this error. Is it possible to change to "create or replace table" in this script?
a

Anna Geller

06/10/2022, 12:12 PM
What do you mean? can you elaborate on it in a GitHub issue?
f

flurven

06/10/2022, 12:25 PM
When you start Orion the first time it creates all tables and indices needed. If that creation fails, next time you get these errors since it's trying to create the tables again. And as seen in the error message the statement used is "create table". Usually when setting things up with a script like this you use "create or replace table", so if the table exists when running the setup, it is dropped and recreated. I will try to formulate a more coherent issue in github 😁
a

Anna Geller

06/10/2022, 1:31 PM
That would be great if you could submit it as a GitHub issue. And thanks so much for your suggestion to improve this process for new users, super appreciated! 🙌
u

Usman Abdulkareem Adedayo

06/10/2022, 2:47 PM
@Anna Geller I solved the issue Thanks so much Grateful ❤️
🙌 1