Closed bouweandela closed 1 year ago
Related error, it looks like this happens if the output directory does not exist:
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
File ~/.conda/envs/esmvaltool/lib/python3.10/pathlib.py:1173, in Path.mkdir(self, mode, parents, exist_ok)
1172 try:
-> 1173 self._accessor.mkdir(self, mode)
1174 except FileNotFoundError:
FileNotFoundError: [Errno 2] No such file or directory: '/work/scratch-pw/bandela/esmvaltool_output/recipe_python_20220429_152839/run'
During handling of the above exception, another exception occurred:
FileNotFoundError Traceback (most recent call last)
File ~/.conda/envs/esmvaltool/lib/python3.10/pathlib.py:1173, in Path.mkdir(self, mode, parents, exist_ok)
1172 try:
-> 1173 self._accessor.mkdir(self, mode)
1174 except FileNotFoundError:
FileNotFoundError: [Errno 2] No such file or directory: '/work/scratch-pw/bandela/esmvaltool_output/recipe_python_20220429_152839'
During handling of the above exception, another exception occurred:
FileNotFoundError Traceback (most recent call last)
File ~/.conda/envs/esmvaltool/lib/python3.10/pathlib.py:1173, in Path.mkdir(self, mode, parents, exist_ok)
1172 try:
-> 1173 self._accessor.mkdir(self, mode)
1174 except FileNotFoundError:
FileNotFoundError: [Errno 2] No such file or directory: '/work/scratch-pw/bandela/esmvaltool_output'
During handling of the above exception, another exception occurred:
FileNotFoundError Traceback (most recent call last)
File ~/.conda/envs/esmvaltool/lib/python3.10/pathlib.py:1173, in Path.mkdir(self, mode, parents, exist_ok)
1172 try:
-> 1173 self._accessor.mkdir(self, mode)
1174 except FileNotFoundError:
FileNotFoundError: [Errno 2] No such file or directory: '/work/scratch-pw/bandela'
During handling of the above exception, another exception occurred:
FileNotFoundError Traceback (most recent call last)
File ~/.conda/envs/esmvaltool/lib/python3.10/pathlib.py:1173, in Path.mkdir(self, mode, parents, exist_ok)
1172 try:
-> 1173 self._accessor.mkdir(self, mode)
1174 except FileNotFoundError:
FileNotFoundError: [Errno 2] No such file or directory: '/work/scratch-pw'
During handling of the above exception, another exception occurred:
PermissionError Traceback (most recent call last)
Input In [6], in <cell line: 1>()
----> 1 output = example_recipe.run()
File ~/.conda/envs/esmvaltool/lib/python3.10/site-packages/esmvalcore/experimental/recipe.py:133, in Recipe.run(self, task, session)
130 if task:
131 session['diagnostics'] = task
--> 133 with log_to_dir(session.run_dir):
134 self._engine = self._load(session=session)
135 self._engine.run()
File ~/.conda/envs/esmvaltool/lib/python3.10/contextlib.py:135, in _GeneratorContextManager.__enter__(self)
133 del self.args, self.kwds, self.func
134 try:
--> 135 return next(self.gen)
136 except StopIteration:
137 raise RuntimeError("generator didn't yield") from None
File ~/.conda/envs/esmvaltool/lib/python3.10/site-packages/esmvalcore/experimental/_logging.py:30, in log_to_dir(drc)
8 @contextmanager
9 def log_to_dir(drc: Path):
10 """Log messages to the specified directory.
11
12 This is a context manager to temporarily redirect the logging when
(...)
28 Location where the logs should be stored.
29 """
---> 30 drc.mkdir(parents=True, exist_ok=True)
32 # create file handler which logs even debug messages
33 debug_log_file = logging.FileHandler(drc / 'main_log_debug.txt')
File ~/.conda/envs/esmvaltool/lib/python3.10/pathlib.py:1177, in Path.mkdir(self, mode, parents, exist_ok)
1175 if not parents or self.parent == self:
1176 raise
-> 1177 self.parent.mkdir(parents=True, exist_ok=True)
1178 self.mkdir(mode, parents=False, exist_ok=exist_ok)
1179 except OSError:
1180 # Cannot rely on checking for EEXIST, since the operating system
1181 # could give priority to other errors like EACCES or EROFS
File ~/.conda/envs/esmvaltool/lib/python3.10/pathlib.py:1177, in Path.mkdir(self, mode, parents, exist_ok)
1175 if not parents or self.parent == self:
1176 raise
-> 1177 self.parent.mkdir(parents=True, exist_ok=True)
1178 self.mkdir(mode, parents=False, exist_ok=exist_ok)
1179 except OSError:
1180 # Cannot rely on checking for EEXIST, since the operating system
1181 # could give priority to other errors like EACCES or EROFS
[... skipping similar frames: Path.mkdir at line 1177 (2 times)]
File ~/.conda/envs/esmvaltool/lib/python3.10/pathlib.py:1177, in Path.mkdir(self, mode, parents, exist_ok)
1175 if not parents or self.parent == self:
1176 raise
-> 1177 self.parent.mkdir(parents=True, exist_ok=True)
1178 self.mkdir(mode, parents=False, exist_ok=exist_ok)
1179 except OSError:
1180 # Cannot rely on checking for EEXIST, since the operating system
1181 # could give priority to other errors like EACCES or EROFS
File ~/.conda/envs/esmvaltool/lib/python3.10/pathlib.py:1173, in Path.mkdir(self, mode, parents, exist_ok)
1169 """
1170 Create a new directory at this given path.
1171 """
1172 try:
-> 1173 self._accessor.mkdir(self, mode)
1174 except FileNotFoundError:
1175 if not parents or self.parent == self:
PermissionError: [Errno 13] Permission denied: '/work'
To reproduce (with v2.5):
gives
(note that /home/bandela/climate_data does not exist)
results in