I'm trying to create a deployment with `prefect de...
# prefect-community
s
I'm trying to create a deployment with
prefect deployment apply deployment.yaml
but I keep getting an error from sqlalchemy:
sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) FOREIGN KEY constraint failed
Copy code
[SQL: INSERT INTO deployment (id, created, updated, name, description, manifest_path, schedule, is_schedule_active, tags, parameters, parameter_openapi_schema, flow_id, infrastructure_document_id, storage_document_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ON CONFLICT (flow_id, name) DO UPDATE SET updated = ?, description = ?, schedule = ?, is_schedule_active = ?, tags = ?, parameters = ?, infrastructure_document_id = ?, storage_document_id = ?]
[parameters: ('b3d8da15-3862-427e-a0fe-8202c8d00cc7', '2022-08-04 12:25:31.531364', '2022-08-04 12:25:31.527068', 'my-deployment', None, 'flow-manifest.json', None, 1, '["test"]', '{"file_name": "files_20220530_20220609202029.tgz"}', '{"title": "Parameters", "type": "object", "properties": {"file_name": {"title": "file_name", "type": "string"}}}', '81e661c6-a0a8-4b86-a0c7-1fffba649eec', '95f1dd57-3c2a-4f6e-a163-3f296ce3a172', '498e3713-9844-48ba-bc91-94a28ce82b2f', '2022-08-04 12:25:31.527068', None, None, 1, '["test"]', '{"file_name": "_files_20220530_20220609202029.tgz"}', '95f1dd57-3c2a-4f6e-a163-3f296ce3a172', '498e3713-9844-48ba-bc91-94a28ce82b2f')]
k
I haven’t seen this error before. Can you try to start a new environment and run the
prefect deployment
command again to see if you still have an error?
s
I have tried
rm -rf ~/.prefect/orion.db
and
prefect orion database reset -y
, but still get the same error. Is there anything else I need to do to start a new environment?
k
Are you using a virtual environment?
s
Oh right, yes, I also restarted that!
k
did you create a new virtual environment and install Prefect again?