On some platforms, this function may return False if permission is not granted to execute os.stat() on the requested file, even if the path physically exists.
it looks like the migrated marker does not exist, so it executes migrate(), which that fails when it tries to write that marker.
I think the most appropriate thing would be for any operations in migrate() to first check if JUPYTER_CONFIG_DIR is actually
writable and if not, cancel the migration or fail back to some temp directory, like IPython does
IPython/paths.py:62: UserWarning: IPython dir '...' is not a writable location, using
a temp directory.
I came across this issue while running in a read-only home environment (HPC batch job) on AFS.
As far as I can tell, the issue is even documented the Python os module reference
So what happens is that here
https://github.com/jupyter/jupyter_core/blob/0ae6f9058d971489f95ea8d38b98dba26556ffa6/jupyter_core/application.py#LL171C1-L171C1
it looks like the migrated marker does not exist, so it executes
migrate()
, which that fails when it tries to write that marker.I think the most appropriate thing would be for any operations in
migrate()
to first check ifJUPYTER_CONFIG_DIR
is actually writable and if not, cancel the migration or fail back to some temp directory, like IPython does