2018-10-22

Saltstack ERROR Unable to manage file: 'utf8' codec can't decode

在saltstack執行修改時區的腳本時發生了以下的錯誤訊息:

----------
          ID: push_timezone
    Function: file.managed
        Name: /etc/localtime
      Result: False
     Comment: Unable to manage file: 'utf8' codec can't decode byte 0x9b in position 44: invalid start byte
     Started: 10:22:43.427622
    Duration: 165.908 ms
     Changes:

Summary for Public_release_es-xxx
------------
Succeeded: 0
Failed:    1
------------
Total states run:     1
Total run time: 165.908 ms


解決方式: 在原本腳本裡加入shwo_changes
push_timezone:
  file.managed:
    - name: /etc/localtime
    - source: salt://init/files/localtime
    - show_changes: False
    - user: root
    - group: root
    - mode: 644


參考資料:
https://github.com/saltstack/salt/issues/47042


No comments:

Post a Comment