wirecloud icon indicating copy to clipboard operation
wirecloud copied to clipboard

"No valid parse found" exceptions are not reported correctly when installing embedded components

Open aarranz opened this issue 9 years ago • 5 comments

Everytime a "No parse found" exception is raised while installing embedded responses, WireCloud responds with an internal server error response. WireCloud should respond with a 400 error response and with a proper error message.

Moreover, WireCloud should use a better error message for end-users (instead of the "No valid parse found" message). Something like, "Unable to process the component description file". And something like "The description file used by this component is not longer supported" if we detect that the component is using the old http://wirecloud.conwet.fi.upm.es/ns/template# description format.

Stack Trace (from FIWARE Lab, version 0.9.2):

Traceback:

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  149.                     response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  147.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python2.7/dist-packages/wirecloud/commons/baseviews/resource.py" in __call__
  57.             response = getattr(self, METHOD_MAPPING[request_method])(request, *args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/wirecloud/commons/utils/http.py" in wrapper
  239.         return func(self, request, *args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/wirecloud/commons/utils/http.py" in wrapper
  281.             return func(self, request, *args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/wirecloud/commons/utils/http.py" in wrapper
  267.             return func(self, request, *args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/wirecloud/commons/utils/transaction.py" in wrapped_func
  28.             res = func(*args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/wirecloud/platform/localcatalogue/views.py" in create
  182.                     extra_resource_added, extra_resource = install_resource_to_user(request.user, file_contents=extra_resource_contents, raise_conflicts=False)

File "/usr/local/lib/python2.7/dist-packages/wirecloud/platform/localcatalogue/utils.py" in install_resource_to_user
  71.     resource = install_resource(downloaded_file, executor_user)

File "/usr/local/lib/python2.7/dist-packages/wirecloud/platform/localcatalogue/utils.py" in install_resource
  54.     template = TemplateParser(template_contents)

File "/usr/local/lib/python2.7/dist-packages/wirecloud/commons/utils/template/parsers/__init__.py" in __init__
  63.             raise TemplateParseException('No valid parser found')

aarranz avatar Jul 18 '16 14:07 aarranz

I've created a test for this case (it didn't exists), but is working as expected. I'm investigating.

aarranz avatar Jul 19 '16 10:07 aarranz

@aarranz How to upgrade my recently developed https://wirecloud.conwet.fi.upm.es/ns/template# based widget ? Any documentations on migration ?

-- Update Sorry for quick comment: found it wirecloud-admin convert -d xml config.xml config.xml

markrey avatar Aug 15 '16 22:08 markrey

@markrey Yeah, that's the command :). The only thing to take into account is that you have to use WireCloud 0.9.0 or bellow for being able to convert old description files ;-).

aarranz avatar Aug 17 '16 10:08 aarranz

We have deployed WireCloud 1.0 on FIWARE Lab. For the moment, there are not errors related to this error message, so I'm going to close this ticket.

aarranz avatar Oct 04 '16 11:10 aarranz

New exception from FIWARE Lab:

Traceback:

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  149.                     response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  147.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python2.7/dist-packages/wirecloud/commons/baseviews/resource.py" in __call__
  57.             response = getattr(self, METHOD_MAPPING[request_method])(request, *args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/wirecloud/commons/utils/http.py" in wrapper
  239.         return func(self, request, *args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/wirecloud/commons/utils/http.py" in wrapper
  281.             return func(self, request, *args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/wirecloud/commons/utils/http.py" in wrapper
  267.             return func(self, request, *args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/wirecloud/commons/utils/transaction.py" in wrapped_func
  28.             res = func(*args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/wirecloud/platform/localcatalogue/views.py" in create
  194.                         extra_resource_added, extra_resource = install_resource_to_user(request.user, file_contents=extra_resource_contents, raise_conflicts=False)

File "/usr/local/lib/python2.7/dist-packages/wirecloud/platform/localcatalogue/utils.py" in install_resource_to_user
  77.     resource = install_resource(downloaded_file, executor_user)

File "/usr/local/lib/python2.7/dist-packages/wirecloud/platform/localcatalogue/utils.py" in install_resource
  56.     template = TemplateParser(template_contents)

File "/usr/local/lib/python2.7/dist-packages/wirecloud/commons/utils/template/parsers/__init__.py" in __init__
  57.                 self._parser = parser(template)

File "/usr/local/lib/python2.7/dist-packages/wirecloud/commons/utils/template/parsers/xml.py" in __init__
  127.             raise ObsoleteFormatError()

Exception Type: ObsoleteFormatError at /api/resources
Exception Value: Component description uses a no longer supported format

aarranz avatar Oct 25 '16 13:10 aarranz