Jira (PUP-10399) Error: wrong number of arguments (given 2, expected 1) Deferred function doesn't return file / line number

2020-03-28 Thread Henrik Lindberg (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Henrik Lindberg commented on  PUP-10399  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Error: wrong number of arguments (given 2, expected 1) Deferred function doesn't return file / line number   
 

  
 
 
 
 

 
 Hm, that is bad and something I did not think about when implementing the support for Deferred. The problem here is that the file/line is not included in the serialization of the deferred value into the catalog. Thus when it is resolved (i.e. called) on the agent side it has lost all of the context in which it was created. To fix this, when an instance of Deferred is created it needs to look on the puppet stack to get the caller's location. These two values must then be encoded in the Deferred instance, and then serialized. Then the logic that performs the call must make use of the file/line information which probably involves catch and re-raise-or-wrap depending on type of error being raised. Since this affects the serialization a decision to include file/line must depend on what the agent accepts. A compromise could be to show file/line for the resource attribute for which the deferred is resolved (IIRC those are available in the catalog). This may not be correct if the deferred is nested in some other structure, but perhaps better than nothing. Doing that would not require messing with the serialization protocol.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Jira (PDB-4679) PuppetDB 5.2.13 keep v1 metrics available

2020-03-28 Thread Bouke Haarsma (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Bouke Haarsma created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 PuppetDB /  PDB-4679  
 
 
  PuppetDB 5.2.13 keep v1 metrics available   
 

  
 
 
 
 

 
Issue Type: 
  Bug  
 
 
Affects Versions: 
 PDB 5.2.13  
 
 
Assignee: 
 Unassigned  
 
 
Components: 
 PuppetDB  
 
 
Created: 
 2020/03/28 12:43 AM  
 
 
Priority: 
  Normal  
 
 
Reporter: 
 Bouke Haarsma  
 

  
 
 
 
 

 
 PuppetDB Version: 5.2.13 OS Name/Version: CentOS 7.4 When upgrading to 5.2.12 the v1 metrics endpoint is disabled to mitigate CVE-2020-7943. However this causes an issue for an application we're using (puppetboard 1.0) that doesn't support v1 endpoint. There's a new major version of puppetboard that supports the v2 endpoint, but requires us to upgrade to Python 3. This basically means upgrading a whole lot of components, which we would like to do some other time. Therefor, we would like some option to enable the v1 endpoint in PuppetDB 5.2.13, to keep existing applications working. Desired Behavior: PuppetDB 5.2.13 should have a v1 metrics endpoint. Actual Behavior: PuppetDB 5.2.13 disables the v1 metrics endpoint.    
 

  
 
 
 
 

 
 
 

 
 
 Add Comment