Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
Showing results for 
Search instead for 
Did you mean: 

Init script problems | workspace location

New Contributor II

At this moment, I'm working on removing Legacy global and cluster-named init

scripts due, it will be disabled for all workspaces on 01 Sept.

At this moment, I'm facing a strange problem regarding moving init scripts from dbfs to the Workspace location: 

When I start the cluster with init scripts in the poc folder, everything works fine. 

 image.pngBut, when we change to another workspace location, we are receiving this error:

imageInit script failure:BAD_REQUEST: Node type must be TreeFile but the input type is: shell

NOTE: it Is important to mention both: files and folders have exactly the same permissions

I would appreciate it if you could shed some light on the potential reasons for this issue. Is there any specific factor or configuration that might be causing this unexpected behavior? Your insights would be greatly appreciated 


Not applicable

Hi @luisvasv​ 

Great to meet you, and thanks for your question!

Let's see if your peers in the community have an answer to your question. Thanks.

Esteemed Contributor III
Esteemed Contributor III

How did you upload the init script to the workspace files? Was it using the CLI? 

I suspect this could be a format issue. For example, if you upload the init script using cli, the .sh file will be considered a workspace file rather than a .sh file. For this, you must use the format option to upload the file.

 $curl -u user:pwd -H "Content-Type: application/json" -X POST -d '{"path": "/Users/<userpath>/","format": "AUTO","content": "==abcdefghijklmno=="}' --header 'Authorization: Bearer YOUR_USER_TOKEN_GENERATED_FROM_UI'


I am facing the same issue. I have tried creating the script manually and uploading it via the CLI - the result is the same.
I have tried converting the script ot a .py file to no avail - the same persists.

New Contributor II

I did face this issue. I got support from MS on the resolution. We cannot rename the file directly from the context menu to add prefix ".sh" for shell script. It has to be following the navigation - click the button "Add Files" in the workspace folder where you want to add a shell script or other type of file other than notebook/library. Then add the shell script commands and give it a name prefixed with ".sh". This will resolve the issue.  

New Contributor III

Using the new CLI v0.214, uploading ".sh" file works fine.

`databricks workspace import --overwrite --format AUTO --file init_setup /init/user/job/init_setup`
Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!