Skip to content

Commit e7524a7

Browse files
authored
Merge pull request #1156 from CLIP-HPC/fix_server_log
Fix Read-Only filesystem permission issue for log file
2 parents c4e01b3 + 3ee04e3 commit e7524a7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

repo2docker/buildpacks/repo2docker-entrypoint

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,21 @@ def main():
3030
# 2. current working directory: "."
3131
# 3. default temp directory for the OS (e.g. /tmp for linux)
3232
log_dirs = [".", tempfile.gettempdir()]
33+
log_file = None
3334
if "REPO_DIR" in os.environ:
3435
log_dirs.insert(0, os.environ["REPO_DIR"])
3536
for d in log_dirs:
3637
log_path = os.path.join(d, ".jupyter-server-log.txt")
3738
try:
3839
log_file = open(log_path, "ab")
39-
except PermissionError:
40+
except Exception:
4041
continue
4142
else:
4243
# success
4344
break
45+
# raise Exception if log_file could not be set
46+
if log_file is None:
47+
raise Exception("Could not open '.jupyter-server-log.txt' log file " )
4448

4549
# build the command
4650
# like `exec "$@"`

0 commit comments

Comments
 (0)