Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facts page has issue with complicated Fact values #73

Closed
wleese opened this issue May 20, 2014 · 8 comments
Closed

Facts page has issue with complicated Fact values #73

wleese opened this issue May 20, 2014 · 8 comments

Comments

@wleese
Copy link

wleese commented May 20, 2014

This causes all kinds of havoc on the /facts page:

mwapp_entitlement_0_status=<html><head><title>apache tomcat/6.0.26 - error report</title><style><!--h1 {font-family:tahoma,arial,sans-serif;color:white;background-color:#525d76;font-size:22px;} h2 {font-family:tahoma,arial,sans-serif;color:white;background-color:#525d76;font-size:16px;} h3 {font-family:tahoma,arial,sans-serif;color:white;background-color:#525d76;font-size:14px;} body {font-family:tahoma,arial,sans-serif;color:black;background-color:white;} b {font-family:tahoma,arial,sans-serif;color:white;background-color:#525d76;} p {font-family:tahoma,arial,sans-serif;background:white;color:black;font-size:12px;}a {color : black;}a.name {color : black;}hr {color : #525d76;}--></style> </head><body><h1>http status 401 - </h1><hr size="1" noshade="noshade"><p><b>type</b> status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>this request requires http authentication ().</u></p><hr size="1" noshade
@daenney
Copy link
Member

daenney commented May 20, 2014

What is the issue? The code line is barely legible and I can't actually deduce from it what is going on. A screenshot would go a long way here 😄.

@wleese
Copy link
Author

wleese commented May 20, 2014

Sorry about that, here you go:

http://imgur.com/BoRiC2H

Great tool by the way!

@daenney
Copy link
Member

daenney commented May 20, 2014

Wow. Actually, I'd say those facts are broken. The fact name suddenly contains HTML, that's not right. You're using the /facts endpoint which should basically return a list of facts, never any kind of value.

What does facter -p show on a machine that has those complex facts? I'm wondering if it's Facter output that's changed or if it's being stored incorrectly on PuppetDB.

To clarify, I would expect mwapp_entitlement_0_status to show up, not with the whole =HTML BLOB thing behind it.

@wleese
Copy link
Author

wleese commented May 20, 2014

The fact is correct and contains a html page.
Facter displays it as a string without linebreaks, which we replaced with
forward slash n, as part of the custom fact code.
On May 20, 2014 6:06 PM, "Daniele Sluijters" notifications@github.com
wrote:

Wow. Actually, I'd say those facts are broken. The fact name suddenly
contains HTML, that's not right. You're using the /facts endpoint which
should basically return a list of facts.

What does facter -p show on a machine that has those complex facts? I'm
wondering if it's Facter output that's changed or if it's being stored
incorrectly on PuppetDB.


Reply to this email directly or view it on GitHubhttps://github.com/nedap/puppetboard/issues/73#issuecomment-43602271
.

@daenney
Copy link
Member

daenney commented May 20, 2014

Well, having a Fact name show up with all the HTML is certainly not right so something weird is going on.

If you try the following, on a node that runs PuppetDB:

  • curl http://localhost:8080/v3/fact-names
  • curl http://localhost:8080/v3/node/$a_node_with_that_fact/facts

Feel free to scrub the output for sensitive things.

The second curl command should give you a list of Facts with their name and their value. Your fact should look like this:

{
  "certname" : "a_node_with_that_fact",
  "name" : "mwapp_entitlement_0_status",
  "value" : "<html><head><title>apache tomcat/6.0.26 - error report</title><style><!--h1 {font-family:tahoma,arial,sans-serif;color:white;background-color:#525d76;font-size:22px;} h2 {font-family:tahoma,arial,sans-serif;color:white;background-color:#525d76;font-size:16px;} h3 {font-family:tahoma,arial,sans-serif;color:white;background-color:#525d76;font-size:14px;} body {font-family:tahoma,arial,sans-serif;color:black;background-color:white;} b {font-family:tahoma,arial,sans-serif;color:white;background-color:#525d76;} p {font-family:tahoma,arial,sans-serif;background:white;color:black;font-size:12px;}a {color : black;}a.name {color : black;}hr {color : #525d76;}--></style> </head><body><h1>http status 401 - </h1><hr size="1" noshade="noshade"><p><b>type</b> status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>this request requires http authentication ().</u></p><hr size="1" noshade"
},

What I'm betting on is that we'll see the name of the fact contain the HTML which should be in the value key, not the name key, like this:

{
  "certname" : "a_node_with_that_fact",
  "name" : "mwapp_entitlement_0_status=<html><head><title>apache tomcat/6.0.26 - error report</title><style><!--h1 {font-family:tahoma,arial,sans-serif;color:white;background-color:#525d76;font-size:22px;} h2 {font-family:tahoma,arial,sans-serif;color:white;background-color:#525d76;font-size:16px;} h3 {font-family:tahoma,arial,sans-serif;color:white;background-color:#525d76;font-size:14px;} body {font-family:tahoma,arial,sans-serif;color:black;background-color:white;} b {font-family:tahoma,arial,sans-serif;color:white;background-color:#525d76;} p {font-family:tahoma,arial,sans-serif;background:white;color:black;font-size:12px;}a {color : black;}a.name {color : black;}hr {color : #525d76;}--></style> </head><body><h1>http status 401 - </h1><hr size="1" noshade="noshade"><p><b>type</b> status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>this request requires http authentication ().</u></p><hr size="1" noshade",
  "value" : ""
},

@wleese
Copy link
Author

wleese commented May 20, 2014

Alright, will get back to you tomorrow with this output

@wleese
Copy link
Author

wleese commented May 20, 2014

So in the end it was indeed a bug in the fact name generation. Thanks for the time anyway and keep up the good work!

@wleese wleese closed this as completed May 20, 2014
@daenney
Copy link
Member

daenney commented May 21, 2014

Glad I could help!

b4ldr pushed a commit to b4ldr/puppetboard that referenced this issue Feb 19, 2020
* docs/api.rst: Updating documentation with the new API model.

The previous documentation has not been changed with the 0.1.1 release.

* pypuppetdb/types.py: Fixing tests about line length.

Shortening the length of the documentation string lines to fix failing tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants