Bug 1027147 - Installation of an puppet module from pulp puppet repo fails when the module has no version requirement specified on the dependency modules
Installation of an puppet module from pulp puppet repo fails when the module ...
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: puppet-support (Show other bugs)
2.2
Unspecified Linux
low Severity medium
: ---
: 2.4.0
Assigned To: pulp-bugs
Irina Gulina
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-06 04:36 EST by pgustafs
Modified: 2014-08-09 02:55 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-08-09 02:55:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
verifiyng screenlog over RHEL6.5 (4.10 KB, text/plain)
2014-06-16 14:29 EDT, Irina Gulina
no flags Details

  None (edit)
Description pgustafs 2013-11-06 04:36:59 EST
Description of problem:
Installation of an puppet module from pulp puppet repo fails when the module has no version requirement specified on the dependency modules.

Version-Release number of selected component (if applicable):
pulp-admin-client-2.2.0-1.el6.noarch
pulp-puppet-admin-extensions-2.2.0-1.el6.noarch
pulp-rpm-handlers-2.2.0-1.el6.noarch
pulp-consumer-client-2.2.0-1.el6.noarch
pulp-builtins-admin-extensions-2.2.0-1.el6.noarch
pulp-agent-2.2.0-1.el6.noarch
pulp-rpm-admin-extensions-2.2.0-1.el6.noarch
pulp-puppet-consumer-extensions-2.2.0-1.el6.noarch
pulp-puppet-handlers-2.2.0-1.el6.noarch
pulp-builtins-consumer-extensions-2.2.0-1.el6.noarch
pulp-rpm-consumer-extensions-2.2.0-1.el6.noarch


How reproducible:
Always


Steps to Reproduce:
1. Create an puppet module with an dependency but with no version requirement specified. e.g.
# cat Modulefile 
name 'pgustafs-test'
version '0.0.1'
dependency 'puppetlabs/stdlib'
description "Test Module"
author 'Peter Gustafsson' 

2. Upload the module to an pulp puppet repo: 
# pulp-admin puppet repo uploads upload -f /tmp/test/pkg/pgustafs-test-0.0.1.tar.gz  --repo-id test1

3. Publish the repo: 
# pulp-admin puppet repo publish run --repo-id=test1
Actual results:

4. List the repo:
# pulp-admin puppet repo modules --repo-id=test1

Name:         stdlib
Version:      4.1.0
Author:       puppetlabs
Dependencies: 
Description:  Standard Library for Puppet Modules
License:      Apache 2.0
Project Page: https://github.com/puppetlabs/puppetlabs-stdlib
Source:       git://github.com/puppetlabs/puppetlabs-stdlib.git
Summary:      Puppet Module Standard Library
Tag List:     None
Types:        
  Doc:          A simple resource type intended to be used as an anchor in a
              composite class.    In Puppet 2.6, when a class declares another
              class, the resources in the   interior class are not contained by
              the exterior class. This interacts badly   with the pattern of
              composing complex modules from smaller classes, as it   makes it
              impossible for end users to specify order relationships between
              the   exterior class and other modules.    The anchor type lets
              you work around this. By sandwiching any interior   classes
              between two no-op resources that _are_ contained by the exterior  
              class, you can ensure that all resources in the module are
              contained.        class ntp {         # These classes will have
              the correct order relationship with each         # other. However,
              without anchors, they won't have any order         # relationship
              to Class['ntp'].         class { 'ntp::package': }         ->
              class { 'ntp::config': }         -> class { 'ntp::service': }     
              # These two resources "anchor" the composed classes within the ntp
              # class.         anchor { 'ntp::begin': } -> Class['ntp::package']
              Class['ntp::service']    -> anchor { 'ntp::end': }       }    This
              allows the end user of the ntp module to establish require and
              before   relationships with Class['ntp']:        class { 'ntp': }
              -> class { 'mcollective': }       class { 'mcollective': } ->
              class { 'ntp': }  
  Name:       anchor
  Parameters: 
    Doc:  The name of the anchor resource.
    Name: name
  Properties: 
  Doc:            Ensures that a given line is contained within a file.  The
              implementation     matches the full line, including whitespace at
              the beginning and end.  If     the line is not contained in the
              given file, Puppet will add the line to     ensure the desired
              state.  Multiple resources may be declared to manage     multiple
              lines in the same file.      Example:          file_line {
              'sudo_rule':           path => '/etc/sudoers',           line =>
              '%sudo ALL=(ALL) ALL',         }         file_line {
              'sudo_rule_nopw':           path => '/etc/sudoers',           line
              => '%sudonopw ALL=(ALL) NOPASSWD: ALL',         }      In this
              example, Puppet will ensure both of the specified lines are    
              contained in the file /etc/sudoers.  
  Name:       file_line
  Parameters: 
    Doc:  An arbitrary name used as the identity of the resource.
    Name: name
    Doc:  An optional regular expression to run against existing lines in the
          file;\nif a match is found, we replace that line rather than adding a
          new line.
    Name: match
    Doc:  The line to be appended to the file located by the path parameter.
    Name: line
    Doc:  The file Puppet will ensure contains the line specified by the line
          parameter.
    Name: path
  Properties: 
    Doc:  The basic property that the resource should be in.  Valid values are
          `present`, `absent`.
    Name: ensure

