Skip to content

Commit

Permalink
Improve remote sync error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Aug 14, 2023
1 parent 2170b02 commit 1156919
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pydatalab/pydatalab/remote_filesystems.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,16 @@ def _call_remote_tree(
except Exception as exc:
raise RuntimeError(f"Remote tree process {command!r} returned: {exc!r}")
if stderr:
raise RuntimeError(f"Remote tree process {command!r} returned: {stderr!r}")
# Do not return the bare stderr, but instead specialise the error message to common errors
if "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!" in stderr.decode("utf-8"):
msg = f"Remote host identification has changed for {hostname}: please contact the administrator of this datalab deployment."
LOGGER.error(
"Remote host identification for %s has changed, failed to update remote directories",
hostname,
)
else:
msg = "Remote tree process returned an error: please contact the administrator of this datalab deployment."
raise RuntimeError(msg)

try:
return json.loads(stdout)
Expand Down

0 comments on commit 1156919

Please sign in to comment.