DiamondLightSource / DiamondLightSource/mx-bluesky
Default debug logging path gives us permission errors
- Dominant language
- Python
- Stars
- 4
- Forks
- 5
- Avg merge
- 1d 30m
- Merged PRs (30d)
- 2
Description
The default paths for debug logs is set [here](https://github.com/DiamondLightSource/mx-bluesky/blob/0ffb8fba76cc781b71955b1ecd62f46b7c85e9cc/src/mx_bluesky/common/utils/log.py#L106). We need to make sure that Hyperion has permission to write to this folder (and double check that Hyperion has permission to write to all other logging areas)
Error recorded in Hyperion start logs:
```
adding handler to logger , at level: 20
Logging to INFO file handler /dls_sw/i03/logs/bluesky/hyperion.log
adding handler to logger , at level: 20
Logging to DEBUG handler /dls/tmp/i03/logs/bluesky/debug/hyperion.log
Traceback (most recent call last):
File "/dls_sw/i03/software/bluesky/mx-bluesky_v1.5.0/mx-bluesky/.venv/bin/hyperion", line 8, in
sys.exit(main())
^^^^^^
File "/dls_sw/i03/software/bluesky/mx-bluesky_v1.5.0/mx-bluesky/src/mx_bluesky/hyperion/__main__.py", line 308, in main
app, runner, port, dev_mode = create_targets()
^^^^^^^^^^^^^^^^
File "/dls_sw/i03/software/bluesky/mx-bluesky_v1.5.0/mx-bluesky/src/mx_bluesky/hyperion/__main__.py", line 299, in create_targets
do_default_logging_setup(
File "/dls_sw/i03/software/bluesky/mx-bluesky_v1.5.0/mx-bluesky/src/mx_bluesky/common/utils/log.py", line 70, in do_default_logging_setup
handlers = set_up_all_logging_handlers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/dls_sw/i03/software/bluesky/mx-bluesky_v1.5.0/dodal/src/dodal/log.py", line 227, in set_up_all_logging_handlers
"debug_memory_handler": set_up_DEBUG_memory_handler(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/dls_sw/i03/software/bluesky/mx-bluesky_v1.5.0/dodal/src/dodal/log.py", line 174, in set_up_DEBUG_memory_handler
file_handler = TimedRotatingFileHandler(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.11/lib/python3.11/logging/handlers.py", line 214, in __init__
BaseRotatingHandler.__init__(self, filename, 'a', encoding=encoding,
File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.11/lib/python3.11/logging/handlers.py", line 58, in __init__
logging.FileHandler.__init__(self, filename, mode=mode,
File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.11/lib/python3.11/logging/__init__.py", line 1181, in __init__
StreamHandler.__init__(self, self._open())
^^^^^^^^^^^^
File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.11/lib/python3.11/logging/__init__.py", line 1213, in _open
return open_func(self.baseFilename, self.mode,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/dls/tmp/i03/logs/bluesky/debug/hyperion.log'
```
## Acceptance Criteria
- Solution implemented, with tests
Contributor guide
Assessment
This issue has not been assessed yet.