[ckan-dev] harvesting user and deleting a user

Hildegard Gerlach hildegard.gerlach at jrc.ec.europa.eu
Tue Nov 26 11:09:29 UTC 2013


Hi everyone,


http://docs.ckan.org/projects/ckanext-spatial/en/latest/harvesters.html says

By default the harvesting actions (eg creating or updating datasets) 
will be performed by the internal site admin user. This is the 
recommended setting, but if necessary, it can be overridden with the 
ckanext.spatial.harvest.user_name config option, eg to support the old 
hardcoded ‘harvest’ user:

ckanext.spatial.harvest.user_name  =  harvest

We have another instance of CKAN (both on Redhat) on another machine where the harvester works without having a user harvest.

I am working with Elena and we have obviously an authorization problem 
running the harvesting.

paster --plugin=ckanext-harvest harvester run -c /etc/ckan/production.ini

Traceback (most recent call last):
File "/usr/local/ckan/pyenv/bin/paster", line 9, in <module>
load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
File 
"/usr/local/ckan/pyenv/lib/python2.6/site-packages/paste/script/command.py", 
line 104, in run
invoke(command, command_name, options, args[1:])
File 
"/usr/local/ckan/pyenv/lib/python2.6/site-packages/paste/script/command.py", 
line 143, in invoke
exit_code = runner.run(args)
File 
"/usr/local/ckan/pyenv/lib/python2.6/site-packages/paste/script/command.py", 
line 238, in run
result = self.command()
File 
"/usr/local/ckan/pyenv/src/ckanext-harvest/ckanext/harvest/commands/harvester.py", 
line 113, in command
self.run_harvester()
File 
"/usr/local/ckan/pyenv/src/ckanext-harvest/ckanext/harvest/commands/harvester.py", 
line 278, in run_harvester
jobs = get_action('harvest_jobs_run')(context,{})
File "/usr/local/ckan/pyenv/src/ckan/ckan/logic/__init__.py", line 329, 
in wrapped
return _action(context, data_dict, **kw)
File 
"/usr/local/ckan/pyenv/src/ckanext-harvest/ckanext/harvest/logic/action/update.py", 
line 291, in harvest_jobs_run
jobs = harvest_job_list(context,{'source_id':source_id,'status':u'Running'})
File "/usr/local/ckan/pyenv/src/ckan/ckan/logic/__init__.py", line 386, 
in wrapper
return action(context, data_dict)
File 
"/usr/local/ckan/pyenv/src/ckanext-harvest/ckanext/harvest/logic/action/get.py", 
line 226, in harvest_job_list
check_access('harvest_job_list',context,data_dict)
File "/usr/local/ckan/pyenv/src/ckan/ckan/logic/__init__.py", line 207, 
in check_access
logic_authorization = new_authz.is_authorized(action, context, data_dict)
File "/usr/local/ckan/pyenv/src/ckan/ckan/new_authz.py", line 82, in 
is_authorized
return auth_function(context, data_dict)
File 
"/usr/local/ckan/pyenv/src/ckanext-harvest/ckanext/harvest/logic/auth/get.py", 
line 85, in harvest_job_list
{'id': source_id})
File "/usr/local/ckan/pyenv/src/ckan/ckan/logic/__init__.py", line 207, 
in check_access
logic_authorization = new_authz.is_authorized(action, context, data_dict)
File "/usr/local/ckan/pyenv/src/ckan/ckan/new_authz.py", line 82, in 
is_authorized
return auth_function(context, data_dict)
File 
"/usr/local/ckan/pyenv/src/ckanext-harvest/ckanext/harvest/logic/auth/update.py", 
line 28, in harvest_source_update
raise pt.ObjectNotFound(pt._('Harvest source not found'))
ckan.logic.NotFound: Harvest source not found

I changed the 
/usr/local/ckan/pyenv/src/ckanext-harvest/ckanext/harvest/logic/auth/update.py 
to output some data, and I get an empty user (no value)
and source_id: None

Now I tried to set

ckanext.spatial.harvest.user_name  =  admin

but this didn't change anything.

Then we have this empty user (name=  ) which might cause a problem, but we don't know hot to get rid of it (as already described).

paster --plugin=ckan user list -c /etc/ckan/production.ini
Users:
count = 9
name=
name=admin
name=annafan
name=joeadmin
name=logged_in
name=russianfan
name=tester
name=testsysadmin
name=visitor

Any help would be appreciated.

Otherwise is there a way to uninstall and reinstall the harvesting extension ? We did an upgrade to 2.1.1 of CKAN and extensions to stable, but nothing changed.

Kind regards

Hilde



On 11/25/2013 9:05 PM, Vitor Baptista wrote:
> Hi Elena,
>
> By default, ckanext-harvest use the user "harvest". You'll have some 
> poblems if it doesn't exist (or you haven't changed it to another 
> username). To solve it, you can simply add this user as a sysadmin. 
> The password doesn't matter.
>
> Cheers,
>
>
> 2013/11/25 Elena Camossi <elena.camossi at ext.jrc.ec.europa.eu 
> <mailto:elena.camossi at ext.jrc.ec.europa.eu>>
>
>     Hi everyone,
>
>     we are experiencing some problem with harvesting (CKAN 2.1, on
>     RedHat),
>     doing some debugging we discovered that harvesting seems to be
>     runned by a
>     user with no name.
>
>     Getting the list of users with "paster user list", we discovered
>     that one of
>     the users has indeed no name, and table user within Postgres has
>     indeed a
>     row
>     column name having value ' '.
>
>     We have tried to delete this user with "paster user remove". Command
>     succeeds but user still exists. We have tried deleting it from the
>     Postgresql database, the row is removed but it reappears after
>     running again
>     "paster user list"...
>
>     Is there any other way to delete a CKAN user?
>
>     Does harvesting use some default CKAN user?
>
>     Thanks a lot for your help.
>
>     Kind regards,
>     -Elen a
>
>
>     _______________________________________________
>     ckan-dev mailing list
>     ckan-dev at lists.okfn.org <mailto:ckan-dev at lists.okfn.org>
>     http://lists.okfn.org/mailman/listinfo/ckan-dev
>     Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>
>
>
>
> -- 
>
> Vítor Baptista
>
> Developer |http://vitorbaptista.com | LinkedIn 
> <http://www.linkedin.com/in/vitorbaptista> | @vitorbaptista 
> <http://twitter.com/vitorbaptista>
>
> The Open Knowledge Foundation <http://okfn.org>
>
> /Empowering through Open Knowledge/
>
> http://okfn.org/ | @okfn <http://twitter.com/okfn> | OKF on Facebook 
> <https://www.facebook.com/OKFNetwork> | Blog <http://blog.okfn.org/> | 
> Newsletter <http://okfn.org/about/newsletter/>
>
>
>
> _______________________________________________
> 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





More information about the ckan-dev mailing list