-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error logging with non-environment branches in gitfs #33424
Comments
@thusoy I am able to setup and see these errors int he logs as well:
And I think you are right in that its not finding a top.sls file. Also same results when changing the gitfs_env_whitelist to base. I had to remove cache to get it to work. Looking at what gitfs_env_whitelist does it seems like this might be what this is designed for to ensure other branches are not accounted for in a repo:
I do think that this is all expected behavior but @terminalmage is more familiar with this and could give us some more insight:
|
I think that this is probably just well-intentioned logging gone awry. I'm investigating. |
When getting all the top files for the various environments, those environments without a top file will return ``False`` when we attempt to cache the file. Passing a boolean to ``compile_template()`` will result in an error being logged, since we are invoking the function incorrectly (it expects the template data to be a string). Since a ``False`` return from caching the file means that it does not exist, this commit will only run ``compile_template()`` when the contents evaluate to ``True``. Resolves saltstack#33424.
I have submitted a fix for this in #33679. It seems that we were simply unnecessarily invoking |
Great work @terminalmage, appreciated! |
No problem @thusoy, thanks for alerting us to this. |
Description of Issue/Question
I was seeing error logs from all minions when running
highstate
of the form[ERROR ] Template was specified incorrectly: False
when using a gitfs-backed master. The error was logged once for each non-master branch in the gitfs repo, which I wasn't using as environments and thus didn't have a topfile (topfile is in roots, only states are loaded over gitfs), which I believe was the cause of the logging. Settinggitfs_env_whitelist
to only acceptbase
fixes it, but only after clearing the cached environments in/var/cache/salt/master/gitfs/envs.p
.I see two potential solutions to two slightly different issues here, the first being that something is logged with severity error when it doesn't really matter much, it's only erroneous if no topfile is found at all. Also related, the error message doesn't give any indication to what the problem is or how it can be remedied. The other issue is that cached data persists across master restarts, and might not be valid for the new config. This can be approached either as always clearing out cached data on restarts, assuming restarts are rare. This will probably also solve other issues where config settings seemingly have no effect due to cached data. The other approach is associating cached data with a config, thus clearing out the cache on start if the config has changed since it was written, assuming that restarts are more frequent than config changes.
Iggy suggested on IRC that #30434 might be related.
Setup
Steps to Reproduce Issue
Serve topfile over roots and have a gitfs repo with a non-master branch without a topfile.
Versions Report
Also confirmed that the same error occurs in 2016.3.
The text was updated successfully, but these errors were encountered: