OSError: [Errno 17] File exists

773 views
Skip to first unread message

jason HE

unread,
Mar 11, 2015, 1:42:42 AM3/11/15
to salt-...@googlegroups.com

# cat codesync.sls
{% if pillar.get('webserver-m_feiniu_com_role', '') %}
/home/webdata/htdocs/m.feiniu.com/:
  file.recurse:
    - source: salt://webserver/m.feiniu.com/
    - saltenv: {{ pillar['webserver-m_feiniu_com_role'] }}
    - user: webdata
    - group: webdata
    - clean: True
    - dir_mode: 755
    - file_mode: 644
    - include_empty: True
    - exclude_pat: E@(css_domain)|(img_domain)|(js_domain)|(m_domain)
{% endif %}

This is my sls file,but when I run the state.sls, It appears  the error log:

2015-03-09 19:42:51,578 [salt.master                                ][INFO    ] AES payload received with command _file_hash
2015-03-09 19:42:51,565 [salt.master                                ][ERROR   ] Error in function _file_hash:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/salt/master.py", line 1329, in run_func
    ret = getattr(self, func)(load)
  File "/usr/lib/python2.6/site-packages/salt/fileserver/__init__.py", line 433, in file_hash
    return self.servers[fstr](load, fnd)
  File "/usr/lib/python2.6/site-packages/salt/fileserver/roots.py", line 221, in file_hash
    os.makedirs(cache_dir)
  File "/usr/lib64/python2.6/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 17] File exists: '/var/cache/salt/master/roots/hash/online/webserver/drp/public/static/css-build/rt_about'
2015-03-09 19:42:51,642 [salt.master                                ][INFO    ] AES payload received with command _file_hash


my saltstack version:
# salt --version
salt 2014.7.0 (Helium)

What issue is this? 
Please help me.
Thank you in advance!

Ethan Erchinger

unread,
Mar 11, 2015, 12:08:23 PM3/11/15
to salt-...@googlegroups.com
Salt is trying to make a directory with the same name as an existing file, trying clearing out that file manually or with saltutil.clear_cache, and rerun.

jason HE

unread,
Mar 11, 2015, 8:55:39 PM3/11/15
to salt-...@googlegroups.com
This error appears random, and not all of the files cannot be sync.
when I run the states.sls again ,the file can sync. Why?


Thanks


在 2015年3月12日星期四 UTC+8上午12:08:23,Ethan Erchinger写道:

Colton Myers

unread,
Mar 13, 2015, 12:14:31 PM3/13/15
to salt-...@googlegroups.com
Could you please shut down your minion/master, and delete the directory /var/cache/salt, and then restart master and minion and see if the problem is resolved? I'm wondering if this is a cache issue.

--
Colton Myers
Platform Engineer, SaltStack
@basepi on Github/Twitter/IRC

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

signature.asc

Colton Myers

unread,
Mar 17, 2015, 7:28:43 PM3/17/15
to salt-...@googlegroups.com
I would also check to make sure that there is only one copy of the master/minion running. Kill all the processes and then restart it.

--
Colton Myers
Platform Engineer, SaltStack
@basepi on Github/Twitter/IRC

signature.asc
Reply all
Reply to author
Forward
0 new messages