harvard-lil / h2o

H2O is a web app for creating and reading open educational resources, primarily in the legal field
https://opencasebook.org
GNU Affero General Public License v3.0
35 stars 30 forks source link

IntegrityError: null value in column "title" violates not-null constraint #2005

Closed sentry-io[bot] closed 1 year ago

sentry-io[bot] commented 1 year ago

Sentry Issue: H2O-B9

NotNullViolation: null value in column "title" violates not-null constraint
DETAIL:  Failing row contains (1304720, null, null, f, null, {1,10,1}, null, Link, 425425, 2023-04-20 14:54:04.234511, 2023-04-20 14:54:04.234515, null, null, {}, 8847, null, {}, t, null, f).

  File "django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)

IntegrityError: null value in column "title" violates not-null constraint
DETAIL:  Failing row contains (1304720, null, null, f, null, {1,10,1}, null, Link, 425425, 2023-04-20 14:54:04.234511, 2023-04-20 14:54:04.234515, null, null, {}, 8847, null, {}, t, null, f).

(15 additional frame(s) were not displayed)
...
  File "django/db/backends/utils.py", line 66, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "django/db/backends/utils.py", line 75, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "django/db/utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
lizadaly commented 1 year ago

Steps to reproduce:

Paste a URL as part of a case outline into the Quick Add.

The new_from_outline code tries to extract a title from the HTML of the page, but it fails (and returns None) if the page manages to have a <title> element with no text content.

Culprit in this case was Hollis!

<title id="primoExploreTitle"></title>