Skip to content

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

Open

Description

@aarranz

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')

Activity

  1. added this to the Jul 2016 milestone on Jul 18, 2016
  2. self-assigned this
    on Jul 18, 2016
  3. changed the title [-]"No parse found" exceptions are not reported correctly when installing embedded components[/-] [+]"No valid parse found" exceptions are not reported correctly when installing embedded components[/+] on Jul 18, 2016
  4. aarranz commented on Jul 19, 2016

    @aarranz
    MemberAuthor

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

  5. markrey commented on Aug 15, 2016

    @markrey

    @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

  6. aarranz commented on Aug 17, 2016

    @aarranz
    MemberAuthor

    @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 ;-).

  7. modified the milestones: Jul 2016, Sep 2016 on Sep 5, 2016
  8. aarranz commented on Oct 4, 2016

    @aarranz
    MemberAuthor

    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.

  9. aarranz commented on Oct 25, 2016

    @aarranz
    MemberAuthor

    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
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions