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
"bad symbolic permission for mode:" error on directory creation #42563
Comments
Files identified in the description: If these files are inaccurate, please update the |
It seems like a case of the mode being converted from octal to decimal and then failing due to being in decimal. |
#31952 seems to be related. The documentation seems to imply ("Giving Ansible a number without following one of these rules will end up with a decimal number which will have unexpected results.") that it will attempt to use the decimal number received. This does not seem to be the case. (I'm interpreting that as "777" decimal is different permissions from 0777 (octal) and using the former will result in different permission from the intended ones being set) |
A warning instead of an error, or (if possible to detect) ignoring the error if the a variable substitution took place is one fix. (The second option would be nice - it can still error out if the user directly type A relevant sample in the documentation is another. (Or a comment in the samples) Another might be to allow the error to be overwritten with "force" or a new setting and mentioning that in the message. There might be some rare use-cases for passing decimal modes, like the output of a tool fetching it from somewhere that stores the mode as a number and find it easier to output that directly than converting it to octal first. |
Files identified in the description: If these files are incorrect, please update the |
(In most cases nowadays I just use the mode as a string... The documentation can still do with some notes about that though...) (The number that it gets converted to (with the loop I assume) is still valid permissions) |
It looks like the documentation now warns that you should consider quoting it https://docs.ansible.com/ansible/latest/collections/ansible/builtin/file_module.html, so I'm going to close this as resolved. |
SUMMARY
"bad symbolic permission for mode:" error when creating directories from an item list.
ISSUE TYPE
COMPONENT NAME
file module
ANSIBLE VERSION
CONFIGURATION
Default config
OS / ENVIRONMENT
Managing CentOS 7 from CentOS 7.
STEPS TO REPRODUCE
EXPECTED RESULTS
Directories should be created with the correct permissions.
ACTUAL RESULTS
Directory creation fails with an error.
Some additional notes: This happens irrespective of whether a user and group with UID and GID of 27 actually exists.
The text was updated successfully, but these errors were encountered: