cancel
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.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Init script problems | workspace location

luisvasv
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 

5 REPLIES 5

Anonymous
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.

Prabakar
Databricks Employee
Databricks Employee

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>/initscript.sh","format": "AUTO","content": "==abcdefghijklmno=="}' https://adb-xxxxxxx.azuredatabricks.net/api/2.0/workspace/import --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.

kranthi2
New Contributor III

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.  

DE-cat
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`

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group