[ckan-dev] ckanext-harvest crontab

Michael Reichart michael.reichart at gmail.com
Fri Mar 15 12:22:45 UTC 2013


Hi,

I'm trying to set up harvester for automatic import via crontab.
My problem is: The paster command run by crontab fails, but the same script
executed manually works with no problem at all.

my cronjob:
*/5 * * * * /products/ckan/pyenv/bin/paster --plugin=ckanext-harvest
harvester run --config=/home/ckan/my.paster.ini


when I run /products/ckan/pyenv/bin/paster --plugin=ckanext-harvest
harvester run --config=/home/ckan/my.paster.ini from console everything is
ok.

Crontab produces the following error:
No handlers could be found for logger "vdm"
Traceback (most recent call last):
  File "/products/ckan/pyenv/bin/paster", line 8, in <module>
    load_entry_point('PasteScript==1.7.3', 'console_scripts', 'paster')()
  File
"/products/ckan/pyenv/lib/python2.6/site-packages/paste/script/command.py",
line 84, in run
    invoke(command, command_name, options, args[1:])
  File
"/products/ckan/pyenv/lib/python2.6/site-packages/paste/script/command.py",
line 123, in invoke
    exit_code = runner.run(args)
  File
"/products/ckan/pyenv/lib/python2.6/site-packages/paste/script/command.py",
line 218, in run
    result = self.command()
  File
"/products/ckan/pyenv/lib/python2.6/site-packages/ckanext/harvest/commands/harvester.py",
line 65, in command
    self._load_config()
  File
"/products/ckan/pyenv/lib/python2.6/site-packages/ckanext/harvest/commands/harvester.py",
line 117, in _load_config
    super(Harvester, self)._load_config()
  File "/products/ckan/pyenv/lib/python2.6/site-packages/ckan/lib/cli.py",
line 53, in _load_config
    load_environment(conf.global_conf, conf.local_conf)
  File
"/products/ckan/pyenv/lib/python2.6/site-packages/ckan/config/environment.py",
line 192, in load_environment
    engine = sqlalchemy.engine_from_config(config, 'sqlalchemy.')
  File
"/products/ckan/pyenv/lib/python2.6/site-packages/sqlalchemy/engine/__init__.py",
line 298, in engine_from_config
    return create_engine(url, **opts)
  File
"/products/ckan/pyenv/lib/python2.6/site-packages/sqlalchemy/engine/__init__.py",
line 280, in create_engine
    return strategy.create(*args, **kwargs)
  File
"/products/ckan/pyenv/lib/python2.6/site-packages/sqlalchemy/engine/strategies.py",
line 64, in create
    dbapi = dialect_cls.dbapi(**dbapi_args)
  File
"/products/ckan/pyenv/lib/python2.6/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py",
line 283, in dbapi
    psycopg = __import__('psycopg2')
  File
"/products/ckan/pyenv/lib/python2.6/site-packages/psycopg2/__init__.py",
line 60, in <module>
    from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: libpq.so.5: cannot open shared object file: No such file or
directory


Any hints?

Thanks!
Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130315/01bfd6b6/attachment.html>


More information about the ckan-dev mailing list