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

Regression for interactive points entry #155

Open
christian-heusel opened this issue Jan 19, 2022 · 7 comments
Open

Regression for interactive points entry #155

christian-heusel opened this issue Jan 19, 2022 · 7 comments

Comments

@christian-heusel
Copy link
Collaborator

Problem

Once I entered points for my last tutorial the following two errors occured:

  1. There was a red error message "Fehler: Konnte Punkte nicht speichern"
  2. Names are inserted two times

The Error probably is due to the changed implementation of the jQuery stuff from #106 ... 🤔

Screenshots

The screenshots are from another tutor (Thanks Tom S. 🎉 💻)!
Regarding 1):
0
Regarding 2);
1

@tynsh
Copy link
Contributor

tynsh commented Jan 27, 2022

Okay. So part of the problem was that the exercise points were create twice instead of being modified. That's fixed now and will be deployed soon. Would you be able to test it again tomorrow?

@christian-heusel
Copy link
Collaborator Author

I can of course test it again very soon, if it is not fixed then I can also just reopen this issue 😊

@christian-heusel
Copy link
Collaborator Author

Also I notified the Tutor I initially got the screenshots from, I guess he could also report whether this problem persists.

@tynsh
Copy link
Contributor

tynsh commented Jan 28, 2022

Okay. So there are still exceptions in the logs. There is an other attempted fix in the testing pipeline.

@christian-heusel
Copy link
Collaborator Author

Did this other attempt yield any results so far? Couldnt it just be a clientsided problem with the jQuery? TBH, I didnt look at the code yet!

@tynsh
Copy link
Contributor

tynsh commented Feb 8, 2022

There are still exceptions being thrown, but less
So it's definitely a server-side issue and the client handles this correctly (except for the double entry). So no further results so far. Here is an exception:

sqlalchemy.exc.IntegrityError: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely)
(psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "exercise_students_pkey"
DETAIL: Key (exercise, student)=(xxx, xxx) already exists.

xxx and xxx are numbers

@tynsh
Copy link
Contributor

tynsh commented Feb 8, 2022

Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/pyramid/tweens.py", line 41, in excview_tween
response = handler(request)
File "/usr/local/lib/python3.9/dist-packages/pyramid/router.py", line 143, in handle_request
response = _call_view(
File "/usr/local/lib/python3.9/dist-packages/pyramid/view.py", line 674, in _call_view
response = view_callable(context, request)
File "/usr/local/lib/python3.9/dist-packages/pyramid/viewderivers.py", line 319, in secured_view
return view(context, request)
File "/usr/local/lib/python3.9/dist-packages/pyramid/viewderivers.py", line 427, in rendered_view
result = view(context, request)
File "/usr/local/lib/python3.9/dist-packages/pyramid/viewderivers.py", line 141, in _requestonly_view
response = view(request)
File "./muesli/web/viewsExam.py", line 680, in ajaxSavePoints
student = lecture_students.filter(models.LectureStudent.student_id == student_id).one().student
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/orm/query.py", line 2856, in one
return self._iter().one()
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/orm/query.py", line 2894, in _iter
result = self.session.execute(
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/orm/session.py", line 1640, in execute
) = compile_state_cls.orm_pre_session_exec(
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/orm/context.py", line 318, in orm_pre_session_exec
session.autoflush()
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/orm/session.py", line 2237, in autoflush
util.raise
(e, with_traceback=sys.exc_info()[2])
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/util/compat.py", line 207, in raise

raise exception
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/orm/session.py", line 2226, in _autoflush
self.flush()
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/orm/session.py", line 3363, in flush
self._flush(objects)
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/orm/session.py", line 3503, in flush
transaction.rollback(capture_exception=True)
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/util/langhelpers.py", line 70, in exit
compat.raise
(
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/util/compat.py", line 207, in raise

raise exception
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/orm/session.py", line 3463, in _flush
flush_context.execute()
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/orm/unitofwork.py", line 456, in execute
rec.execute(self)
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/orm/unitofwork.py", line 630, in execute
util.preloaded.orm_persistence.save_obj(
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/orm/persistence.py", line 244, in save_obj
_emit_insert_statements(
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/orm/persistence.py", line 1096, in _emit_insert_statements
c = connection._execute_20(
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/base.py", line 1614, in _execute_20
return meth(self, args_10style, kwargs_10style, execution_options)
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/sql/elements.py", line 325, in _execute_on_connection
return connection._execute_clauseelement(
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/base.py", line 1481, in _execute_clauseelement
ret = self._execute_context(
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/base.py", line 1845, in _execute_context
self.handle_dbapi_exception(
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/base.py", line 2026, in handle_dbapi_exception
util.raise
(
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/util/compat.py", line 207, in raise

raise exception
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/base.py", line 1802, in _execute_context
self.dialect.do_execute(
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/default.py", line 732, in do_execute
cursor.execute(statement, parameters)

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

2 participants