[ckan-dev] problem with purging groups

Heinrich Widmann widmann at dkrz.de
Wed Nov 26 10:03:43 UTC 2014


Hi Daniel,
we run in the same issue (using CKAN-2.1):

We created a group, add some datasets to it and delete and purge the 
datasets again ...
Now I tried - via the GUI and logged in as CKAN sysadmin - to remove the 
group, but just trying to open the group leads you automatically to :


That means it is not even possible to re-use or re-edit an empty, but 
existing, group any longer !?

My hope was now, that it is possible via paster or the CKAN API to solve 
this issue - but your experience shows that this is not the case.

Could please somebody of the CKAN developers address this issue ?

Thanks,
Heinrich

Am 14/11/2014 um 06:16 schrieb Daniel Lau:
> Hi all
>
> We are building a system that uses CKAN as a data portal but 
> periodically we may need to programmatically delete and purge datasets 
> from it (purged because we may need to reuse the dataset name).
>
> However we noticed that after purging a dataset from CKAN (using the 
> paster command), we ended up with empty groups that has no dataset 
> (because it was for the purged datasets). When we try to delete and 
> purge the group, the operation failed.
>
> After a bit of investigation, it turned out when we purged the 
> datasets (using the paster command), only the datatset (or package) 
> records were removed, but the member records that tie the 'datasets' 
> to the 'groups' were left behind. Hence an attempt to purge the group 
> (via purge_group action) will fail due to foreign key restriction.
>
> We went further and started removing membership between datasets and 
> groups prior to purging (using the member_delete action). Now when we 
> attempt to delete/purge the empty groups again, it throws another 
> error and this time it is related to "group revision records" (sadly 
> this time there is no CKAN action that can delete or purge 'group 
> revision').
>
> We are thinking it can't be this difficult to purge an empty CKAN 
> group? I would have thought when the paster purge is executed on the 
> dataset, the action should remove all dataset records and along side 
> any other records that point to the deleted dataset (e.g. group 
> membership). And that when we perform a purge_group action, it should 
> also automatically remove records with foreign key pointing to the 
> group to purge (e.g. group membership, group revision, etc)
>
> Are we doing something wrong or is this limitation in the current 
> version of CKAN?
> Or perhaps we should turn off revision tracking for group (if there is 
> such a function)? But is that just a workaround, and the correct 
> approach should be to enhance CKAN to automatically remove related 
> records when a dataset/group is purged.
>
> Thanks in advance if anyone can help out with this problem.
>
> Kind regards
> -- 
>
> *Daniel Lau* | Software Engineer|Sirca Ltd
>
> daniel.lau at sirca.org.au <mailto:daniel.lau at sirca.org.au>| 
> www.sirca.org.au <http://www.sirca.org.au/>
>
> Tel: +61 2 8355 2523
>
> Level 4, 55 Harrington St, The Rocks NSW 2000
>
> PO Box H58, Australia Square, Sydney NSW 1215
>
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev

-- 
Heinrich Widmann
Abteilung Datenmanagement

Deutsches Klimarechenzentrum GmbH (DKRZ)
Bundesstraße 45a • D-20146 Hamburg • Germany

Phone: +49 40 460094-282
FAX:   +49 40 460094-270
Email: widmann at dkrz.de
URL:   www.dkrz.de

Geschäftsführer: Prof. Dr. Thomas Ludwig
Sitz der Gesellschaft: Hamburg
Amtsgericht Hamburg HRB 39784

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20141126/7b868ab9/attachment-0003.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ideehiid.png
Type: image/png
Size: 8883 bytes
Desc: not available
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20141126/7b868ab9/attachment-0003.png>


More information about the ckan-dev mailing list