-
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
[REGRESSION] file.managed: state.apply "'Changes' should be a dictionary" error and unuseful output if invalid 'source' file path is specified #55269
Comments
Thanks for reporting this! I'm thinking that there may have been a code path that has been introduced which leads to reporting this error, or possibly the error message has changed. But I agree, the error message should have a better message. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
Please keep this issue open, stale-bot. :-) |
Thank you for updating this issue. It is no longer marked as stale. |
At this time we are unable to allocate resources to this issue, and are planning for the next release cycle to plan and commit. |
same issue with a different module: #55562 - need to fix this broadly, may need input validation, looking to correct this in the Magnesium release |
Just to stave off stale bot mainly. We're running into this as well. We use salt-ssh for a state.apply test=True prior to making our changes live and it's a part of our validation which normally works pretty well. Hope that helps. We're on 2019.2.4.
Earlier version of this message said the file was there, it wasn't but the error message changing would be useful :-) |
@zbukhari stale bot was |
Another error that causes this:
|
Ran into this a few hours ago. The salt master was unable to access files stored in S3 (secrets were set to dummy values for CI/CD testing) and I got the same output as @9numbernine9 above. |
In this example i got this error aswell. The issue was caused by renaming the /salt/base/share to /salt/base/nfs: nfs_config: Obviously by changing share to nfs the issue was resolved. |
When breaking my own code and rewriting stuff, this issue is still at large: nfs_config: Dir should be: - source: salt://nfs/export/templates/nfs_export.j2 Ill stop replying to this now. Just pointing out that there should be an error like "change to correct dir in this function" |
Still happening
|
@network-shark what version of Salt are you seeing this in or is it also in |
Just ran into this error on salt-3001.7 as well |
Also seeing this issue Salt Master: Salt Version: Dependency Versions: System Versions: Additionally updated the master to 3003.1 and still having issue. |
Issue is still persistent :(.
|
I just spent over an hour on this issue. I really think the error message could be better here. |
I often see the failure on freebsd 13 . I have collected a trace from salt-call
|
I knew this looked familiar. Ran into it again! |
should_be_a_dictionary_patch.txt This patch fixed it for me.
ret["changes"] is clearly a tuple here, but it does not get changed before being returned, so the error message is correct; it's definitely not a dictionary. By changing it like the below, which appears to be in line with the intention of the code (No changes because the source file does not exist), the bug is fixed.
|
@dractyl I will try your patch next week. Thank you ! |
@garethgreenaway I ran into this again in CI when I had a source_hash value that wasn't a valid source hash type. e.g.: |
Description of Issue
Hello!
In Salt
2019.2.2
(and likely any2019.2.x
version), when using thefile.managed
state and specifying asource
file that doesn't actually exist (e.g.source: salt://path/to/nonexistent/file.txt
),state.apply
will return a"'Changes' should be a dictionary"
error instead of returning the real error, i.e. that I'm trying to use a file that doesn't exist in SaltFS. This is a break from2018.3.x
which actually reports a usefulSource file not found
error.Setup
Steps to Reproduce Issue
Output when using Salt
2019.2.2
:When using Salt
2018.3.4
the output is much more useful:Versions Report
The text was updated successfully, but these errors were encountered: