https://prefect.io logo
#prefect-community
Title
# prefect-community
s

Shruti Hande

11/04/2022, 9:45 AM
Getting this error while execution of flow sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file Also when i changed backend database to postgres this error comes up: sqlalchemy.exc.ProgrammingError: (sqlalchemy.dialects.postgresql.asyncpg.ProgrammingError) <class 'asyncpg.exceptions.Unde finedFunctionError'>: function gen_random_uuid() does not exist HINT: No function matches the given name and argument types. You might need to add explicit type casts.
a

Anna Geller

11/04/2022, 11:48 AM
it looks like a DB migration issue, can you remove the SQLite DB?
Copy code
rm ~/.prefect/orion.db
prefect orion start
when moving to Postgres you would like need to use:
Copy code
prefect orion database reset -y
s

Shruti Hande

11/04/2022, 12:48 PM
Thanks for this @Anna Geller. But i have reset the database to postgres but there's another issue with this. sqlalchemy.exc.ProgrammingError: (sqlalchemy.dialects.postgresql.asyncpg.ProgrammingError) <class 'asyncpg.exceptions.UndefinedFunctionError'>: function gen_random_uuid() does not exist HINT: No function matches the given name and argument types. You might need to add explicit type casts. [SQL: CREATE TABLE flow ( id UUID DEFAULT (GEN_RANDOM_UUID()) NOT NULL, created TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL, updated TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL, name VARCHAR NOT NULL, tags JSONB DEFAULT '[]' NOT NULL, CONSTRAINT pk_flow PRIMARY KEY (id), CONSTRAINT uq_flow__name UNIQUE (name) )
a

Anna Geller

11/04/2022, 3:40 PM
is your Postgres version >= 13?
s

Shruti Hande

11/07/2022, 4:49 AM
No, psql (PostgreSQL) 12.12
a

Anna Geller

11/07/2022, 3:37 PM
That's the reason, we only support 13 and higher
s

Shruti Hande

11/08/2022, 8:50 AM
Upgraded psql to 15.0 , still getting same error.
j

Jarvis Stubblefield

11/08/2022, 7:15 PM
Did you run this bit after the upgrade to psql 15?
prefect orion database reset -y
โ€ฆ Have you gotten this to work yet?
๐Ÿ’ฏ 1
a

Anna Geller

11/08/2022, 11:35 PM
The migration should start automatically when you start Orion. Can you try PostgreSQL 14 or 13? 15 is very new
s

Shruti Hande

11/09/2022, 8:56 AM
Upgraded psql to 13.8 , also executed this command prefect orion database reset -y, getting different error now asyncio.exceptions.TimeoutError @Anna Geller @Jarvis Stubblefield
j

Jarvis Stubblefield

11/09/2022, 9:05 AM
Can you post the full error output? You can use the
code
button in the text editor to help display your error more easily. This button:
</>
is for a short code snippet (one liner), and the one to the right is for a block of text. Use the one for the block of text for the error output.
gratitude thank you 1
Also, can you post any details about your flow or the
code
along with the error?
a

Anna Geller

11/09/2022, 12:47 PM
@Shruti Hande I strongly encourage you to Prefect Cloud - there is a free tier, no credit card required, and this will get you started immediately you can always decide to self-host later after the initial exploration
๐Ÿ‘ 1
j

Jarvis Stubblefield

11/09/2022, 10:15 PM
I initially was trying to do it all myself, and Iโ€™m happy that I decided to just use Prefect Cloud so I could ramp up fasterโ€ฆ
๐Ÿ™Œ 1
๐Ÿ‘ 1
s

Shruti Hande

11/15/2022, 6:56 AM
@Anna Geller @Jarvis Stubblefield Thank you for your response it was quite helpful. ๐Ÿ™‚๐Ÿ™Œ Have deployed the flows on prefect cloud .
๐Ÿ™Œ 2
๐Ÿ’ฏ 2
4 Views