Jira (PUP-10641) Puppet Module Tool gives unhelpful error message for bad module name

34 views
Skip to first unread message

Ben Ford (Jira)

unread,
Aug 24, 2020, 9:16:03 PM8/24/20
to puppe...@googlegroups.com
Ben Ford assigned an issue to Unassigned
 
Puppet / Improvement PUP-10641
Puppet Module Tool gives unhelpful error message for bad module name
Change By: Ben Ford
Key: FORGE PUP - 228 10641
Assignee: Ryan Coleman
Project: Puppet Forge
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Josh Cooper (Jira)

unread,
Aug 24, 2020, 9:30:03 PM8/24/20
to puppe...@googlegroups.com
Josh Cooper commented on Improvement PUP-10641
 
Re: Puppet Module Tool gives unhelpful error message for bad module name

This is actually a forge issue. It's returning HTTP 400 which means "the client sent a bad request" instead of 404 which would mean "the thing you asked for doesn't exist". The PMT should only say the ntp modules wasn't found in the 404 case.

Josh Cooper (Jira)

unread,
Aug 25, 2020, 1:20:03 AM8/25/20
to puppe...@googlegroups.com
Josh Cooper commented on Improvement PUP-10641

It could also be a PMT issue if it’s not sending a qualified name. So if you specify ntp then perhaps it should send an empty forge name resulting in “/ntp”

Ben Ford (Jira)

unread,
Aug 26, 2020, 7:27:03 PM8/26/20
to puppe...@googlegroups.com
Ben Ford commented on Improvement PUP-10641

Should the PMT validate the name prior to making the request in the first place and just error out?

We could also provide a forge search api that returns an array of all module slugs that match the name exactly.

Josh Cooper (Jira)

unread,
Sep 30, 2020, 1:28:03 PM9/30/20
to puppe...@googlegroups.com
Josh Cooper commented on Improvement PUP-10641

Should the PMT validate the name prior to making the request in the first place and just error out?

Yes the PMT should totally do that.

Ben Ford (Jira)

unread,
Dec 21, 2020, 5:43:03 PM12/21/20
to puppe...@googlegroups.com

Ben Ford (Jira)

unread,
Dec 21, 2020, 5:43:03 PM12/21/20
to puppe...@googlegroups.com
Ben Ford commented on Improvement PUP-10641
 
Re: Puppet Module Tool gives unhelpful error message for bad module name

Jesse Scott What do you think about these HTTP response?

[~]$ curl -i https://forgeapi.puppet.com/v3/modules/ntp                                                                                                                                                                                                                   [ruby-2.6.5@forge_ruby]
HTTP/1.1 400 Bad Request
server: nginx
date: Mon, 21 Dec 2020 22:39:04 GMT
content-type: application/json
content-length: 60
cache-control: public, must-revalidate
etag: "aebd38f7ea0331d668e149b2a9f58e28"
vary: Origin,Accept-Encoding
x-content-type-options: nosniff
x-app-server: forgeapi/forgeapi-forgenext-app-prod-1.ops.puppetlabs.net
x-lb-server: forgenext-lb-prod-1
x-uuid: 472474BD:E9A9_0AE100EB:01BB_5FE12408_433BBD2:6004
 
{
  "errors": [
    "'ntp' is not a valid module slug"
  ]
}%
 
 
[~]$ curl -i https://forgeapi.puppet.com/v3/modules/foo-ntp                                                                                                                                                                                                               [ruby-2.6.5@forge_ruby]
HTTP/1.1 404 Not Found
server: nginx
date: Mon, 21 Dec 2020 22:39:09 GMT
content-type: application/json
content-length: 95
etag: "5fd7a0fe-5f"
x-app-server: forgeapi/forgeapi-forgenext-app-prod-8.ops.puppetlabs.net
x-lb-server: forgenext-lb-prod-1
x-uuid: 472474BD:E9AA_0AE100EB:01BB_5FE1240D_433BC4D:6004
 
{
  "message": "404 Not Found",
  "errors": ["The requested resource could not be found."]
}
 
 
[~]$ curl -i https://forgeapi.puppet.com/v3/modules/puppetlabs-ntp                                                                                                                                                                                                        [ruby-2.6.5@forge_ruby]
HTTP/1.1 200 OK
server: nginx
date: Mon, 21 Dec 2020 22:39:32 GMT
content-type: application/json
content-length: 66625
cache-control: public, must-revalidate
last-modified: Thu, 17 Dec 2020 08:33:38 GMT
etag: "c1c7704f41c19399cb249a76fe5021b3"
vary: Origin,Accept-Encoding
x-content-type-options: nosniff
x-app-server: forgeapi/forgeapi-forgenext-app-prod-1.ops.puppetlabs.net
x-lb-server: forgenext-lb-prod-2
x-uuid: 472474BD:E9AC_0AE10168:01BB_5FE12424_6F8FC0A:4254
 
{
  "uri": "/v3/modules/puppetlabs-ntp",
  "slug": "puppetlabs-ntp",
  "name": "ntp",
...
}

Jesse Scott (Jira)

unread,
Jan 4, 2021, 1:32:02 PM1/4/21
to puppe...@googlegroups.com
Jesse Scott commented on Improvement PUP-10641

Jesse Scott What do you think about these HTTP responses?

I'm not sure what you mean? Those are the current API responses correct? PMT could dig in to the JSON returned to display the more detailed error messages, but in the case of a module slug being the expected parameter, I agree that PMT should validate the format before even sending the request ideally.

Josh Cooper (Jira)

unread,
Jun 21, 2021, 1:27:02 PM6/21/21
to puppe...@googlegroups.com
Josh Cooper assigned an issue to Josh Cooper
 
Change By: Josh Cooper
Assignee: Jesse Scott Josh Cooper
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Josh Cooper (Jira)

unread,
Jun 21, 2021, 1:27:02 PM6/21/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jun 21, 2021, 1:27:02 PM6/21/21
to puppe...@googlegroups.com

Gabriel Nagy (Jira)

unread,
Jun 25, 2021, 3:15:01 AM6/25/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jun 29, 2021, 1:46:02 PM6/29/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 7.9.0
Fix Version/s: PUP 6.24.0

Josh Cooper (Jira)

unread,
Jun 29, 2021, 2:24:01 PM6/29/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes: Enhancement
Release Notes Summary: The "puppet module install <author-module>" command prints a better error if the author component of the name is omitted.

Claire Cadman (Jira)

unread,
Jul 13, 2021, 6:42:04 AM7/13/21
to puppe...@googlegroups.com
Claire Cadman updated an issue
Change By: Claire Cadman
Labels: doc-reviewed moduletool pmt
Reply all
Reply to author
Forward
0 new messages