Only absolute paths are currently supported. Paths must begin with '/'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2025 06:34 AM
I am facing the above issue when using the Python Databricks SDK. I retreive the job-definition by "
Therefore the job-definition is correct and working fine on the source workspace. Also relative paths are mandatory, as I am using a Git Reference to target the Notebook
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2025 04:42 AM
The error "Only absolute paths are currently supported. Paths must begin with '/'" in the context of the Databricks Python SDK means that when creating a job, the notebook path you provide must be an absolute workspace path (like /Users/username/notebook) rather than a relative path or a Git reference.
Explanation of the Issue
-
The Databricks Jobs API (used via client.jobs.create()) expects the notebook path in the job definition to be an absolute path in the Databricks workspace filesystem, not a Git URL or a relative path.
-
Even if you're working with Git-linked notebooks, when defining a job, the "notebook_path" field must always use an absolute path that exists in the workspace (e.g., /Repos/username/repo-name/path/to/notebook).
How to Fix
-
Make sure that when you migrate a job between workspaces, the notebook referenced in the job is present in the destination workspace, and specify its absolute path in the job definition.
-
If you're using Git integration, use the absolute workspace path of the notebook synced from Git, not the Git reference or a relative path.
-
Example:
pythonjob_settings = { "notebook_task": { "notebook_path": "/Repos/username/repo-name/path/to/notebook" }, # other job settings... } client.jobs.create(**job_settings)
Note on CI/CD and Git References
-
If your workflow requires Git-based deployment (to keep test and production in sync), you must automate a step that pulls or syncs the notebooks from Git into the workspace and then reference those absolute paths in the job configuration.
-
At this time, the Databricks Jobs API does not support specifying jobs directly referencing a Git branch/tag/commit for the task—jobs work off workspace objects, not directly from Git links.
Summary Table
| Solution Step | Details |
|---|---|
| Use absolute notebook paths | Path must begin with '/', referencing the workspace location of the notebook |
| Sync notebooks from Git before deploy | Ensure the needed notebook exists in the destination workspace |
| No direct Git refs in job creation | The Jobs API does not accept Git refs/tags—only absolute workspace paths allowed |
Following these steps should resolve the "Only absolute paths are currently supported" error when using the Databricks Python SDK to migrate or create jobs with notebooks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2025 07:30 AM
@AxelM I see this was a while ago, what was your solution? In my experience, either the `source` field under notebook task is incorrectly set to "WORKSPACE" instead of "GIT", or there's a legitimate issue, such as:
- a typo/mismatch between the specified path and the actual path
- a tag, branch, etc. which the job was originally deployed to target has been changed or deleted
> The Jobs API does not accept Git refs/tags—only absolute workspace paths allowed
This is not accurate.
From the docs, we see the jobs create API takes a git source option: https://docs.databricks.com/api/workspace/jobs/create#git_source
When that is specified, then other tasks, such as notebook task, require a relative reference, as OP correctly pointed out.
The notebook task parameter specifies that you must use relative paths if using git-source: https://docs.databricks.com/api/workspace/jobs/create#tasks-notebook_task-notebook_path
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2025 10:59 AM
-
For tasks that use GIT as the source, the task’s notebook_path must be a path relative to the repo root, and absolute paths are rejected. If the job or task isn’t correctly marked as GIT-sourced, the API will think it’s workspace-sourced and enforce absolute paths.
-
A common pitfall is placing git_source on the task instead of the job. Jobs expect git_source at the job level; once set, tasks can either omit source (it defaults to GIT when job.git_source is present) or explicitly set source="GIT". Putting git_source on a task leads to exactly the error you saw; moving git_source to the job fixes it.
from databricks.sdk import WorkspaceClient
from databricks.sdk.service.jobs import Task, NotebookTask, Source, GitSource
w = WorkspaceClient()
j = w.jobs.create(
name="Migrated job",
git_source=GitSource(
git_url="https://github.com/<org>/<repo>.git",
git_provider="gitHub", # or "azureDevOpsServices", "bitbucketCloud", ...
git_branch="main" # or set git_commit
),
tasks=[
Task(
task_key="my_task",
# Path is relative to the repo root:
notebook_task=NotebookTask(
notebook_path="path/to/notebook.py",
source=Source.GIT # or omit source to default to GIT when job.git_source is set
),
# ... compute settings ...
),
# more tasks...
]
)
Leaving task.source empty will make the task use GIT when job.git_source is defined; otherwise it uses WORKSPACE.
