[ckan-dev] Setting up DataStore

Joshua Tauberer tauberer+consulting at govtrack.us
Wed Oct 3 15:16:18 UTC 2012


Hi,

I'm trying out DataStore (source install from the master branch).

Following the docs, I'm stuck at the step of creating the database. It 
seems like I'm not supposed to create the database or users myself --- 
that's what paster datastore create-db/create-read-only-user are 
supposed to do.

However, when I run these commands an exception is thrown during 
initialization complaining about not being able to authenticate as the 
user configured in the ini --- which of course doesn't exist yet. Here's 
the exception:

$ paster --plugin=ckan datastore create-db postgres
Traceback (most recent call last):
   File "/home/ubuntu/pyenv/bin/paster", line 9, in <module>
     load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
   File 
"/home/ubuntu/pyenv/lib/python2.6/site-packages/paste/script/command.py", line 
104, in run
     invoke(command, command_name, options, args[1:])
   File 
"/home/ubuntu/pyenv/lib/python2.6/site-packages/paste/script/command.py", line 
143, in invoke
     exit_code = runner.run(args)
   File 
"/home/ubuntu/pyenv/lib/python2.6/site-packages/paste/script/command.py", line 
238, in run
     result = self.command()
*  File "/home/ubuntu/pyenv/src/ckan/ckanext/datastore/commands.py", 
line 72, in command**
**    self._load_config()**
*  File "/home/ubuntu/pyenv/src/ckan/ckan/lib/cli.py", line 85, in 
_load_config
     load_environment(conf.global_conf, conf.local_conf)
   File "/home/ubuntu/pyenv/src/ckan/ckan/config/environment.py", line 
353, in load_environment
     plugin.configure(config)
   File "/home/ubuntu/pyenv/src/ckan/ckanext/datastore/plugin.py", line 
49, in configure
     if not self._is_read_only_database():
   File "/home/ubuntu/pyenv/src/ckan/ckanext/datastore/plugin.py", line 
99, in _is_read_only_database
     {'connection_url': url}).connect()
   File 
"/home/ubuntu/pyenv/lib/python2.6/site-packages/sqlalchemy/engine/base.py", 
line 2472, in connect
     return self._connection_cls(self, **kwargs)
   File 
"/home/ubuntu/pyenv/lib/python2.6/site-packages/sqlalchemy/engine/base.py", 
line 878, in __init__
     self.__connection = connection or engine.raw_connection()
   File 
"/home/ubuntu/pyenv/lib/python2.6/site-packages/sqlalchemy/engine/base.py", 
line 2558, in raw_connection
     return self.pool.unique_connection()
   File 
"/home/ubuntu/pyenv/lib/python2.6/site-packages/sqlalchemy/pool.py", 
line 183, in unique_connection
     return _ConnectionFairy(self).checkout()
   File 
"/home/ubuntu/pyenv/lib/python2.6/site-packages/sqlalchemy/pool.py", 
line 387, in __init__
     rec = self._connection_record = pool._do_get()
   File 
"/home/ubuntu/pyenv/lib/python2.6/site-packages/sqlalchemy/pool.py", 
line 741, in _do_get
     con = self._create_connection()
   File 
"/home/ubuntu/pyenv/lib/python2.6/site-packages/sqlalchemy/pool.py", 
line 188, in _create_connection
     return _ConnectionRecord(self)
   File 
"/home/ubuntu/pyenv/lib/python2.6/site-packages/sqlalchemy/pool.py", 
line 270, in __init__
     self.connection = self.__connect()
   File 
"/home/ubuntu/pyenv/lib/python2.6/site-packages/sqlalchemy/pool.py", 
line 330, in __connect
     connection = self.__pool._creator()
   File 
"/home/ubuntu/pyenv/lib/python2.6/site-packages/sqlalchemy/engine/strategies.py", 
line 80, in connect
     return dialect.connect(*cargs, **cparams)
   File 
"/home/ubuntu/pyenv/lib/python2.6/site-packages/sqlalchemy/engine/default.py", 
line 281, in connect
     return self.dbapi.connect(*cargs, **cparams)
   File 
"/home/ubuntu/pyenv/lib/python2.6/site-packages/psycopg2/__init__.py", 
line 179, in connect
     connection_factory=connection_factory, async=async)
sqlalchemy.exc.OperationalError: (OperationalError) FATAL:  password 
authentication failed for user "ckan_datastore_rw"
FATAL:  password authentication failed for user "ckan_datastore_rw"

If I create the user, it then throws an exception about the database not 
existing. If I then create the db, it throws about the read-only user 
not existing. If I create the read-only user it throws about the user 
having write permission on the database. And after that I gave up 
because I couldn't figure out what I needed to revoke to get past that 
problem. :)

Tips?

-- 
- Joshua Tauberer
- http://razor.occams.info

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20121003/03a303f6/attachment.html>


More information about the ckan-dev mailing list