geosolutions-it / ckanext-dcatapit

CKAN extension for the Italian Open Data Portals (DCAT_AP-IT)
GNU Affero General Public License v3.0
10 stars 18 forks source link

Error in harvesting (license) #170

Open etj opened 6 years ago

etj commented 6 years ago

Only happens when the license vocabulary is not loaded

2018-03-22 08:48:54,458 INFO  [ckanext.harvest.model] Error when processsing dataset: AttributeError("'NoneType' object has no attribute 'uri'",) / Traceback (most recent call last):
  File "/usr/lib/ckan/default/src/ckanext-dcat/ckanext/dcat/harvesters/rdf.py", line 209, in gather_stage
    for dataset in parser.datasets():
  File "/usr/lib/ckan/default/src/ckanext-dcat/ckanext/dcat/processors.py", line 181, in datasets
    profile.parse_dataset(dataset_dict, dataset_ref)
  File "/usr/lib/ckan/default/src/ckanext-dcatapit/ckanext/dcatapit/dcat/profiles.py", line 330, in parse_dataset
    resource_dict['license_type'] = license_type.uri
AttributeError: 'NoneType' object has no attribute 'uri'
giorgialodi commented 5 years ago

Hi all, I am getting a similar error when harvesting a specific PA (for which a previous haversting was working fine). The error I have is the following: Error when processsing dataset: AttributeError("'Query' object has no attribute 'where'",) / Traceback (most recent call last): File "/usr/lib/ckan/default/src/ckanext-dcat/ckanext/dcat/harvesters/rdf.py", line 209, in gather_stage for dataset in parser.datasets(): File "/usr/lib/ckan/default/src/ckanext-dcat/ckanext/dcat/processors.py", line 181, in datasets profile.parse_dataset(dataset_dict, dataset_ref) File "/usr/lib/ckan/default/src/ckanext-dcatapit/ckanext/dcatapit/dcat/profiles.py", line 352, in parse_dataset **names) File "/usr/lib/ckan/default/src/ckanext-dcatapit/ckanext/dcatapit/interfaces.py", line 321, in get_license_from_dcat l = License.get_by_lang(lang, name) File "/usr/lib/ckan/default/src/ckanext-dcatapit/ckanext/dcatapit/model/license.py", line 188, in get_by_lang LocalizedLicenseName.license_id == cls.id)\ AttributeError: 'Query' object has no attribute 'where’

Do you think the two errors share the same reason? @etj @tdipisa @cezio

tdipisa commented 5 years ago

@giorgialodi, I'm not sure but it could be. This kind of exceptions usually require some debug.

giorgialodi commented 5 years ago

@tdipisa thanks for the reply. I need to better understand it otherwise I am not able to harvest an important PA. I am doing another check at the moment. I will let you know

giorgialodi commented 5 years ago

The PA said to me that they are able to load correctly the licence vocabulary.