Skip to content
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 trying to change ownership of broken symlink #20

Open
djjuhasz opened this issue May 2, 2018 · 5 comments
Open

Error trying to change ownership of broken symlink #20

djjuhasz opened this issue May 2, 2018 · 5 comments
Assignees
Labels
Milestone

Comments

@djjuhasz
Copy link
Contributor

djjuhasz commented May 2, 2018

When re-running the role after a failure, I get the following error:

TASK [external-roles/artefactual-atom : Temporarily change ownership of site directory to be able to clone repo] ***
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: OSError: [Errno 2] No such file or directory: '/usr/share/nginx/atom-uploads'
fatal: [asa-atom-test]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File "/tmp/ansible_SrI3Dd/ansible_module_file.py", line 473, in \n main()\n File "/tmp/ansible_SrI3Dd/ansible_module_file.py", line 350, in main\n changed |= recursive_set_attributes(module, to_bytes(file_args['path'], errors='surrogate_or_strict'), follow, file_args)\n File "/tmp/ansible_SrI3Dd/ansible_module_file.py", line 172, in recursive_set_attributes\n changed |= module.set_fs_attributes_if_different(tmp_file_args, changed, expand=False)\n File "/tmp/ansible_SrI3Dd/ansible_modlib.zip/ansible/module_utils/basic.py", line 1507, in set_fs_attributes_if_different\n File "/tmp/ansible_SrI3Dd/ansible_modlib.zip/ansible/module_utils/basic.py", line 1164, in set_owner_if_different\n File "/tmp/ansible_SrI3Dd/ansible_modlib.zip/ansible/module_utils/basic.py", line 1059, in user_and_group\nOSError: [Errno 2] No such file or directory: '/usr/share/nginx/atom-uploads'\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}

The error is due to the atom-uploads symlink being broken (links to a non-existent directory) and a change in how the "recurse" functionality works in ansible 2.5.1+, See: ansible issue #39456

@djjuhasz djjuhasz self-assigned this May 2, 2018
@djjuhasz djjuhasz added this to the ansible-2.5 milestone May 2, 2018
@djjuhasz
Copy link
Contributor Author

djjuhasz commented May 2, 2018

I wonder if we should create the atom_uploads_symlink directory if it doesn't exist?

@djjuhasz
Copy link
Contributor Author

djjuhasz commented May 2, 2018

Probably we just want to use follow: no when changing permissions. I don't think we need to change permissions of symlinked dirs.

@mamedin
Copy link
Contributor

mamedin commented Jul 27, 2020

@djjuhasz I'm working on a PR to add some features we are still using with the AtoM multisite deploy playbook.

WIP branch: https://github.com/artefactual-labs/ansible-atom/tree/dev/add-revision-dir

I added a task to create the atom_uploads_symlink and atom_downloads_symlink directories.

@djjuhasz
Copy link
Contributor Author

djjuhasz commented Aug 4, 2020 via email

@mamedin
Copy link
Contributor

mamedin commented Aug 4, 2020

Thanks @djjuhasz, I was letting yo know that I was working on it. But I'll add you to the CR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants