Why does sudo apt-get update return a 100 status in a databricks init script on cluster spin up?

Haylee Gaddy 6 Reputation points
2021-12-22T17:34:45.5+00:00

Why does sudo apt-get update return a 100 status in a databricks init script on cluster spin up?

I am unable to install msodbcsql2017 in an init script. It is failing on the sudo apt-get update command, and echo'ing a 100 status code. I am able to do the install on demand within a notebook environment, but I need to be able to do it in an init script upon the cluster spinning up.

Code I am using to install via init script (NOT working):

curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
{count} votes

1 answer

Sort by: Most helpful
  1. PRADEEPCHEEKATLA 91,576 Reputation points Moderator
    2021-12-23T04:14:11.983+00:00

    Hello @Haylee Gaddy ,

    Thanks for the question and using MS Q&A platform.

    As per the repro, I'm able to install the MSODBCSQL17 using init script on Azure Databricks without any issue.

    Note: Installed on Databricks Runtime version : 9.1 LTS (includes Apache Spark 3.1.2, Scala 2.12)

    The following snippets run in a Python notebook create an init script that installs MSODBCSQL17 driver.

    159856-image.png

    Complete walkthrough on configure a cluster-scoped init script using the UI:

    159936-adb-initscript.gif

    For more details, refer to Cluster node initialization scripts and also refer to MS Q&A thread addressing similar issue.

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.