learningequality / kolibri-instant-schools-plugin

4 stars 10 forks source link

StringDataRightTruncation: value too long for type character varying(20) #198

Closed sentry-io[bot] closed 1 year ago

sentry-io[bot] commented 1 year ago

Sentry Issue: KOLIBRI-BACKEND-2DD

DataError: value too long for type character varying(20)

(18 additional frame(s) were not displayed)
...
  File "django/db/models/sql/compiler.py", line 1112, in execute_sql
    cursor.execute(sql, params)
  File "django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)

StringDataRightTruncation: value too long for type character varying(20)

  File "django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
nucleogenesis commented 1 year ago

Giving this a look it seems that the issue was that the user put in too long a phone number. Seems the phone number input in the Reset Password flow needs to have a max character limit applied to avoid this error coming through.

The number given also seems like it might have been copy-pasted a couple too many times by mistake as it's a pattern -- or this is just errant traffic.

In any case, this doesn't appear to be impacting users too much as it will work for anybody using a proper phone number that they've successfully made an account with.

nucleogenesis commented 1 year ago

https://github.com/learningequality/kolibri-instant-schools-plugin/issues/201 will follow up on this