The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:

Bug #22212

File Names with "?" cause failures with recursive copies

Added by Celia Cottle over 2 years ago. Updated almost 2 years ago.

Status:AcceptedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:fileserving
Target version:-
Affected Puppet version:3.2.4 Branch:
Keywords:customer
file
fileserver
?

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This ticket is now tracked at: https://tickets.puppetlabs.com/browse/PUP-2687


Description

File names that contain “?” cause runs to fail and reports that it can’t find a file name by section before the ?, and seemingly drops the ? and anything after.

Example code:

file { '/tmp/foo':                                                              
  ensure  => directory,                                                         
  recurse => true,                                                              
  purge   => true,                                                              
  force   => true,                                                              
  owner   => 'root',                                                            
  group   => 'root',                                                            
  mode    => '0644',                                                            
  source  => "puppet:///modules/foobar/foo",                                                                        
}

Example directory/file structure:

├── foobar
│   └── files
│       └── foo
│           ├── a
│           ├── b
│           ├── c
│           └── test?moretest

Error:

Error: Could not set 'file' on ensure: Error 404 on SERVER: Not Found: Could not find file_content modules/foobar/foo/test
Error: Could not set 'file' on ensure: Error 404 on SERVER: Not Found: Could not find file_content modules/foobar/foo/test
Wrapped exception:
Error 404 on SERVER: Not Found: Could not find file_content modules/foobar/foo/test
Error: /File[/tmp/foo/test?moretest]/ensure: change from absent to file failed: Could not set 'file' on ensure: Error 404 on SERVER: Not Found: Could not find file_content modules/foobar/foo/test

History

#1 Updated by Celia Cottle over 2 years ago

  • Support Urls set to customer

#3 Updated by Charlie Sharpsteen over 2 years ago

  • Support Urls deleted (customer)
  • Keywords set to customer

#4 Updated by Tristan Helmich over 2 years ago

  • Status changed from Unreviewed to Investigating
  • Assignee set to Tristan Helmich

#5 Updated by Tristan Helmich over 2 years ago

Hi, can you give an example allowing us to recreate the issue (and specify which version is affected)? I successfully created a file containing a ‘?’ with the following code (Puppet 3.2.4):

  file { '/srv/www/test?moretest':
    ensure  => present,
    owner   => root,
    group   => root,
    mode    => '0755',
    content => 'TEST',
  }

If this is not what you meant please try to be more descriptive.

#6 Updated by Tristan Helmich over 2 years ago

  • Category set to facter
  • Status changed from Investigating to Needs More Information
  • Assignee changed from Tristan Helmich to Celia Cottle
  • Keywords changed from customer to customer file ?

I’ve put this ticket’s status into “Needs more Information” and assigned it to you. Please either (a) update it with the information I’ve requested and re-assign it to me if you need more help, or (b) change the status to “Closed” if you were able to resolve the issue on your own.

Tristan

#7 Updated by Tristan Helmich over 2 years ago

  • Category changed from facter to file

selected wrong category, fixed.

#8 Updated by Ken Barber over 2 years ago

The example case here is something like:

file { "/tmp/foo":
ensure => directory,
recurse => true, 
purge => true, 
force => true, 
owner => "root",
group => "root",
mode => 0644, 
source => "puppet:///modules/foobar/foo",
}

Whereby the files in the directory being synchronized contain a ?.

#9 Updated by Tristan Helmich over 2 years ago

  • Subject changed from File Names with "?" Cause Failures to File Names with "?" Cause Failures (puppet:// fileserving a directory)
  • Description updated (diff)
  • Category changed from file to fileserving
  • Affected Puppet version set to 3.2.4
  • Keywords changed from customer file ? to customer file fileserver ?

#10 Updated by Tristan Helmich over 2 years ago

running the puppet master with strace -e open puppet master --no-daemonize --debug I noticed that the puppet master is trying to open the correct file ( “foo/test?moretest” in this case):

open("/etc/puppet/environments/dev/modules/foobar/files/foo/foo&bar", O_RDONLY) = 6
open("/etc/puppet/environments/dev/modules/foobar/files/foo/test?moretest", O_RDONLY) = 6
open("/etc/puppet/environments/dev/modules/foobar/files/foo/c", O_RDONLY) = 6
open("/etc/puppet/environments/dev/modules/foobar/files/foo/b", O_RDONLY) = 6
open("/etc/puppet/environments/dev/modules/foobar/files/foo/a", O_RDONLY) = 6
Debug: file_metadata supports formats: pson yaml b64_zlib_yaml raw
Notice: Not Found: Could not find file_content modules/foobar/foo/test

#11 Updated by Tristan Helmich over 2 years ago

  • Assignee deleted (Celia Cottle)

#12 Updated by Nigel Kersten over 2 years ago

Here’s a simpler manifest to reproduce the issue without a puppet master:

file { '/tmp/source':
  ensure => directory,
}

file { 'problem_file':
  ensure => file,
  path   => '/tmp/source/?',
}

file { '/tmp/dest':
  ensure  => directory,
  recurse => true, 
  purge   => true, 
  force   => true, 
  source  => '/tmp/source',
  require => File['problem_file'],
}

produces the following error:

Notice: /Stage[main]//File[/tmp/source]/ensure: created
Notice: /Stage[main]//File[problem_file]/ensure: created
Notice: /Stage[main]//File[/tmp/dest]/ensure: created
Error: Could not set 'file' on ensure: Is a directory - /tmp/source/
Error: Could not set 'file' on ensure: Is a directory - /tmp/source/
Wrapped exception:
Is a directory - /tmp/source/
Error: /File[/tmp/dest/?]/ensure: change from absent to file failed: Could not set 'file' on ensure: Is a directory - /tmp/source/

Note we can create files with ‘?’ in the path, and we can also refer to a single local source successfully like:

file { '/tmp/dest/?':
  ensure =>file,
  source => 'file:///tmp/source/?',
}

We just can’t recursively copy files with a ‘?’ in their path. Investigating more.

#13 Updated by Nigel Kersten over 2 years ago

  • Status changed from Needs More Information to Investigating

#14 Updated by Nigel Kersten over 2 years ago

  • Subject changed from File Names with "?" Cause Failures (puppet:// fileserving a directory) to File Names with "?" cause failures with recursive copies
  • Status changed from Investigating to Accepted

#15 Updated by Rémi R almost 2 years ago

Redmine Issue #22212 has been migrated to JIRA:

https://tickets.puppetlabs.com/browse/PUP-2687

Also available in: Atom PDF