Ticket #929 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Handle the case when the licenses service is down better

Reported by: rene.kapusta Owned by: rgrp
Priority: minor Milestone: ckan-v1.4
Component: ckan Keywords:
Cc: Repository:


I'm using v 1.3.1a and get a lot of "WebApp? Error: <type 'exceptions.Exception'>: Couldn't connect to licenses service: <urlopen error (104, 'Connection reset by peer')>" error messages.

Module ckan.forms.package:87 in build_package_form
<<      # Options/settings
           builder.set_field_option('name', 'validate', package_name_validator)
           builder.set_field_option('license_id', 'dropdown', {'options':[('', None)] + model.Package.get_license_options()})
           builder.set_field_option('state', 'dropdown', {'options':model.State.all})
           builder.set_field_option('notes', 'textarea', {'size':'60x15'})
>>  builder.set_field_option('license_id', 'dropdown', {'options':[('', None)] + model.Package.get_license_options()})
Module ckan.model.package:283 in get_license_options
<<      @classmethod
           def get_license_options(self):
               register = self.get_license_register()
               return [(l.title, l.id) for l in register.values()]
>>  register = self.get_license_register()
Module ckan.model.package:278 in get_license_register
<<      def get_license_register(self):
               if not hasattr(self, '_license_register'):
                   self._license_register = LicenseRegister()
               return self._license_register
>>  self._license_register = LicenseRegister()
Module ckan.model.license:46 in __init__
<<              from licenses.service import LicensesService2
                   self.service = LicensesService2(group_url)
                   entity_list = self.service.get_licenses()
                   from licenses import Licenses
>>  entity_list = self.service.get_licenses()
Module licenses.service:44 in get_licenses
<<          except Exception, inst:
                   msg = "Couldn't connect to licenses service: %s" % inst
                   raise Exception, msg
                   licenses = loads(response_body)
>>  raise Exception, msg
Exception: Couldn't connect to licenses service: <urlopen error (104, 'Connection reset by peer')>

Change History

comment:1 Changed 3 years ago by thejimmyg

  • Priority changed from awaiting triage to minor
  • Summary changed from Exception: Couldn't connect to licenses service to Handle the case when the licenses service is down better

The licenses service was down, it is back up now. We should be able to cope with this situation better though. Renaming the ticket.

comment:2 Changed 3 years ago by rgrp

  • Owner set to rgrp
  • Milestone set to ckan-v1.4

comment:3 Changed 3 years ago by rgrp

  • Status changed from new to closed
  • Resolution set to fixed

I'm closing this ticket as a) most systems should install the licenses package (and hence have the licenses locally) and b) licenses service has now moved to s3 so should be very robust (see ticket:973 and http://knowledgeforge.net/okfn/tasks/ticket/605)

Note: See TracTickets for help on using tickets.