Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-6983

File resource drift correction fails for files named with utf-8 chars on ubuntu 1604, windows. Exit status = 0.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 5.0.0
    • Component/s: None
    • Labels:
    • Release Notes:
      Not Needed
    • QA Risk Assessment:
      Needs Assessment

      Description

      If the file name contains a utf8 character, then drift correction
      fails on ubuntu 1604 and windows (2012r2 and 2016).

      To see for yourself:

      Run puppet apply with this manifest to create a file with
      a utf8 non ascii character in its name.

      manifest_file_utf8_title.pp:

      file { "/tmp/file_utf8_title_€" :
        ensure => file,
        mode => "0644",
        content => "This is the file content.
      ",
      }
      

      (The windows version of this manifest names the file
      "C:/cygwin64/tmp/file_utf8_title_€")

      Change the file (drift).

      Run puppet apply again to correct the drift.

      See this error.

      Notice: Compiled catalog for qj5xhpzxp03l1d1.delivery.puppetlabs.net in environment production in 0.08 seconds
      Error: Could not back up /tmp/file_utf8_title_€: U+20AC from UTF-8 to ISO-8859-1
      Error: Could not back up /tmp/file_utf8_title_€: U+20AC from UTF-8 to ISO-8859-1
      Error: /Stage[main]/Main/File[/tmp/file_utf8_title_€]/content: change from {md5}d41d8cd98f00b204e9800998ecf8427e to {md5}12c5472e7479836c84093162660f2a7b failed: Could not back up /tmp/file_utf8_title_€: U+20AC from UTF-8 to ISO-8859-1
      Notice: Applied catalog in 0.04 seconds
      

      root@qj5xhpzxp03l1d1:/tmp# puppet apply manifest_file_utf8_title.pp
      Notice: Compiled catalog for qj5xhpzxp03l1d1.delivery.puppetlabs.net in environment production in 0.08 seconds
      Notice: /Stage[main]/Main/File[/tmp/file_utf8_title_€]/ensure: defined content as '{md5}12c5472e7479836c84093162660f2a7b'
      Notice: Applied catalog in 0.20 seconds
      root@qj5xhpzxp03l1d1:/tmp# cat file_utf8_title_€
      This is the file content.
      root@qj5xhpzxp03l1d1:/tmp# > file_utf8_title_€
      root@qj5xhpzxp03l1d1:/tmp# cat file_utf8_title_€
      root@qj5xhpzxp03l1d1:/tmp# puppet apply manifest_file_utf8_title.pp
      Notice: Compiled catalog for qj5xhpzxp03l1d1.delivery.puppetlabs.net in environment production in 0.08 seconds
      Error: Could not back up /tmp/file_utf8_title_€: U+20AC from UTF-8 to ISO-8859-1
      Error: Could not back up /tmp/file_utf8_title_€: U+20AC from UTF-8 to ISO-8859-1
      Error: /Stage[main]/Main/File[/tmp/file_utf8_title_€]/content: change from {md5}d41d8cd98f00b204e9800998ecf8427e to {md5}12c5472e7479836c84093162660f2a7b failed: Could not back up /tmp/file_utf8_title_€: U+20AC from UTF-8 to ISO-8859-1
      Notice: Applied catalog in 0.04 seconds
      root@qj5xhpzxp03l1d1:/tmp# echo $?
      0
      root@qj5xhpzxp03l1d1:/tmp# cat file_utf8_title_€
      root@qj5xhpzxp03l1d1:/tmp#
      

      puppet apply exited with exit status 0, and the file is not corrected.

      This error does not occur when we do this on any of the following platforms:
      ubuntu1404-64
      centos6-64
      centos7-64
      redhat6-64
      redhat7-64

      Puppet agent suite version: 1.8.1.252.gbdcd028

      root@qj5xhpzxp03l1d1:~# puppet --version
      4.8.2
      root@qj5xhpzxp03l1d1:~#
      

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  sean Sean Griffin
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: