Bug 1128269

Summary: Malformed Puppet Modules Cause Pulp Exception
Product: [Retired] Pulp Reporter: Brian Bouterse <bmbouter>
Component: puppet-supportAssignee: Jeremy Cline <jcline>
Status: CLOSED UPSTREAM QA Contact: pulp-qe-list
Severity: unspecified Docs Contact:
Priority: medium    
Version: 2.4 BetaCC: egolov, jcline, skarmark
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-28 22:15:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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