saltstack / saltstack/salt

file.recurse fails for a single file

Open
#45,151 2 comments 0 reactions 1 assignee View on GitHub

@MKLeb is already working on this.

Since Aug 31, 2023.

bug severity-medium
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

I have a file.recurse to sync root's .vim config directory. It fails on a single file. The rest of the files are copied correctly. If I rename the file it still fails. If I move the file out of the directory then they file.recurse works. I see nothing wierd about the file. It's just a .vim color scheme config file.

minion and master are on the same server.

salt version:

Salt Version:
           Salt: 2017.7.2

Dependency Versions:
           cffi: 1.7.0
       cherrypy: Not Installed
       dateutil: 2.6.1
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.7
   mysql-python: Not Installed
      pycparser: 2.10
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 3.6.3 (default, Dec 15 2017, 09:19:02)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 16.0.3
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.2
            ZMQ: 4.2.2

System Versions:
           dist:
         locale: UTF-8
        machine: amd64
        release: 11.1-RELEASE-p4
         system: FreeBSD
        version: Not Installed

The .sls file section:

root_dotvim_dir:
  file.recurse:
    - name: /root/.vim
    - clean: true
    - user: root
    - group: wheel
    - dir_mode: 755
    - file_mode: 644
    - source:
      - salt://files/server/freebsd/templates/root_dotvim.d.template.{{ grains['owner'] }}.{{ grains['localhost'] }}
      - salt://files/server/freebsd/templates/root_dotvim.d.template.{{ grains['owner'] }}.{{ grains['baseclass'] }}
      - salt://files/server/freebsd/templates/root_dotvim.d.template.{{ grains['owner'] }}
      - salt://files/server/freebsd/templates/root_dotvim.d.template

The error I get is:

          ID: root_dotvim_dir
    Function: file.recurse
        Name: /root/.vim
      Result: False
     Comment: #### /root/.vim/colors/neverness.vim ####
              Source file 'salt://files/server/freebsd/templates/root_dotvim.d.template/colors/neverness.vim?saltenv=base' not found
     Started: 22:38:14.741454
    Duration: 1296.26 ms
     Changes:

I can delete ~root/.vim completely and it copies everything back except the one file.

I don't see anything weird in the file and it's not corrupt. I can copy it, move it, edit it, and rename it without issue. vim / cat / less works fine on the file.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.