Jira (PUP-3135) Square brackets in file names not handled properly

6 views
Skip to first unread message

David Perez Rodriguez (JIRA)

unread,
Jul 15, 2016, 11:54:24 AM7/15/16
to puppe...@googlegroups.com
David Perez Rodriguez commented on Bug PUP-3135
 
Re: Square brackets in file names not handled properly

I am still facing this issue, when trying to copy git installation files by copying a folder and making it recursive. There is a file called [.exe and it is failing with:

Error: /Stage[main]/Profile::Intelcom::Aem::Tcagents/File[Copy Team City agent tools]: Failed to generate additional resources using 'eval_generate': Parameter source failed on File[D:/TeamCityTools/git-2.5.0/usr/bin/[.exe]: Could not understand source puppet:///tools/TeamCityTools/git-2.5.0/usr/bin/[.exe: bad URI(is not URI?): puppet:///tools/TeamCityTools/git-2.5.0/usr/bin/[.exe

I wonder if there is a workaround you recommend or a fix for this. Using Puppet 4.4.2.

Resource is:

file

{'Copy Team City agent tools': ensure => directory, path => $tc_tools_path, source => 'puppet:///tools/TeamCityTools', recurse => true, }
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.13#64028-sha1:b7939e9)
Atlassian logo

Josh Cooper (JIRA)

unread,
Jul 15, 2016, 5:22:04 PM7/15/16
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-3135

David Perez Rodriguez Are you using puppetserver, webrick or passenger as your puppet master? Which version and ruby version?

Henrik Lindberg (JIRA)

unread,
Jul 18, 2016, 3:56:06 AM7/18/16
to puppe...@googlegroups.com
Henrik Lindberg updated an issue
 
Puppet / Bug PUP-3135
Change By: Henrik Lindberg
Scrum Team: Client Platform

David Perez Rodriguez (JIRA)

unread,
Jul 18, 2016, 10:43:39 AM7/18/16
to puppe...@googlegroups.com
David Perez Rodriguez commented on Bug PUP-3135
 
Re: Square brackets in file names not handled properly

I'm using puppetserver. Ruby version is

root@server:/etc/puppetlabs# facter ruby

{ platform => "x86_64-linux", sitedir => "/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", version => "2.1.9" }

David Kramer (JIRA)

unread,
Aug 17, 2016, 12:37:04 PM8/17/16
to puppe...@googlegroups.com

Kenn Hussey (JIRA)

unread,
Sep 29, 2016, 2:59:07 PM9/29/16
to puppe...@googlegroups.com
Kenn Hussey updated an issue
Change By: Kenn Hussey
Sprint: Client Triage
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Jeremy Barlow (JIRA)

unread,
May 16, 2017, 8:09:09 PM5/16/17
to puppe...@googlegroups.com
Jeremy Barlow commented on Bug PUP-3135
 
Re: Square brackets in file names not handled properly

I reproduced this issue with just a 'puppet apply' - no puppetserver involved - on a recent Puppet 5 nightly build. The manifest had:

file {'bracket_test':
    path => '/tmp/hello.txt',
    ensure => file,
    source => 'puppet://puppet_data_development/[',
    source_permissions => ignore,
}

The error I saw for the puppet apply was:

Error: Parameter source failed on File[bracket_test]: Could not understand source puppet://puppet_data_development/[: bad URI(is not URI?): puppet://puppet_data_development/[ at /root/somefile.pp:1

Jeremy Barlow (JIRA)

unread,
May 16, 2017, 8:10:03 PM5/16/17
to puppe...@googlegroups.com

Moses Mendoza (JIRA)

unread,
May 18, 2017, 1:49:29 PM5/18/17
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Mar 29, 2019, 6:12:03 PM3/29/19
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Team: Coremunity
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Josh Cooper (JIRA)

unread,
Jan 23, 2020, 4:21:03 PM1/23/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-3135
 
Re: Square brackets in file names not handled properly

This is still an issue in 6.12.0. Puppet takes the string representation, URI encodes it, and then tries to parse that as a URI. However, our encoder doesn't handle [ correctly:

irb(main):014:0> str = Puppet::Util.uri_encode("puppet://puppet_data_development/[")
=> "puppet://puppet_data_development/["
irb(main):015:0> URI.parse(str)
Traceback (most recent call last):
        5: from /usr/local/opt/rbenv/versions/2.5.3/bin/irb:11:in `<main>'
        4: from (irb):15
        3: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.3/lib/ruby/2.5.0/uri/common.rb:237:in `parse'
        2: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.3/lib/ruby/2.5.0/uri/rfc3986_parser.rb:73:in `parse'
        1: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.3/lib/ruby/2.5.0/uri/rfc3986_parser.rb:67:in `split'
URI::InvalidURIError (bad URI(is not URI?): puppet://puppet_data_development/[)

We really should be using the Addressable gem which handles this correctly:

irb(main):016:0> str = Addressable::URI.encode("puppet://puppet_data_development/[")
=> "puppet://puppet_data_development/%5B"
irb(main):017:0> Addressable::URI.parse(str)
=> #<Addressable::URI:0x3fefa0049f64 URI:puppet://puppet_data_development/%5B>

Josh Cooper (Jira)

unread,
Sep 29, 2020, 4:39:05 PM9/29/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-3135

This is the same underlying issue as PUP-2687. The Puppet::Util.uri_encode method does not escape some characters that should be.

This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages