Bug 1128269 - Malformed Puppet Modules Cause Pulp Exception
Summary: Malformed Puppet Modules Cause Pulp Exception
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Pulp
Classification: Retired
Component: puppet-support
Version: 2.4 Beta
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
: ---
Assignee: Jeremy Cline
QA Contact: pulp-qe-list
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-08 18:29 UTC by Brian Bouterse
Modified: 2017-01-05 14:14 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-28 22:15:08 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Pulp Redmine 487 None None None Never

Description Brian Bouterse 2014-08-08 18:29:35 UTC
Description of problem: If a puppet module is malformed Pulp shows the user an exception. Malformed could be that the full module name is missing an author (0 dashed is full module name) or that the name portion of the full module name contains additional dashes. The second case is one example in the traceback below for the puppet module named "windows_xmltask-0.0.3".


How reproducible: Always, as long as puppet modules on puppetforge are malformed as described above.


Steps to Reproduce:
1. Add a puppet repo setup to sync puppet forget with no filter
2. Perform a sync
3. Observe the traceback

Actual results:
Most of it sync's, but you'll receive output like this:
 progress_report:
    puppet_importer:
      modules:
        traceback: 
        execution_time: 3
        total_count: 138
        error_message: 
        finished_count: 2
        state: success
        error_count: 136
        error: None
        individual_errors:
        - exception: need more than 1 value to unpack
          traceback:
          - - /usr/lib/python2.6/site-packages/pulp_puppet/plugins/importers/forge.py
            - 270
            - _do_import_modules
            - self._add_new_module(downloader, module)
          - - /usr/lib/python2.6/site-packages/pulp_puppet/plugins/importers/forge.py
            - 318
            - _add_new_module
            - module = Module.from_json(metadata_json)
          - - /usr/lib/python2.6/site-packages/pulp_puppet/common/model.py
            - 124
            - from_json
            - author, name = module_json.get('name').split("-", 1)
          module: windows_xmltask-0.0.3
          author: noma4i
        - exception: need more than 1 value to unpack
          traceback:
          - - /usr/lib/python2.6/site-packages/pulp_puppet/plugins/importers/forge.py
            - 270
            - _do_import_modules
            - self._add_new_module(downloader, module)
          - - /usr/lib/python2.6/site-packages/pulp_puppet/plugins/importers/forge.py
            - 318
            - _add_new_module
            - module = Module.from_json(metadata_json)
          - - /usr/lib/python2.6/site-packages/pulp_puppet/common/model.py
            - 124
            - from_json
            - author, name = module_json.get('name').split("-", 1)


I expect two behaviors:
1. Pulp should handle named puppet modules without exactly one dash in them more gracefully.
2. If it absolutely can't handle the puppet module a coded exception or nicer message should be shown to the user.

Comment 1 Sayli Karmarkar 2014-08-13 15:59:36 UTC
We need to raise a validation error with information about why the validation failed instead of a generic traceback.

Comment 2 Brian Bouterse 2015-02-28 22:15:08 UTC
Moved to https://pulp.plan.io/issues/487


Note You need to log in before you can comment on or make changes to this bug.