Accessing Workspace / Repo file works in notebook, but not from job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2024 04:07 AM
In a notebook attached to.a normal personal cluster I can successfully do this:
%fs ls file:/Workspace/Repos/$userName/$repoName/$folderName
When I run an init-script on a UC volume that the does the same thing, I'm getting this error:
ls: cannot access 'file:/Workspace/Repos/$userName/$repoName/$folderName': No such file or director
Both are run by the same user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2024 04:52 AM
Hi @dollyb,
Within your init script are you doing %fs ls or unix command "ls" only? Looks like variables referenced on the path are not picking up! Have you tried adding some debug debug logic on your code?
If you can DIM your init script I can have a look at it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2024 05:33 AM
Hi @dollyb ,
Can you please share some sample command which you are running in the init.sh file ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2024 08:26 AM - edited 12-19-2024 08:28 AM
It's simply the statement I listed in my post. There are no variables, I just wrote it like that to not post the exact values. So it's something like this in the script and that's it:
ls file:/Workspace/Repos/my_user_name@company.com/my_repo_name/my_folder_name
By the way I'm on Azure Databricks. Sometimes it seems this variant doesn't support all the features the AWS/GCP variants do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2024 11:23 AM
Hi @dollyb,
Can you try with just "ls /Workspace/Repos/my_user_name@company.com/my_repo_name/my_folder_name"
I'm not sure dbutils will be useful in an init script, I will try to test it out
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2024 09:59 PM - edited 12-19-2024 10:00 PM
I'm not using dbutils in my init-script, just the unix ls command.

