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

CLI comms with pfcon returns http errors #71

Open
rudolphpienaar opened this issue May 6, 2019 · 8 comments
Open

CLI comms with pfcon returns http errors #71

rudolphpienaar opened this issue May 6, 2019 · 8 comments

Comments

@rudolphpienaar
Copy link

Calling pfcon from the CLI results in pfcon activity, however the final status returned from pfcon or the interpretation thereof in pfurl is an http error.

@rudolphpienaar rudolphpienaar changed the title CLI comms with pfcon return http errors CLI comms with pfcon returns http errors May 6, 2019
@rudolphpienaar
Copy link
Author

Comms with pfcon, say hello or get/set do trigger the correct behaviour in pfcon, but the return to pfurl is incorrect.

@rudolphpienaar
Copy link
Author

Steps:

  1. Checkout pfcon repo
  2. unmake
  3. make

This will result in a system of pfcon, pman, and pfioh all up and running.

@rudolphpienaar
Copy link
Author

Now, attempt to query pfcon for the state of an internal variable:

(where HOST_IP == IP of host running pfcon)

pfurl --verb POST --raw --http ${HOST_IP}:5005/api/v1/cmd \
    --httpResponseBodyParse --jsonwrapper 'payload' \
    --msg '{  "action": "internalctl",
    "meta": {
                "var":     "/service",
                "get":      "value"
            }
}'

@rudolphpienaar
Copy link
Author

In the pfcon terminal, you should see the correct reply:

{   'd_ret': {   'service': {   'host': {   'compute': {   'addr': '172.21.0.4:5010',
                                                           'authToken': 'password',
                                                           'baseURLpath': 'api/v1/cmd/',
                                                           'status': 'undefined'},
                                            'data': {   'addr': '172.21.0.2:5055',
                                                        'authToken': 'password',
                                                        'baseURLpath': 'api/v1/cmd/',
                                                        'status': 'undefined'}},
                                'localhost': {   'compute': {   'addr': '127.0.0.1:5010',
                                                                'baseURLpath': 'api/v1/cmd/',
                                                                'status': 'undefined'},
                                                 'data': {   'addr': '127.0.0.1:5055',
                                                             'baseURLpath': 'api/v1/cmd/',
                                                             'status': 'undefined'}},
                                'moc': {   'compute': {   'addr': 'pman-radiology.k-apps.osh.massopen.cloud',
                                                          'baseURLpath': 'api/v1/cmd/',
                                                          'status': 'undefined'},
                                           'data': {   'addr': 'pfioh-radiology.k-apps.osh.massopen.cloud',
                                                       'baseURLpath': 'api/v1/cmd/',
                                                       'status': 'undefined'}},
                                'openshiftlocal': {   'compute': {   'addr': 'pman-myproject.127.0.0.1.nip.io',
                                                                     'authToken': 'password',
                                                                     'baseURLpath': 'api/v1/cmd/',
                                                                     'status': 'undefined'},
                                                      'data': {   'addr': 'pfioh-myproject.127.0.0.1.nip.io',
                                                                  'authToken': 'password',
                                                                  'baseURLpath': 'api/v1/cmd/',
                                                                  'status': 'undefined'}}}},
    'status': True}

This should be returned to pfurl. Instead, pfurl seems to get:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"                                                                                                                                                                               
"http://www.w3.org/TR/html4/loose.dtd">                                                                                                                                                                                                      
<html>                                                                                                                                                                                                                                       
<head>                                                                                                                                                                                                                                       
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">                                                                                                                                                                          
<title>Notification: Gateway Timeout</title>                                                                                                                                                                                                 

<style type="text/css">                                                                                                                                                                                                                      
body {                                                                                                                                                                                                                                       
  font-family: Arial, Helvetica, sans-serif;                                                                                                                                                                                                 
  font-size: 14px;                                                                                                                                                                                                                           
  color:#333333;                                                                                                                                                                                                                             
  background-color: #ffffff;                                                                                                                                                                                                                 
}                                                                                                                                                                                                                                            
h1 {                                                                                                                                                                                                                                         
  font-size: 18px;                                                                                                                                                                                                                           
  font-weight: bold;                                                                                                                                                                                                                         
  text-decoration: none;                                                                                                                                                                                                                     
  padding-top: 0px;                                                                                                                                                                                                                          
  color: #2970A6;                                                                                                                                                                                                                            
}                                                                                                                                                                                                                                            
a:link {                                                                                                                                                                                                                                     
    color: #2970A6;                                                                                                                                                                                                                          
  text-decoration: none;                                                                                                                                                                                                                     
}                                                                                                                                                                                                                                            
a:hover {                                                                                                                                                                                                                                    
    color: #2970A6;                                                                                                                                                                                                                          
  text-decoration: underline;                                                                                                                                                                                                                
}                                                                                                                                                                                                                                            
p.buttonlink {                                                                                                                                                                                                                               
  margin-bottom: 24px;                                                                                                                                                                                                                       
}                                                                                                                                                                                                                                            
.copyright {                                                                                                                                                                                                                                 
  font-size: 12px;                                                                                                                                                                                                                           
  color: #666666;                                                                                                                                                                                                                            
  margin: 5px 5px 0px 30px;                                                                                                                                                                                                                  

}                                                                                                                                                                                                                                            
.details {                                                                                                                                                                                                                                   
  font-size: 14px;                                                                                                                                                                                                                           
  color: #969696;                                                                                                                                                                                                                            
  border: none;                                                                                                                                                                                                                              
  padding: 20px 20px 20px 20px;                                                                                                                                                                                                              
  margin: 0px 10px 10px 35px;                                                                                                                                                                                                                
}                                                                                                                                                                                                                                            

