Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
aarranz opened this issue Jul 18, 2016 · 5 comments

Comments

@aarranz
Copy link
Member

aarranz commented Jul 18, 2016

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 aarranz added this to the Jul 2016 milestone Jul 18, 2016
@aarranz aarranz self-assigned this Jul 18, 2016
@aarranz aarranz 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 Jul 18, 2016
@aarranz
Copy link
Member Author

aarranz commented Jul 19, 2016

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

@markrey
Copy link

markrey commented Aug 15, 2016

@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

@aarranz
Copy link
Member Author

aarranz commented Aug 17, 2016

@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 aarranz modified the milestones: Jul 2016, Sep 2016 Sep 5, 2016
@aarranz
Copy link
Member Author

aarranz commented Oct 4, 2016

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 aarranz closed this as completed Oct 4, 2016
@aarranz aarranz added the v1.0.0 label Oct 4, 2016
@aarranz
Copy link
Member Author

aarranz commented Oct 25, 2016

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 aarranz reopened this Oct 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants