[ckan-dev] setting up a datastore in v1.8

Dominik Moritz dominik.moritz at okfn.org
Mon Oct 29 21:46:14 UTC 2012


Hi Haklae,

it looks as though you are running the paster command from a different directory. You have to run the paster command in the same directory where you have the `development.ini` so that paster can find it. 

If you want, you can join the #ckan dev channel on freenode.net and we can help you with faster responses.

Hope that helps,
Dominik

On 29 Oct 2012, at 14:04, Kim Haklae <haklaekim at gmail.com> wrote:

> Hi Dominik,
> 
> Sorry to interrupt. I have installed ckan 1.8 by package install. This
> command gave me a different error. I will do it on another machine, and
> will let you know.
> 
> ======
> sudo paster --plugin=ckan datastore set-permissions postgres[sudo] password
> for haklaekim:
> Traceback (most recent call last):
>  File "/usr/bin/paster", line 18, in <module>
>    command.run()
>  File "/usr/lib/pymodules/python2.6/
>> 
>> paste/script/command.py", line 84, in run
>>    invoke(command, command_name, options, args[1:])
>>  File "/usr/lib/pymodules/python2.6/paste/script/command.py", line 123,
>> in invoke
>>    exit_code = runner.run(args)
>>  File "/usr/lib/pymodules/python2.6/paste/script/command.py", line 218,
>> in run
>>    result = self.command()
>>  File "/usr/lib/pymodules/python2.6/ckanext/datastore/commands.py", line
>> 40, in command
>>    self._load_config()
>>  File "/usr/lib/pymodules/python2.6/ckan/lib/cli.py", line 75, in
>> _load_config
>>    raise AssertionError('Config filename %r does not exist.' %
>> self.filename)
>> AssertionError: Config filename '/home/haklaekim/development.ini' does not
>> exist
>> ======
> 
> With thanks,
> haklae
> 
> 
> 
> On Mon, Oct 29, 2012 at 8:46 PM, Dominik Moritz <dominik.moritz at okfn.org>wrote:
> 
>> Hi Haklae,
>> 
>> Sorry, I meant `paster --plugin=ckan datastore set-permissions postgres`.
>> 
>> Cheers,
>> Dominik
>> 
>> On 29 Oct 2012, at 10:57, Kim Haklae <haklaekim at gmail.com> wrote:
>> 
>>> Hi Dominik,
>>> 
>>> Thanks. When I put this command 'paster datastore set-permissions
>>> postgres", this message was showed "Command 'datastore not known (you may
>>> need to run setup.py egg_info)".
>>> 
>>> With thanks,
>>> haklae
>>> 
>>> On Mon, Oct 29, 2012 at 5:48 PM, Dominik Moritz <dominik.moritz at okfn.org
>>> wrote:
>>> 
>>>> Hi Haklae,
>>>> 
>>>> This looks great. use `paster datastore set-permissions SQL_SUPER_USER`
>>>> where SQL_SUPER_USER is the pg super user. On ubuntu this is probably
>>>> `postgres`.
>>>> 
>>>> Cheers,
>>>> Dominik
>>>> 
>>>> On 29 Oct 2012, at 01:44, Kim Haklae <haklaekim at gmail.com> wrote:
>>>> 
>>>>> Hi Dominik,
>>>>> 
>>>>> Thanks for your response. These are messages with commands.
>>>>> 
>>>>> *haklaekim at ubuntu:~$ paster*
>>>>> 
>>>>> Usage: /usr/bin/paster COMMAND
>>>>> Usage: paster [paster_options] COMMAND [command_options]
>>>>> 
>>>>> Options:
>>>>> --version         show program's version number and exit
>>>>> --plugin=PLUGINS  Add a plugin to the list of commands (plugins are Egg
>>>>>                  specs; will also require() the Egg)
>>>>> -h, --help        Show this help message
>>>>> 
>>>>> Commands:
>>>>> create       Create the file layout for a Python distribution
>>>>> help         Display help
>>>>> make-config  Install a package and create a fresh config file/directory
>>>>> points       Show information about entry points
>>>>> post         Run a request for the described application
>>>>> request      Run a request for the described application
>>>>> serve        Serve the described application
>>>>> setup-app    Setup an application, given a config file
>>>>> 
>>>>> *haklaekim at ubuntu:~$ paster --plugin=ckan
>>>>> *
>>>>> Usage: /usr/bin/paster COMMAND
>>>>> Usage: paster [paster_options] COMMAND [command_options]
>>>>> 
>>>>> Options:
>>>>> --version         show program's version number and exit
>>>>> --plugin=PLUGINS  Add a plugin to the list of commands (plugins are Egg
>>>>>                  specs; will also require() the Egg)
>>>>> -h, --help        Show this help message
>>>>> 
>>>>> Cannot load command check-po-files: No module named polib
>>>>> Commands:
>>>>> create            Create the file layout for a Python distribution
>>>>> help              Display help
>>>>> make-config       Install a package and create a fresh config
>>>>> file/directory
>>>>> points            Show information about entry points
>>>>> post              Run a request for the described application
>>>>> request           Run a request for the described application
>>>>> serve             Serve the described application
>>>>> setup-app         Setup an application, given a config file
>>>>> 
>>>>> ckan:
>>>>> celeryd           Celery daemon
>>>>> create-test-data  Create test data in the database.
>>>>> dataset           Manage datasets
>>>>> datastore         Perform commands to set up the datastore.
>>>>> db                Perform various tasks on the database.
>>>>> notify            Send out modification notifications.
>>>>> plugin-info        Provide info on installed plugins.
>>>>> profile           Code speed profiler
>>>>> ratings           Manage the ratings stored in the db
>>>>> rdf-export
>>>>> rights            Commands relating to per-object and system-wide
>> access
>>>>> rights.
>>>>> roles             Commands relating to roles and actions.
>>>>> search-index      Creates a search index for all datasets
>>>>> sysadmin          Gives sysadmin rights to a named user
>>>>> tracking          Update tracking statistics
>>>>> user              Manage users
>>>>> 
>>>>> *haklaekim at ubuntu:~$ paster datastore*
>>>>> 
>>>>> Command 'datastore' not known (you may need to run setup.py egg_info)
>>>>> Known commands:
>>>>> create       Create the file layout for a Python distribution
>>>>> exe          Run #! executable files
>>>>> help         Display help
>>>>> make-config  Install a package and create a fresh config file/directory
>>>>> points       Show information about entry points
>>>>> post         Run a request for the described application
>>>>> request      Run a request for the described application
>>>>> serve        Serve the described application
>>>>> setup-app    Setup an application, given a config file
>>>>> 
>>>>> haklaekim at ubuntu:~$ paster datastore
>>>>> 
>>>>> Command 'datastore' not known (you may need to run setup.py egg_info)
>>>>> Known commands:
>>>>> create       Create the file layout for a Python distribution
>>>>> exe          Run #! executable files
>>>>> help         Display help
>>>>> make-config  Install a package and create a fresh config file/directory
>>>>> points       Show information about entry points
>>>>> post         Run a request for the described application
>>>>> request      Run a request for the described application
>>>>> serve        Serve the described application
>>>>> setup-app    Setup an application, given a config file
>>>>> 
>>>>> haklaekim at ubuntu:~$ paster --plugin=ckan datastore
>>>>> Perform commands to set up the datastore.
>>>>>  Make sure that the datastore urls are set properly before you run
>>>> these
>>>>> commands.
>>>>> 
>>>>>  Usage::
>>>>> 
>>>>>      paster datastore set-permissions SQL_SUPER_USER
>>>>> 
>>>>>  Where:
>>>>>      SQL_SUPER_USER is the name of a postgres user with sufficient
>>>>>                       permissions to create new tables, users, and
>>>> grant
>>>>>                       and revoke new permissions.  Typically, this
>>>> would
>>>>>                       be the "postgres" user.
>>>>> 
>>>>> 
>>>>> haklaekim at ubuntu:~$ ^C
>>>>> *haklaekim at ubuntu:~$ paster --plugin=ckan datastore*
>>>>> Perform commands to set up the datastore.
>>>>>  Make sure that the datastore urls are set properly before you run
>>>> these
>>>>> commands.
>>>>> 
>>>>>  Usage::
>>>>> 
>>>>>      paster datastore set-permissions SQL_SUPER_USER
>>>>> 
>>>>>  Where:
>>>>>      SQL_SUPER_USER is the name of a postgres user with sufficient
>>>>>                       permissions to create new tables, users, and
>>>> grant
>>>>>                       and revoke new permissions.  Typically, this
>>>> would
>>>>>                       be the "postgres" user.
>>>>> 
>>>>> 
>>>>> On Mon, Oct 29, 2012 at 5:12 AM, Dominik Moritz <
>> dominik.moritz at okfn.org
>>>>> wrote:
>>>>> 
>>>>>> Hi Kim,
>>>>>> 
>>>>>> the datastore extension is not a pypi package and does not have to be
>>>>>> installed separately. It comes with core. You should be able to run
>>>> `paster
>>>>>> datastore` or `paster --plugin=ckan datastore` from the ckan root
>>>> directory.
>>>>>> 
>>>>>> What is the output of `paster` and `paster --plugin=ckan`?
>>>>>> 
>>>>>> Hope that helps,
>>>>>> Dominik
>>>>>> 
>>>>>> On 28 Oct 2012, at 13:07, Kim Haklae <haklaekim at gmail.com> wrote:
>>>>>> 
>>>>>>> Hi,
>>>>>>> 
>>>>>>> According to instruction of the documentation, I tried to install a
>>>>>>> datastore using ckan v1.8.
>>>>>>> For setting permissions with option 1:
>>>>>>> 
>>>>>>> sudo paster datastore set-permissions SQL_SUPER_USER
>>>>>>> 
>>>>>>> this message occured:
>>>>>>> 
>>>>>>> Command 'datastore' not known (you may need to run setup.py egg_info)
>>>>>>> Known commands:
>>>>>>> create       Create the file layout for a Python distribution
>>>>>>> exe          Run #! executable files
>>>>>>> help         Display help
>>>>>>> make-config  Install a package and create a fresh config
>> file/directory
>>>>>>> points       Show information about entry points
>>>>>>> post         Run a request for the described application
>>>>>>> request      Run a request for the described application
>>>>>>> serve        Serve the described application
>>>>>>> setup-app    Setup an application, given a config file
>>>>>>> 
>>>>>>> In case, I tried to install a datastore extension, it also gave me an
>>>>>> error
>>>>>>> as followed:
>>>>>>> 
>>>>>>> sudo -u ckandatahub /var/lib/ckan/datahub/pyenv/bin/pip install
>>>> datastore
>>>>>>> Downloading/unpacking datastore
>>>>>>> Downloading datastore-0.2.11.tar.gz
>>>>>>> Running setup.py egg_info for package datastore
>>>>>>> something went wrong reading the README.md file.
>>>>>>> Downloading/unpacking smhasher==0.136.2 (from datastore)
>>>>>>> Downloading smhasher-0.136.2.tar.gz (56Kb): 56Kb downloaded
>>>>>>> Running setup.py egg_info for package smhasher
>>>>>>> Installing collected packages: datastore, smhasher
>>>>>>> Running setup.py install for datastore
>>>>>>> something went wrong reading the README.md file.
>>>>>>> Running setup.py install for smhasher
>>>>>>> building 'smhasher' extension
>>>>>>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>>>>>>> -Wstrict-prototypes -fPIC -DMODULE_VERSION="0.136.2" -Ismhasher
>>>>>>> -I/usr/include/python2.6 -c smhasher.cpp -o
>>>>>>> build/temp.linux-i686-2.6/smhasher.o
>>>>>>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>>>>>>> for Ada/C/ObjC but not for C++
>>>>>>> smhasher.cpp:11:20: error: Python.h: No such file or directory
>>>>>>> smhasher.cpp:22: error: expected initializer before ‘*’ token
>>>>>>> error: command 'gcc' failed with exit status 1
>>>>>>> Complete output from command /var/lib/ckan/datahub/pyenv/bin/python
>>>> -c
>>>>>>> "import
>>>>>>> 
>>>>>> 
>>>> 
>> setuptools;__file__='/var/lib/ckan/datahub/pyenv/build/smhasher/setup.py';exec(compile(open(__file__).read().replace('\r\n',
>>>>>>> '\n'), __file__, 'exec'))" install
>> --single-version-externally-managed
>>>>>>> --record /tmp/pip-Gud_TS-record/install-record.txt --install-headers
>>>>>>> /var/lib/ckan/datahub/pyenv/include/site/python2.6:
>>>>>>> running install
>>>>>>> 
>>>>>>> running build
>>>>>>> 
>>>>>>> running build_ext
>>>>>>> 
>>>>>>> building 'smhasher' extension
>>>>>>> 
>>>>>>> creating build
>>>>>>> 
>>>>>>> creating build/temp.linux-i686-2.6
>>>>>>> 
>>>>>>> creating build/temp.linux-i686-2.6/smhasher
>>>>>>> 
>>>>>>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>>>>>>> -Wstrict-prototypes -fPIC -DMODULE_VERSION="0.136.2" -Ismhasher
>>>>>>> -I/usr/include/python2.6 -c smhasher.cpp -o
>>>>>>> build/temp.linux-i686-2.6/smhasher.o
>>>>>>> 
>>>>>>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>>>> for
>>>>>>> Ada/C/ObjC but not for C++
>>>>>>> 
>>>>>>> smhasher.cpp:11:20: error: Python.h: No such file or directory
>>>>>>> 
>>>>>>> smhasher.cpp:22: error: expected initializer before ‘*’ token
>>>>>>> 
>>>>>>> error: command 'gcc' failed with exit status 1
>>>>>>> 
>>>>>>> ----------------------------------------
>>>>>>> Command /var/lib/ckan/datahub/pyenv/bin/python -c "import
>>>>>>> 
>>>>>> 
>>>> 
>> setuptools;__file__='/var/lib/ckan/datahub/pyenv/build/smhasher/setup.py';exec(compile(open(__file__).read().replace('\r\n',
>>>>>>> '\n'), __file__, 'exec'))" install
>> --single-version-externally-managed
>>>>>>> --record /tmp/pip-Gud_TS-record/install-record.txt --install-headers
>>>>>>> /var/lib/ckan/datahub/pyenv/include/site/python2.6 failed with error
>>>>>> code 1
>>>>>>> Storing complete log in /home/haklaekim/.pip/pip.log
>>>>>>> Traceback (most recent call last):
>>>>>>> File "/var/lib/ckan/datahub/pyenv/bin/pip", line 9, in <module>
>>>>>>> load_entry_point('pip==1.0.2', 'console_scripts', 'pip')()
>>>>>>> File
>>>>>>> 
>>>>>> 
>>>> 
>> "/var/lib/ckan/datahub/pyenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/__init__.py",
>>>>>>> line 116, in main
>>>>>>> return command.main(initial_args, args[1:], options)
>>>>>>> File
>>>>>>> 
>>>>>> 
>>>> 
>> "/var/lib/ckan/datahub/pyenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/basecommand.py",
>>>>>>> line 151, in main
>>>>>>> log_fp = open_logfile(log_fn, 'w')
>>>>>>> File
>>>>>>> 
>>>>>> 
>>>> 
>> "/var/lib/ckan/datahub/pyenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/basecommand.py",
>>>>>>> line 177, in open_logfile
>>>>>>> os.makedirs(dirname)
>>>>>>> File "/var/lib/ckan/datahub/pyenv/lib/python2.6/os.py", line 157, in
>>>>>>> makedirs
>>>>>>> mkdir(name, mode)
>>>>>>> OSError: [Errno 13] Permission denied: '/home/haklaekim/.pip'
>>>>>>> 
>>>>>>> Thanks in advance.
>>>>>>> 
>>>>>>> - Haklae
>>>>>>> _______________________________________________
>>>>>>> ckan-dev mailing list
>>>>>>> ckan-dev at lists.okfn.org
>>>>>>> http://lists.okfn.org/mailman/listinfo/ckan-dev
>>>>>>> Unsubscribe:
>>>>>> 
>>>> 
>> http://lists.okfn.org/mailman/options/ckan-dev/dominik.moritz%40okfn.org
>>>>>> 
>>>>>> 
>>>>>> _______________________________________________
>>>>>> ckan-dev mailing list
>>>>>> ckan-dev at lists.okfn.org
>>>>>> http://lists.okfn.org/mailman/listinfo/ckan-dev
>>>>>> Unsubscribe:
>>>>>> http://lists.okfn.org/mailman/options/ckan-dev/haklaekim%40gmail.com
>>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> Dr.Dr. Haklae Kim
>>>>> Semantic Web and Open Data Hacker
>>>>> http://thedatahub.kr
>>>>> http://getthedata.kr
>>>>> http://blogweb.co.kr
>>>>> Tel: +82-(0)10-3201-0714
>>>>> Who's Who in the World's 27th Edition - 2010
>>>>> IBC 2000 Outstanding Scientists - 2010
>>>>> _______________________________________________
>>>>> ckan-dev mailing list
>>>>> ckan-dev at lists.okfn.org
>>>>> http://lists.okfn.org/mailman/listinfo/ckan-dev
>>>>> Unsubscribe:
>>>> 
>> http://lists.okfn.org/mailman/options/ckan-dev/dominik.moritz%40okfn.org
>>>> 
>>>> 
>>>> _______________________________________________
>>>> ckan-dev mailing list
>>>> ckan-dev at lists.okfn.org
>>>> http://lists.okfn.org/mailman/listinfo/ckan-dev
>>>> Unsubscribe:
>>>> http://lists.okfn.org/mailman/options/ckan-dev/haklaekim%40gmail.com
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Dr.Dr. Haklae Kim
>>> Semantic Web and Open Data Hacker
>>> http://thedatahub.kr
>>> http://getthedata.kr
>>> http://blogweb.co.kr
>>> Tel: +82-(0)10-3201-0714
>>> Who's Who in the World's 27th Edition - 2010
>>> IBC 2000 Outstanding Scientists - 2010
>>> _______________________________________________
>>> ckan-dev mailing list
>>> ckan-dev at lists.okfn.org
>>> http://lists.okfn.org/mailman/listinfo/ckan-dev
>>> Unsubscribe:
>> http://lists.okfn.org/mailman/options/ckan-dev/dominik.moritz%40okfn.org
>> 
>> 
>> _______________________________________________
>> ckan-dev mailing list
>> ckan-dev at lists.okfn.org
>> http://lists.okfn.org/mailman/listinfo/ckan-dev
>> Unsubscribe:
>> http://lists.okfn.org/mailman/options/ckan-dev/haklaekim%40gmail.com
>> 
> 
> 
> 
> -- 
> Dr.Dr. Haklae Kim
> Semantic Web and Open Data Hacker
> http://thedatahub.kr
> http://getthedata.kr
> http://blogweb.co.kr
> Tel: +82-(0)10-3201-0714
> Who's Who in the World's 27th Edition - 2010
> IBC 2000 Outstanding Scientists - 2010





More information about the ckan-dev mailing list