.shadow {                                                                                                                                                                                                                                    
  border: 3px solid #9f9f9f;                                                                                                                                                                                                                 
  padding: 10px 25px 10px 25px;                                                                                                                                                                                                              
  margin: 10px 35px 0px 30px;                                                                                                                                                                                                                
  background-color: #ffffff;                                                                                                                                                                                                                 
  width: 600px;                                                                                                                                                                                                                              

  -moz-box-shadow: 3px 3px 3px #cccccc;                                                                                                                                                                                                      
  -webkit-box-shadow: 3px 3px 3px #cccccc;                                                                                                                                                                                                   
  box-shadow: 3px 3px 3px #cccccc;                                                                                                                                                                                                           
  /* For IE 8 */                                                                                                                                                                                                                             
  -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=5, Direction=135, Color='cccccc')";                                                                                                                                         
  /* For IE 5.5 - 7 */                                                                                                                                                                                                                       
  filter: progid:DXImageTransform.Microsoft.Shadow(Strength=5, Direction=135, Color='cccccc');                                                                                                                                               
}                                                                                                                                                                                                                                            
.logo {                                                                                                                                                                                                                                      
  border: none;                                                                                                                                                                                                                              
  margin: 5px 5px 0px 30px;                                                                                                                                                                                                                  
}                                                                                                                                                                                                                                            
</style>                                                                                                                                                                                                                                     

</head>                                                                                                                                                                                                                                      

<body>                                                                                                                                                                                                                                       
<div class="logo"></div><p>&nbsp;</p>                                                                                                                                                                                                        
<div class="shadow">                                                                                                                                                                                                                         
<h1>This Page Cannot Be Displayed</h1>                                                                                                                                                                                                       


<p>                                                                                                                                                                                                                                          
The system cannot communicate with the external server (&nbsp;10.72.76.39&nbsp;).                                                                                                                                                            
The Internet server may be busy, may be permanently down, or may be                                                                                                                                                                          
unreachable because of network problems.                                                                                                                                                                                                     
</p>                                                                                                                                                                                                                                         

<p>                                                                                                                                                                                                                                          
Please check the spelling of the Internet address entered.                                                                                                                                                                                   
If it is correct, try this request later.                                                                                                                                                                                                    
</p>                                                                                                                                                                                                                                         



<p>                                                                                                                                                                                                                                          
If you have questions, please contact                                                                                                                                                                                                        
your organization's network administrator                                                                                                                                                                                                    
and provide the codes shown below.                                                                                                                                                                                                           
</p>                                                                                                                                                                                                                                         

</div>                                                                                                                                                                                                                                       

<div class="details"><p>                                                                                                                                                                                                                     
Date: Mon, 06 May 2019 21:59:56 GMT<br />                                                                                                                                                                                                    
Username: <br />                                                                                                                                                                                                                             
Source IP: 10.72.76.39<br />                                                                                                                                                                                                                 
URL: POST http://10.72.76.39/api/v1/cmd/<br />                                                                                                                                                                                               
Category: Uncategorized URLs<br />                                                                                                                                                                                                           
Reason: UNKNOWN<br />                                                                                                                                                                                                                        
Notification: GATEWAY_TIMEOUT                                                                                                                                                                                                                
</p></div>                                                                                                                                                                                                                                   
</body>                                                                                                                                                                                                                                      
</html>      

@rudolphpienaar
Copy link
Author

Behaviour seems invariant of pfurl auth flags. Have tried:

pfurl --authToken "" --unverifiedCerts \
    --verbosity 5 --verb POST --raw \
    --http ${HOST_IP}:5005/api/v1/cmd/ \           
    --httpResponseBodyParse --jsonwrapper 'payload' \
    --msg '{  "action": "hello",
    "meta": {                         
                "askAbout":     "sysinfo",
                "echoBack":      "Hi there!",
                "service":       "host"
            }
}

@rudolphpienaar
Copy link
Author

@danmcp ^^^ Any ideas perhaps? Is that what had been reported with issues calling hello to pfcon? I have spent a good day or so trying to debug / trace but do not know where/how/why this might be occurring.

@danmcp
Copy link
Contributor

danmcp commented May 10, 2019

@rudolphpienaar It doesn't appear there was a recent change that would have caused this. @husky-parul Are you seeing the same thing?

@rudolphpienaar
Copy link
Author

I figured out the issue. It's fixed in my local, so I'll rebase, push, etc. This probably will be on Monday.

I think it has been very long standing issue that was probably not noticed for a rather long time.

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