Tapestry will crash if encountering a broken symlink during Tarbuild #19

Closed
opened 2020-03-02 14:36:29 +00:00 by ZAdamMac · 2 comments
ZAdamMac commented 2020-03-02 14:36:29 +00:00 (Migrated from github.com)

Describe the bug
In investigating recent silent failures of an automated implementation of Tapestry, it was discovered that broken symbolic links cause an unhandled exception and crash Tapestry in place. The exception is FileNotFoundError and raised by one of the subordinate calls in os.walk.

To Reproduce
Steps to reproduce the behavior:

  1. Create a broken symbolic link in a test directory that will be consumed by tapestry.
  2. Run tapestry.

Expected behavior
The exception should be captured and the broken file reported in the skiplogger if at all possible.

Log/Console Output
Where possible, add the output of the Logs or Console when the problem occurs.

patches@Jupiter:~$ tapcontroller
/usr/lib/python3.6/runpy.py:125: RuntimeWarning: 'tapestry.__main__' found in sys.modules after import of package 'tapestry', but prior to execution of 'tapestry.__main__'; this may result in unpredictable behaviour
  warn(RuntimeWarning(msg))
Welcome to Tapestry Backup Tool Version 2.0.2
Automatic updates are not currently a function of this script.
Please refer to the repo for updates: https://www.github.com/ZAdamMac/Tapestry
Gathering a list of files to archive - this could take a few minutes.
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/patches/.local/lib/python3.6/site-packages/tapestry/__main__.py", line 1133, in <module>
    do_main(state, gpg_conn)
  File "/home/patches/.local/lib/python3.6/site-packages/tapestry/__main__.py", line 295, in do_main
    ops_list = build_ops_list(namespace)
  File "/home/patches/.local/lib/python3.6/site-packages/tapestry/__main__.py", line 71, in build_ops_list
    size = os.path.getsize(absolute_path)
  File "/usr/lib/python3.6/genericpath.py", line 50, in getsize
    return os.stat(filename).st_size
FileNotFoundError: [Errno 2] No such file or directory: '/home/patches/Documents/Website/config/mods-enabled/dir.conf'

Desktop (please complete the following information):

  • OS: Ubuntu 18.04.01 LTS
  • Tapestry Version: 2.0.2

Additional context
This can probably be made part of the logging improvements project and handled there.

**Describe the bug** In investigating recent silent failures of an automated implementation of Tapestry, it was discovered that broken symbolic links cause an unhandled exception and crash Tapestry in place. The exception is `FileNotFoundError` and raised by one of the subordinate calls in os.walk. **To Reproduce** Steps to reproduce the behavior: 1. Create a broken symbolic link in a test directory that will be consumed by tapestry. 2. Run tapestry. **Expected behavior** The exception should be captured and the broken file reported in the skiplogger if at all possible. **Log/Console Output** Where possible, add the output of the Logs or Console when the problem occurs. ``` patches@Jupiter:~$ tapcontroller /usr/lib/python3.6/runpy.py:125: RuntimeWarning: 'tapestry.__main__' found in sys.modules after import of package 'tapestry', but prior to execution of 'tapestry.__main__'; this may result in unpredictable behaviour warn(RuntimeWarning(msg)) Welcome to Tapestry Backup Tool Version 2.0.2 Automatic updates are not currently a function of this script. Please refer to the repo for updates: https://www.github.com/ZAdamMac/Tapestry Gathering a list of files to archive - this could take a few minutes. Traceback (most recent call last): File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/patches/.local/lib/python3.6/site-packages/tapestry/__main__.py", line 1133, in <module> do_main(state, gpg_conn) File "/home/patches/.local/lib/python3.6/site-packages/tapestry/__main__.py", line 295, in do_main ops_list = build_ops_list(namespace) File "/home/patches/.local/lib/python3.6/site-packages/tapestry/__main__.py", line 71, in build_ops_list size = os.path.getsize(absolute_path) File "/usr/lib/python3.6/genericpath.py", line 50, in getsize return os.stat(filename).st_size FileNotFoundError: [Errno 2] No such file or directory: '/home/patches/Documents/Website/config/mods-enabled/dir.conf' ``` **Desktop (please complete the following information):** - OS: Ubuntu 18.04.01 LTS - Tapestry Version: 2.0.2 **Additional context** This can probably be made part of the logging improvements project and handled there.
ZAdamMac commented 2020-03-20 18:05:35 +00:00 (Migrated from github.com)

There is code included in master now that should address this issue. Will keep the issue itself open until 2.1 release promotes this to the release directory and pypi.

There is code included in master now that should address this issue. Will keep the issue itself open until 2.1 release promotes this to the release directory and pypi.
ZAdamMac commented 2020-04-21 16:30:19 +00:00 (Migrated from github.com)

This is now resolved by the 2.1 release which is currently in Current Releases and also available through pypi.

This is now resolved by the 2.1 release which is currently in Current Releases and also available through pypi.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
zadammac/Tapestry#19
No description provided.