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

on arista-4-i386: File resource drift correction fails on file named with utf-8 characters

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Template:
    • Team:
      Coremunity
    • QA Risk Assessment:
      Needs Assessment

      Description

      This bug is similar to PUP-6983, except that
      1. In this case the system is arista-4-i386 and
      2. Setting the LANG environment variable to "en_US.UTF-8" does not fix the problem as it did in the Ubuntu-16 case.

      To reproduce:
      1. apply this manifest:

      -bash-4.1# cat manifest
      file { "/tmp/file_utf8_title_€" :
        ensure => file,
        mode => "0644",
        content => "This is the file content.
      ",
      }
      -bash-4.1# puppet apply manifest
      Notice: Compiled catalog for ha6j7myfrqmszju.delivery.puppetlabs.net in environment production in 0.10 seconds
      Notice: /Stage[main]/Main/File[/tmp/file_utf8_title_€]/ensure: defined content as '{md5}c7ce4aaf931ef61f00fbe5d7f102a91d'
      Notice: Applied catalog in 0.05 seconds
      -bash-4.1# echo $?
      0
      -bash-4.1# ls
      file_utf8_title_???  manifest
      

      The shell does not properly display the file name. This is not the bug.
      2. Observe the target file is created with the desired content:

      -bash-4.1# cat file_utf8_title_€
      This is the file content.
      -bash-4.1#
      

      3. Rewrite the file

      -bash-4.1# > file_utf8_title_€
      -bash-4.1# cat file_utf8_title_€
      -bash-4.1#
      

      4. Apply the manifest again to correct the file (drift). Observe the error message, examine the file.

      -bash-4.1# puppet apply manifest
      Notice: Compiled catalog for ha6j7myfrqmszju.delivery.puppetlabs.net in environment production in 0.10 seconds
      Error: Could not back up /tmp/file_utf8_title_€: U+20AC from UTF-8 to US-ASCII
      Error: Could not back up /tmp/file_utf8_title_€: U+20AC from UTF-8 to US-ASCII
      Error: /Stage[main]/Main/File[/tmp/file_utf8_title_€]/content: change from {md5}d41d8cd98f00b204e9800998ecf8427e to {md5}c7ce4aaf931ef61f00fbe5d7f102a91d failed: Could not back up /tmp/file_utf8_title_€: U+20AC from UTF-8 to US-ASCII
      Notice: Applied catalog in 0.06 seconds
      -bash-4.1# cat file_utf8_title_€
      -bash-4.1#
      

      This problem is not fixed by setting the environment variable LANG to "en_US.UTF-8" as it was in the Ubuntu-16 case. Setting LANG to "POSIX" also did not help.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support