Init script stored in volume fails with permission denied error

Ensure that the cluster owner has access to the volume and the init script.

Written by Rushdha Haseena

Last published at: May 28th, 2025

Problem

While starting a cluster, your init script stored on a volume fails to execute. You see a Permission denied error even though you have sufficient permissions on the volume.

Cluster scoped init script /Volumes/<path-to-init-script>/script.sh failed: Script exit status is non-zero

 

The following image shows an example of the error in a workspace UI.

You then check the init script logs stored in the Databricks File System (DBFS) using a notebook.

dbutils.fs.head(“dbfs:/<path-to-init-script-log-file>.bash.stderr.log”,10000)

 

You see the following error message. 

‘bash:line 11: /Volume/<path-to-init-script>
Sh: Permission denied\n’

 

Cause

During cluster startup, the init script path is resolved using the cluster owner's privileges. If the owner lacks access to the volume or script, the initialization fails even if the user starting the cluster does have the necessary permissions.

 

Solution

Ensure that the cluster owner has access to the volume and the init script. 

 

To identify the creator or owner of a cluster: 

  1. Navigate to the cluster configuration UI. 
  2. Click the kebab menu and select JSON
  3. In the JSON view, look for the field creator_user_name to find the creator’s username. 
     

To grant the necessary permissions on the volume: 

  1. Navigate to the Catalog Explorer.
  2. Click on the catalog that contains the volume.
  3. Go to the Permissions tab.
  4. Click the Grant button.
  5. Assign the required permissions on the volume to the creator.

 

The following image shows the UI after navigating to the Permissions tab and highlights the Grant button location on the screen.