cli icon indicating copy to clipboard operation
cli copied to clipboard

Cannot deploy app

Open beneuto opened this issue 8 months ago • 1 comments

Describe the issue

Creating a Streamlit app from the template and using the deploy command provided in the UI results in error.

Steps to reproduce the behavior

  1. Create an app in the Databricks UI using the Streamlit Data template
  2. Open the new app configuration and copy the CLI command from the "Deploy to Databricks Apps Section"
  3. I have prefixed the source path with another "/" as is the norm when running from Windows but the same result occurs with or without.
  4. Run the command (I am using VS Code on Windows 10 with Databricks extension and CLI installed):

$ databricks apps deploy test-app --source-code-path //Workspace/Users/me@mine/databricks_apps/test-app_2025_04_09-04_59/streamlit-data-app --debug

Expected Behavior

App should be deployed

Actual Behavior

Fails with error message claiming Workspace path is invalid.

OS and CLI version

Windows 10 CLI v0.246.0

Debug Logs

08:59:14 Debug: POST /api/2.0/apps/test-app/deployments

{ "source_code_path": //Workspace/Users/[email protected]/databricks_apps/test-app_2025_04_09-04_59/streamlit-data... (4 more bytes) } < HTTP/2.0 400 Bad Request < { < "error_code": "INVALID_PARAMETER_VALUE", < "message": "Source code path: //Workspace/Users/[email protected]/databricks_apps/test-app_2025_04_09-04... (54 more bytes)" < } pid=22248 sdk=true 08:59:14 Debug: non-retriable error: Source code path: //Workspace/Users/[email protected]/databricks_apps/test-app_2025_04_09-04_59/streamlit-data-app must be a valid workspace path. pid=22248 sdk=true Error: Source code path: //Workspace/Users/[email protected]/databricks_apps/test-app_2025_04_09-04_59/streamlit-data-app must be a valid workspace path. 08:59:14 Info: failed execution pid=22248 exit_code=1 error="Source code path: //Workspace/Users/[email protected]/databricks_apps/test-app_2025_04_09-04_59/streamlit-data-app must be a valid workspace path."

beneuto avatar Apr 09 '25 23:04 beneuto

The path provided in --source-code-path is remote Workspace path so no need for double slashes. But since you mentioned the same error happens with single slash can you double check that the path you use exists and that the user you authenticated with in CLI and the user owning the path are the same?

andrewnester avatar Apr 30 '25 13:04 andrewnester

I am using the paths provided in the UI for the app and have no issue with authentication with other commands. I have also tried dozens of path variations that seemed reasonably possible but get the same error every time.

I've found that if I first deploy from the UI then I can redeploy from the same location in VS Code by omitting the path altogether.

Following is an annotated transcript of a VS Code session: ` *** CREATE A CUSTOM APP IN THE DATABRICKS UI

*** FOLLOWING THE STEPS IN THE "EDIT IN YOUR IDE" SECTION IF THE APP IN THE UI (.venv) ME@H19908 MINGW64 /c/SOURCE/ADO/dsp-streamlit-databricks (initial-template) $ cd test-app

*** NOW SYNC. REMOVE --watch OPTION (.venv) ME@H19908 MINGW64 /c/SOURCE/ADO/dsp-streamlit-databricks/test-app (initial-template) $ databricks sync . /Workspace/Users/[email protected]/test-app -p sso

Error: Path C:/Program Files/Git/Workspace/Users/[email protected]/test-app doesn't start with '/'

*** NEED TO ADD ADDITIONAL '/' IN THIS ENVIRONMENT (.venv) ME@H19908 MINGW64 /c/SOURCE/ADO/dsp-streamlit-databricks/test-app (initial-template) $ databricks sync . //Workspace/Users/[email protected]/test-app -p sso

Action: PUT: requirements.txt, app.py, app.yaml

Uploaded app.yaml

Uploaded app.py

Uploaded requirements.txt

Initial Sync Complete

*** TRY TO DEPLOY (.venv) ME@H19908 MINGW64 /c/SOURCE/ADO/dsp-streamlit-databricks/test-app (initial-template) $ databricks apps deploy test-app --source-code-path /Workspace/Users/[email protected]/test-app

Error: Source code path: C:/Program Files/Git/Workspace/Users/[email protected]/test-app must be a valid workspace path.

(.venv) ME@H19908 MINGW64 /c/SOURCE/ADO/dsp-streamlit-databricks/test-app (initial-template) $ databricks apps deploy test-app --source-code-path //Workspace/Users/[email protected]/test-app

Error: Source code path: //Workspace/Users/[email protected]/test-app must be a valid workspace path.

*** TRY IT WITH NO PATH (.venv) ME@H19908 MINGW64 /c/SOURCE/ADO/dsp-streamlit-databricks/test-app (initial-template) $ databricks apps deploy test-app

Error: Source code path cannot be empty for an app with no previous active deployment.

*** DEPLOY FROM THE UI AND TRY AGAIN (.venv) ME@H19908 MINGW64 /c/SOURCE/ADO/dsp-streamlit-databricks/test-app (initial-template)

$ databricks apps deploy test-app

Error: failed to reach SUCCEEDED, got FAILED: Error installing requirements. Please check /logz for more details

*** THE DEPLOYMENT NOW WORKS - THE ERROR IS FROM THE BUILD AND NOT RELEVANT TO THIS ISSUE *** THE ONLY WAY I CAN DEPLOY IS FROM THE LOCATION SET IN THE UI

beneuto avatar May 02 '25 05:05 beneuto

Thanks for sharing. Are you using Git Bash, correct? Is putting the path into single quotes work for you, something like this

databricks apps deploy test-app --source-code-path `/Workspace/Users/[email protected]/test-app`

andrewnester avatar May 02 '25 08:05 andrewnester

Bash yes but no, had tried quotes earlier along with many other likely options.

(.venv)

ME@H19908 MINGW64 /c/SOURCE/ADO/dsp-streamlit-databricks (initial-template)

$ databricks apps deploy test-app --source-code-path '/Workspace/Users/[email protected]/test-app'

Error: Source code path: C:/Program Files/Git/Workspace/Users/[email protected]/test-app must be a valid workspace path.

(.venv)

ME@H19908 MINGW64 /c/SOURCE/ADO/dsp-streamlit-databricks (initial-template)

$ databricks apps deploy test-app --source-code-path '//Workspace/Users/[email protected]/test-app'

Error: Source code path: //Workspace/Users/[email protected]/test-app must be a valid workspace path.

(.venv)

ME@H19908 MINGW64 /c/SOURCE/ADO/dsp-streamlit-databricks (initial-template)

$ databricks apps deploy test-app --source-code-path "//Workspace/Users/[email protected]/test-app"

Error: Source code path: //Workspace/Users/[email protected]/test-app must be a valid workspace path.

beneuto avatar May 12 '25 12:05 beneuto

This issue came up in #2851 internally just now.

The path conversion seems to be done by your shell. Can you try setting MSYS_NO_PATHCONV=1?

pietern avatar May 12 '25 13:05 pietern

Can you try setting MSYS_NO_PATHCONV=1?

That fixed it, thanks.

beneuto avatar May 13 '25 09:05 beneuto

Excellent, thanks for confirming.

pietern avatar May 13 '25 09:05 pietern