Ticket #1290 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

Better error when blank database

Reported by: dread Owned by: dread
Priority: minor Milestone: ckan-backlog
Component: ckan Keywords:
Cc: kindly Repository: ckan
Theme: none

Description (last modified by dread) (diff)

When installing CKAN, when doing "paster serve development.ini", lots of users encounter the error for every request:

ProgrammingError: (ProgrammingError) relation "user" does not exist

This is because the database tables have not been created - they have forgotten or missed the "paster db init" step.

Can we provide a better error to say that the database is not initialised yet?

Implementation options

  1. At the start of every request we reflect the database tables and check they are there. This is rather expensive!
  1. Uncached requests to the home page start with a cheap database query. If there is an exception then return this error about database setup. I really like Drupal's page for this that has in large letters that the site is currently off-line. Below a line, in small letters, there are developer suggestions on what is wrong and where to look to fix it.

Change History

comment:1 Changed 3 years ago by dread

  • Description modified (diff)

comment:2 Changed 3 years ago by dread

  • Status changed from new to closed
  • Resolution set to fixed

Improved on option 2. For requests to Home controller, the first thing it does is check the user. I catch SQL errors that are to do with missing tables and that now produces a template-less error saying the site is off-line and then mentions database initialisation.

Done in cset:484e50c4f989 on default for ckan 1.4.4.

Note: See TracTickets for help on using tickets.