Traceback most recent call last File home arch src fp-web venv lib pyt

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Traceback (most recent call last):
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1249, in _execute_context
cursor, statement, parameters, context
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 552, in do_execute
cursor.execute(statement, parameters)
psycopg2.errors.InvalidForeignKey: there is no unique constraint matching given keys for referenced table "webartifacts"
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/arch/src/fp-web/venv/bin/pserve", line 11, in <module>
load_entry_point('pyramid==1.9.4', 'console_scripts', 'pserve')()
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/pyramid/scripts/pserve.py", line 32, in main
return command.run()
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/pyramid/scripts/pserve.py", line 233, in run
app = loader.get_wsgi_app(app_name, config_vars)
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/plaster_pastedeploy/__init__.py", line 131, in get_wsgi_app
global_conf=defaults)
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
return loadobj(APP, uri, name=name, **kw)
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
return context.create()
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create
return self.object_type.invoke(self)
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
return fix_call(context.object, context.global_conf, **context.local_conf)
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/paste/deploy/util.py", line 55, in fix_call
val = callable(*args, **kw)
File "/home/arch/src/fp-web/app/application.py", line 90, in main
create_db(settings["general"]["pgdatabase"])
File "/home/arch/src/fp-web/app/application.py", line 50, in create_db
pg_database.create_all()
File "/home/arch/src/fp-web/common/pgdatabase.py", line 64, in create_all
model.metadata.create_all(self._engine)
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/sqlalchemy/sql/schema.py", line 4294, in create_all
ddl.SchemaGenerator, self, checkfirst=checkfirst, tables=tables
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2046, in _run_visitor
conn._run_visitor(visitorcallable, element, **kwargs)
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1615, in _run_visitor
visitorcallable(self.dialect, self, **kwargs).traverse_single(element)
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/sqlalchemy/sql/visitors.py", line 132, in traverse_single
return meth(obj, **kw)
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py", line 781, in visit_metadata
_is_metadata_operation=True,
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/sqlalchemy/sql/visitors.py", line 132, in traverse_single
return meth(obj, **kw)
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py", line 826, in visit_table
include_foreign_key_constraints,
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 988, in execute
return meth(self, multiparams, params)
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py", line 72, in _execute_on_connection
return connection._execute_ddl(self, multiparams, params)
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1050, in _execute_ddl
compiled,
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1253, in _execute_context
e, statement, parameters, cursor, context
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1473, in _handle_dbapi_exception
util.raise_from_cause(sqlalchemy_exception, exc_info)
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 398, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 152, in reraise
raise value.with_traceback(tb)
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1249, in _execute_context
cursor, statement, parameters, context
File "/home/arch/src/fp-web/venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 552, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.InvalidForeignKey) there is no unique constraint matching given keys for referenced table "webartifacts"
[SQL:
CREATE TABLE webartifacts (
id VARCHAR(40) NOT NULL,
name TEXT NOT NULL,
parent_name TEXT,
type VARCHAR(25),
description VARCHAR(255),
data TEXT,
PRIMARY KEY (id),
FOREIGN KEY(parent_name) REFERENCES webartifacts (name)
)
]