MathematicalMedicine / diver-issues

Semipublic tracking of issues for the DIVER front end
0 stars 0 forks source link

No check/warning for too-long fields #35

Closed WValenti closed 6 months ago

WValenti commented 2 years ago

A too-long result set name will cause the webapp to simply fail to save the resultSet.

Viqsi commented 2 years ago

Was there an error message displayed that Something Had Gone Wrong, at least?

Viqsi commented 1 year ago

We just ran into this during the demo, and yes, there was an error message, but it was opaque and generic. So that needs to be improved. (Richer error messages in general might be useful...)

Viqsi commented 1 year ago

MathematicalMedicine/diverweb@e779122 provides a means by which we can address this now, but diverRPC does not specifically report the source of the error as a length limit issue; it just shows up as a generic Internal Server Error:

image

The information is present in the traceback, though...

Traceback (most recent call last):
  File "/home/jvc/mambaforge/lib/python3.10/site-packages/flask/app.py", line 2548, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/jvc/mambaforge/lib/python3.10/site-packages/flask/app.py", line 2528, in wsgi_app
    response = self.handle_exception(e)
  File "/home/jvc/mambaforge/lib/python3.10/site-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/jvc/mambaforge/lib/python3.10/site-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/jvc/mambaforge/lib/python3.10/site-packages/flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/jvc/mambaforge/lib/python3.10/site-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/jvc/mambaforge/lib/python3.10/site-packages/flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/jvc/mambaforge/lib/python3.10/site-packages/flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/home/jvc/diverRPC/diverRPC.py", line 955, in route_new_cohort
    return _new_or_preview_cohort_baseapi(isnewcohort=True)
  File "/home/jvc/diverRPC/diverRPC.py", line 1020, in _new_or_preview_cohort_baseapi
    return flask.jsonify(_new_or_preview_cohort(user, projid, name, desc,
  File "/home/jvc/diverRPC/diverRPC.py", line 438, in _new_or_preview_cohort
    procresult = proccall_errcheck(cursor,
  File "/home/jvc/diverRPC/diverRPC.py", line 201, in proccall_errcheck
    cursor.callproc(proc, procargs)
  File "/home/jvc/mambaforge/lib/python3.10/site-packages/pymysql/cursors.py", line 258, in callproc
    self._query(q)
  File "/home/jvc/mambaforge/lib/python3.10/site-packages/pymysql/cursors.py", line 310, in _query
    conn.query(q)
  File "/home/jvc/mambaforge/lib/python3.10/site-packages/pymysql/connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/home/jvc/mambaforge/lib/python3.10/site-packages/pymysql/connections.py", line 775, in _read_query_result
    result.read()
  File "/home/jvc/mambaforge/lib/python3.10/site-packages/pymysql/connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "/home/jvc/mambaforge/lib/python3.10/site-packages/pymysql/connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "/home/jvc/mambaforge/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/home/jvc/mambaforge/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.DataError: (1406, "Data too long for column 'inNewName' at row 1")

So pulling that message might be a possible fix for this and similar cases.

Viqsi commented 6 months ago

This is being taken care of as part of the fix to #195.