[Pulp-list] puppet_forge on Pulp 2.9.2 400 BAD REQUEST

Russell E. Glaue rglaue at cait.org
Thu Sep 1 19:14:14 UTC 2016

I have resolved my own issue.

I appears that the problem is with puppet, and not with pulp.

In my last upgrade, when puppet was also upgraded, my /etc/puppet/puppet.conf file had some configuration reverted to the old environment settings.
regarding the [production] and [development] sections, the one that causes the following warning message:
Warning: Sections other than main, master, agent, user are deprecated in puppet.conf. Please use the directory environments feature to specify environments. (See http://docs.puppetlabs.com/puppet/latest/reference/environments.html)
   (at /usr/lib/ruby/site_ruby/1.8/puppet/settings/config_file.rb:82:in `unique_sections_in')

I went back and fixed the configuration to support the newer expected configuration for environments, setting environmentpath and basemodulepath variables in [main], and now I am no longer getting 400 BAD REQUEST. The modules install successfully.

This is really odd though. It makes me think their is some underlying compatibility issue when either handling this case specifically, or when handling some kind of regression in the request.


----- Original Message -----
From: "Russell E. Glaue" <rglaue at cait.org>
To: "pulp-list" <pulp-list at redhat.com>
Sent: Friday, August 26, 2016 5:45:04 PM
Subject: [Pulp-list] puppet_forge on Pulp 2.9.2 400 BAD REQUEST

I upgraded pulp from 2.7 to 2.8 to 2.9.2, and now am getting an error when performing a "puppet module upgrade" on a puppet server that obtains the puppet module from a pulp_puppet repository.

I am using the new syntax, as documented in the source code (/usr/lib/python2.7/site-packages/pulp_puppet/forge/views/releases.py)
    def get(self, request, resource_type=None, resource=None):
        Credentials here are not actually used for authorization, but instead
        are used to identify:

            consumer ID in the username field
            repository ID in the password field

        This is to work around the fact that the "puppet module install"
        command has hard-coded absolute paths, so we cannot put consumer or
        repository IDs in the URL's path.

Previously with Pulp 2.7 puppet_forge, to upgrade a puppet module I would do this successfully.
puppet module upgrade org-server_user_mgmt --environment production --module_repository http://pulp.example.com/pulp_puppet/forge/repository/puppet-org-modules --verbose
However, in Pulp 2.9.2, I get a "401 UNAUTHORIZED"

So, hence I use the new syntax, as follows, but getting a 400 error:
puppet module upgrade org-server_user_mgmt --environment production --module_repository http://.:puppet-org-modules@pulp.example.com/pulp_puppet/forge/repository/puppet-org-modules --verbose
Notice: Preparing to upgrade 'org-server_user_mgmt' ...
Notice: Found 'org-server_user_mgmt' (v1.0.3) in /etc/puppet/environments/production/modules ...
Error: Request to Puppet Forge failed.
  The server being queried was http://.:puppet-org-modules@pulp.example.com/v3/releases?limit=20&module=org%2Fserver_user_mgmt&offset=20
  The HTTP response we received was '400 BAD REQUEST'

However, if I curl that URL, I get a 200 OK
curl -v 'http://.:puppet-org-modules@pulp.example.com/v3/releases?limit=20&module=org%2Fserver_user_mgmt&offset=20'
< HTTP/1.1 200 OK
{"pagination": {"total": 23, "next": null, "current": "/v3/releases?limit=20&module=org%2Fserver_user_mgmt&offset=20", "limit": 20, "offset": 20, "first": "/v3/releases?limit=20&module=org%2Fserver_user_mgmt&offset=0", "previous": "/v3/releases?limit=20&module=org%2Fserver_user_mgmt&offset=0"}, "results": [{"file_uri": "/pulp/puppet/puppet-org-modules/system/releases/c/org/org-server_user_mgmt-0.9.1.tar.gz", "file_md5": "dfae4f555897b6d267ea9bbe0730676a", "metadata": {"version": "0.9.1", "name": "org/server_user_mgmt", "dependencies": [{"name": "puppetlabs-stdlib", "version_requirement": ">= 0.0.0"}]}}, {"file_uri": "/pulp/puppet/puppet-org-modules/system/releases/c/org/org-server_user_mgmt-0.9.5.tar.gz", "file_md5": "64828c52d568f03f77f2a1de969debdb", "metadata": {"version": "0.9.5", "name": "org/server_user_mgmt", "dependencies": [{"name": "puppetlabs-stdlib", "version_requirement": ">= 0.0.0"}]}}, {"file_uri": "/pulp/puppet/puppet-org-modules/system/releases/c/org/org-ser!
 ver_user_mgmt-0.9.20.tar.gz", "file_md5": "8d5c2a3b0c7a79f6d9403bfc38d5765a", "metadata": {"version": "0.9.20", "name": "org/server_user_mgmt", "dependencies": [{"name": "puppetlabs-stdlib", "version_requirement": ">= 0.0.0"}]}}]}

What is more, this module (org-server_user_mgmt) is currently on version 1.0.4 (the 23rd version; first release is 0.9.1)

What should I do to make `puppet module upgrade` work, with Pulp 2.9.2 puppet_forge?


Pulp-list mailing list
Pulp-list at redhat.com

More information about the Pulp-list mailing list