2

I have followed the CKAN install guide from source (http://docs.ckan.org/en/latest/maintaining/installing/install-from-source.html) and managed to get all the way until point 6. Create database tables.

At that stage, running paster db init -c /etc/ckan/default/development.ini gives the following stack trace:

Traceback (most recent call last): File "/usr/lib/ckan/default/bin/paster", line 9, in <module> load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')() File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py", line 104, in run invoke(command, command_name, options, args[1:]) File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py", line 143, in invoke exit_code = runner.run(args) File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py", line 238, in run result = self.command() File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 208, in command self._load_config(cmd!='upgrade') File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 164, in _load_config self.site_user = logic.get_action('get_site_user')({'ignore_auth': True}, {}) File "/usr/lib/ckan/default/src/ckan/ckan/logic/__init__.py", line 424, in wrapped result = _action(context, data_dict, **kw) File "/usr/lib/ckan/default/src/ckan/ckan/logic/action/get.py", line 2209, in get_site_user user = model.User.get(site_id) File "/usr/lib/ckan/default/src/ckan/ckan/model/user.py", line 64, in get return query.first() File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2334, in first ret = list(self[0:1]) File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2201, in __getitem__ return list(res) File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2405, in __iter__ return self._execute_and_instances(context) File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2420, in _execute_and_instances result = conn.execute(querycontext.statement, self._params) File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 727, in execute return meth(self, multiparams, params) File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 322, in _execute_on_connection return connection._execute_clauseelement(self, multiparams, params) File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 824, in _execute_clauseelement compiled_sql, distilled_params File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 954, in _execute_context context) File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1116, in _handle_dbapi_exception exc_info File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 189, in raise_from_cause reraise(type(exception), exception, tb=exc_tb) File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 947, in _execute_context context) File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 435, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.ProgrammingError: (ProgrammingError) column user.password does not exist LINE 1: SELECT "user".password AS user_password, "user".id AS user_i... ^ 'SELECT "user".password AS user_password, "user".id AS user_id, "user".name AS user_name, "user".openid AS user_openid, "user".fullname AS user_fullname, "user".email AS user_email, "user".apikey AS user_apikey, "user".created AS user_created, "user".reset_key AS user_reset_key, "user".about AS user_about, "user".activity_streams_email_notifications AS user_activity_streams_email_notifications, "user".sysadmin AS user_sysadmin, "user".state AS user_state \nFROM "user" \nWHERE "user".name = %(name_1)s OR "user".openid = %(openid_1)s OR "user".id = %(id_1)s ORDER BY "user".name \n LIMIT %(param_1)s' {'param_1': 1, 'id_1': 'default', 'name_1': 'default', 'openid_1': 'default'}

I did not make any modifications to the installation or the schema. The installation is under a proxy, but that did not turn out to be a problem thus far, since there were many posts giving help in that regard.

Did anybody come across this error before and managed to resolve it? I don't suppose it is a proxy-related problem... though it seems to be related to the schema.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Flashpoint
  • 31
  • 6

3 Answers3

2

I ran into the same issue but dropping the DB and creating and initialising it again afterwards produced the same error. Also running paster db clear -c /etc/ckan/default/development.ini failed with said error.

It worked for me, when I deactivated all ckan.plugins in development.ini before running paster db init -c /etc/ckan/default/development.ini.

stefina
  • 43
  • 5
  • Also having the same issue. you can not create a ckan database with ini file that contains plugins that also create tables in the database. its like it initailizes the plugins first before creating the database. – Martin Naughton Nov 26 '19 at 12:00
1

Managed to solve this one after all, so I'll answer my own question... :)

The problem was with the setup of the database. Once I purged the database and completely reinstalled it, everything worked like a charm!

Flashpoint
  • 31
  • 6
  • Similar happened to me when installing ckan. I think I just entered some cmds in the wrong order in my case. I had to drop the database `sudo -u postgres dropdb ckan_default` then `sudo -u postgres psql -l` to make sure it was dropped. Then re-run the create command `sudo -u postgres createdb -O ckan_default ckan_default -E utf-8`. After that I was able to successfully run `paster db init -c /etc/ckan/default/development.ini` to create db tables. – user3366016 Apr 23 '18 at 19:57
  • Hi Flashpoint, could you please explain how exactly did you purge the database. I use this command: paster db clean -c /etc/ckan/default/development.ini, but still get the same error.... – davisoski Nov 04 '18 at 11:51
1

sqlalchemy.exc.ProgrammingError: (ProgrammingError) column user.password does not exist LINE 1: SELECT "user".password AS user_password, "user".id AS user_i...

This error usually means that the CKAN database exists but is empty - the CKAN tables have not been created in it.

To solve it:

cd /usr/lib/ckan/default/src/ckan
paster db init -c /etc/ckan/default/development.ini

There's more about this in the docs: http://docs.ckan.org/en/latest/maintaining/installing/install-from-source.html#create-database-tables

D Read
  • 3,175
  • 1
  • 15
  • 25