[PDB-4326] PuppetDB rejects catalogs with tags added automatically by Puppet Created: 2019/04/02 Updated: 2019/06/25 Resolved: 2019/04/10 |
|
Status: | Closed |
Project: | PuppetDB |
Component/s: | PuppetDB |
Affects Version/s: | PDB 6.3.0 |
Fix Version/s: | PDB 5.2.9, PDB 6.0.4, PDB 6.3.1 |
Type: | Bug | Priority: | Normal |
Reporter: | Olav Morken | Assignee: | Austin Blatt |
Resolution: | Fixed | Votes: | 0 |
Labels: | resolved-issue-added | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
|
Attachments: |
![]() |
Template: | customfield_10700 302664 |
Team: | PuppetDB |
Method Found: | Needs Assessment |
Release Notes: | Bug Fix |
Release Notes Summary: | PuppetDB now successfully stores catalogs with Unicode alphanumeric tags. |
QA Risk Assessment: | Needs Assessment |
Description |
Puppet automatically tags resources with the resource title, if it considers the title to be a valid tag name: https://github.com/puppetlabs/puppet/blob/6.4.0/lib/puppet/resource.rb#L325 To determine if it is a valid tag name, it uses the following regex: ValidTagRegex = /\A[[:alnum:]][[:alnum:]:.-]*\Z/u (https://github.com/puppetlabs/puppet/blob/6.4.0/lib/puppet/util/tagging.rb#L4) Since notify { 'norwegian_characters_æøå': } This is legal according to the documentation:
(https://puppet.com/docs/puppet/6.4/lang_reserved.html#resources) The problem is that PuppetDB has not been updated to allow unicode characters in tags. Thus there is a mismatch between what the Puppet server considers to be a valid tag name and what PuppetDB considers to be a valid tag name. This in turn causes PuppetDB to fail to store the catalog for the node. The Puppet server does not log anything except the normal "Puppet 'replace_catalog' command for <hostname> submitted to PuppetDB with UUID <...>", however, looking at the logs in PuppetDB, we find:
(I have attached the full stack trace as puppetdb.log.) Since PuppetDB does not store the new catalog for the node, we cannot query PuppetDB for resources from that node. |
Comments |
Comment by Austin Blatt [ 2019/04/02 ] |
Thanks Olav Morken for the detailed bug report, it helped a lot in tracking down the problem quickly. I've got a PR up to fix this here. |