Name:         test
Version:      0.0.1
Author:       pgustafs
Dependencies: 
  Name: puppetlabs/stdlib
Description:  Test Module
License:      Apache License, Version 2.0
Project Page: UNKNOWN
Source:       UNKNOWN
Summary:      UNKNOWN
Tag List:     None
Types:        

5. Install the puppet module:
# puppet module install --module_repository=http://.:test1@mc-pulp-01 --target-dir /tmp pgustafs/test
Notice: Preparing to install into /tmp ...
Notice: Downloading from http://.:test1@mc-pulp-01 ...
Error: Could not execute operation for 'pgustafs/test'
  The server being queried was http://.:test1@mc-pulp-01
  The HTTP response we received was '500 Internal Server Error'
    Check the author and module names are correct.


And below is seen in /var/log/httpd/error_log on the pulp server.

[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100] mod_wsgi (pid=19934): Exception occurred processing WSGI script '/srv/pulp/puppet_forge_api.wsgi'.
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100] Traceback (most recent call last):
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]   File "/usr/lib/python2.6/site-packages/web/application.py", line 279, in wsgi
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]     result = self.handle_with_processors()
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]   File "/usr/lib/python2.6/site-packages/pulp/server/webservices/application.py", line 26, in _handle_with_processors
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]     return process(self.processors)
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]   File "/usr/lib/python2.6/site-packages/pulp/server/webservices/application.py", line 23, in process
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]     return p(lambda : process(processors))
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]   File "/usr/lib/python2.6/site-packages/web/application.py", line 566, in processor
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]     return handler()
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]   File "/usr/lib/python2.6/site-packages/pulp/server/webservices/application.py", line 23, in <lambda>
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]     return p(lambda : process(processors))
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]   File "/usr/lib/python2.6/site-packages/pulp/server/webservices/application.py", line 23, in process
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]     return p(lambda : process(processors))
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]   File "/usr/lib/python2.6/site-packages/web/application.py", line 581, in processor
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]     result = handler()
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]   File "/usr/lib/python2.6/site-packages/pulp/server/webservices/application.py", line 23, in <lambda>
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]     return p(lambda : process(processors))
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]   File "/usr/lib/python2.6/site-packages/pulp/server/webservices/application.py", line 25, in process
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]     return self.handle()
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]   File "/usr/lib/python2.6/site-packages/web/application.py", line 230, in handle
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]     return self._delegate(fn, self.fvars, args)
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]   File "/usr/lib/python2.6/site-packages/web/application.py", line 420, in _delegate
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]     return handle_class(cls)
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]   File "/usr/lib/python2.6/site-packages/web/application.py", line 396, in handle_class
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]     return tocall(*args)
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]   File "/usr/lib/python2.6/site-packages/pulp_puppet/forge/api.py", line 60, in GET
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]     data = releases.view(*credentials, module_name=module_name, version=version)
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]   File "/usr/lib/python2.6/site-packages/pulp_puppet/forge/releases.py", line 60, in view
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]     data = unit.build_dep_metadata()
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]   File "/usr/lib/python2.6/site-packages/pulp_puppet/forge/unit.py", line 200, in build_dep_metadata
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]     root = {self.name: [self.to_dict()]}
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]   File "/usr/lib/python2.6/site-packages/pulp_puppet/forge/unit.py", line 249, in to_dict
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]     'dependencies' : self._deps_as_list,
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]   File "/usr/lib/python2.6/site-packages/pulp_puppet/forge/unit.py", line 234, in _deps_as_list
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100]     return [[dep['name'], dep['version_requirement']] for dep in self.dependencies]
[Wed Nov 06 10:34:44 2013] [error] [client 192.168.122.100] KeyError: 'version_requirement'



Expected results:


Additional info:
Comment 1 Michael Hrivnak 2014-01-25 16:04:33 EST
https://github.com/pulp/pulp_puppet/pull/97
Comment 2 Michael Hrivnak 2014-02-11 09:44:59 EST
https://github.com/pulp/pulp_puppet/pull/97
Comment 3 Jeff Ortel 2014-04-03 09:36:08 EDT
build: 2.4.0-0.7.beta
Comment 4 Irina Gulina 2014-06-16 14:29:58 EDT
Created attachment 909206 [details]
verifiyng screenlog over RHEL6.5
Comment 5 Randy Barlow 2014-08-09 02:55:01 EDT
This has been fixed in Pulp 2.4.0-1.

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