Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up[BUG] spurious "invalid cache mtime entry" warning every minute with colon in filename #57828
Comments
|
@wchao thanks for the report! A simple rsplit should do the trick like you said. If you want to put in a fix for this feel free to slack me on saltstackcommunity.slack.com my user name is Charles McMarrow. I will be happy to help with github and Salt questions. |
|
Hi @cmcmarrow , I tried to access saltstackcommunity.slack.com, but was unable. When I visit that page, I can't log in with my usual Slack credentials, and I can't create new credentials because it requires that I have an @saltstack.com email address. How do I access the Slack page or community that you mention? |
|
@wchao Sorry about that! I should have given you this link https://saltstackcommunity.herokuapp.com/ |
|
You may find this to be a help too https://docs.saltstack.com/en/latest/topics/development/contributing.html |
terminalmage
linked a pull request that will
close
this issue
|
Fixed in #57893. |


Description
I get the following warnings once a minute:
2020-06-23 23:11:13,900 [salt.loaded.int.fileserver.roots:180 ][WARNING ][24993] Skipped invalid cache mtime entry in /var/cache/salt/master/roots/mtime_map: /srv/salt/a/b/c/ifcfg-eth0:0:1533517049.0
2020-06-23 23:11:13,901 [salt.loaded.int.fileserver.roots:180 ][WARNING ][24993] Skipped invalid cache mtime entry in /var/cache/salt/master/roots/mtime_map: /srv/salt/x/y/z/ifcfg-eth0:0:1526301738.0
2020-06-23 23:11:13,905 [salt.loaded.int.fileserver.roots:180 ][WARNING ][24993] Skipped invalid cache mtime entry in /var/cache/salt/master/roots/mtime_map: /srv/salt/dns/zone/1111:2222.zone:1592913957.1986542
2020-06-23 23:11:13,905 [salt.loaded.int.fileserver.roots:180 ][WARNING ][24993] Skipped invalid cache mtime entry in /var/cache/salt/master/roots/mtime_map: /srv/salt/dns/zone/3333:4444.zone:1592913957.1986542
Setup
Just name a file under /srv/salt using a colon somewhere in the filename.
Steps to Reproduce the behavior
Just name a file under /srv/salt using a colon somewhere in the filename.
Expected behavior
Only real warnings about invalid cache mtime entries should be emitted, not spurious ones that are due to a bug in the code that incorrectly parses the line.
Screenshots
If applicable, add screenshots to help explain your problem.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)Additional context
The problem is pretty easy to spot in the code, and I think also pretty easy to fix. The issue is on line 170 in salt.loaded.int.fileserver.roots (version 3001):
file_path, mtime = line.replace("\n", "").split(":", 1)
When a file path has a colon, the operation barfs because it splits in the wrong place. Just try it on the examples above. The solution is to replace the split method with rsplit or rpartition.
I'm happy to have someone make the change, or also happy to contribute the fix if that's easier (if so, how do I do that? I'm familiar with Python, but not github for pull requests).