Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing key in table 'project' #2036

Open
kod-kristoff opened this issue Aug 24, 2021 · 0 comments
Open

Missing key in table 'project' #2036

kod-kristoff opened this issue Aug 24, 2021 · 0 comments

Comments

@kod-kristoff
Copy link
Contributor

Hi!

I noticed that the key project_id is missing in the table project.

I installed pybossa from master branch from current master (fd87953), and ran python cli.py db_create according to docs.

Exception:

Traceback (most recent call last):
 File "/home/fkpybossa/pybossa/pybossa/repositories/task_repository.py", line 103, in save
   self.db.session.commit()
 File "<string>", line 2, in commit
 File "/home/fkpybossa/pybossa/.venv/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 1428, in commit
   self._transaction.commit(_to_root=self.future)
 File "/home/fkpybossa/pybossa/.venv/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 829, in commit
   self._prepare_impl()
 File "/home/fkpybossa/pybossa/.venv/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 808, in _prepare_impl
   self.session.flush()
 File "/home/fkpybossa/pybossa/.venv/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 3262, in flush
   self._flush(objects)
 File "/home/fkpybossa/pybossa/.venv/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 3402, in _flush
   transaction.rollback(_capture_exception=True)
 File "/home/fkpybossa/pybossa/.venv/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
   compat.raise_(
 File "/home/fkpybossa/pybossa/.venv/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 211, in raise_
   raise exception
 File "/home/fkpybossa/pybossa/.venv/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 3362, in _flush
   flush_context.execute()
 File "/home/fkpybossa/pybossa/.venv/lib/python3.8/site-packages/sqlalchemy/orm/unitofwork.py", line 455, in execute
   rec.execute(self)
 File "/home/fkpybossa/pybossa/.venv/lib/python3.8/site-packages/sqlalchemy/orm/unitofwork.py", line 629, in execute
   util.preloaded.orm_persistence.save_obj(
 File "/home/fkpybossa/pybossa/.venv/lib/python3.8/site-packages/sqlalchemy/orm/persistence.py", line 242, in save_obj
   _emit_insert_statements(
 File "/home/fkpybossa/pybossa/.venv/lib/python3.8/site-packages/sqlalchemy/orm/persistence.py", line 1219, in _emit_insert_statements
   result = connection._execute_20(
 File "/home/fkpybossa/pybossa/.venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1582, in _execute_20
   return meth(self, args_10style, kwargs_10style, execution_options)
 File "/home/fkpybossa/pybossa/.venv/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 329, in _execute_on_connection
   return connection._execute_clauseelement(
 File "/home/fkpybossa/pybossa/.venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1451, in _execute_clauseelement
   ret = self._execute_context(
 File "/home/fkpybossa/pybossa/.venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1813, in _execute_context
   self._handle_dbapi_exception(
 File "/home/fkpybossa/pybossa/.venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1994, in _handle_dbapi_exception
   util.raise_(
 File "/home/fkpybossa/pybossa/.venv/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 211, in raise_
   raise exception
 File "/home/fkpybossa/pybossa/.venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1770, in _execute_context
   self.dialect.do_execute(
 File "/home/fkpybossa/pybossa/.venv/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 717, in do_execute
   cursor.execute(statement, parameters)
sqlalchemy.exc.IntegrityError: (psycopg2.errors.ForeignKeyViolation) FEL:  insert eller update på tabell "task" bryter mot främmande nyckel-villkoret "task_project_id_fkey"
DETAIL:  Nyckel (project_id)=(4) finns inte i tabellen "project".

[SQL: INSERT INTO task (created, project_id, state, quorum, calibration, priority_0, info, n_answers, fav_user_ids) VALUES (%(created)s, %(project_id)s, %(state)s, %(quorum)s, %(calibration)s, %(priority_0)s, %(info)s, %(n_answers)s, %(fav_user_ids)s::INTEGER[]) RETURNING task.id]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant