SQL Configuration step issue in Ubuntu Instance

Pratik Narottam Panchal 0 Reputation points
2025-12-04T05:16:29.8166667+00:00

While configuring SQL Server for the first time on Ubuntu_22.04-x86_64-SQL_2022_Standard-2025.08.28, I encountered an error that occurs frequently. I need to retry the setup 2–3 times before it works properly. Any Solution to fix this part?

++ bash -c '/opt/mssql/bin/mssql-conf -n setup'

Broadcast message from root@ip-172-****(Thu 2025-12-04 05:03:42 UTC):

The system is going down for reboot at Thu 2025-12-04 05:04:42 UTC!

Broadcast message from root@ip-172-* (Thu 2025-12-04 05:04:43 UTC):

The system is going down for reboot NOW!

Session terminated, killing shell... Filename: /usr/lib/python3.10/subprocess.py

Function: _try_wait

Line number: 1917

Filename: /usr/lib/python3.10/subprocess.py

Function: _wait

Line number: 1959

  Filename: /usr/lib/python3.10/subprocess.py

  Function: wait

  Line number: 1209
``` ...killed.

Terminated

Failed to start mssql-server.service: Transaction for mssql-server.service/start is destructive (sysinit.target has 'stop' job queued, but 'start' is included in transaction).

SQL Server Database Engine
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Shruti Dhruv 405 Reputation points Microsoft External Staff Moderator
    2025-12-05T05:12:50.74+00:00

    Hi Pratik ,

    Welcome to Microsoft Q&A Forum!

    You can follow below troubleshooting steps-
    1.Check if SQL Server Installed Correctly-
    dpkg -l | grep mssql-server

    2.Check Service Status
    systemctl status mssql-server
    If its not running :
    sudo systemctl start mssql-server
    sudo systemctl enable mssql-server

    3.Connect to SQL Server
    Install the SQL command-line tools:
    sudo apt install -y mssql-tools unixodbc-dev

    Then connect:
    /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'YourPassword'
    If the configuration step fails repeatedly, you can reset and re-run:
    sudo systemctl stop mssql-server sudo rm -rf /var/opt/mssql/* sudo /opt/mssql/bin/mssql-conf setup.

    You can also refer troubleshooting guides-
    https://dori-uw-1.kuma-moon.com/en-us/sql/linux/sql-server-linux-troubleshooting-guide?view=sql-server-ver17#connection
    https://www.sqlshack.com/sql-server-installation-troubleshooting-on-ubuntu/

    I hope this helps!
    Let me know how did that go for you.
    Thank You

    0 comments No comments

  2. Pratik Narottam Panchal 0 Reputation points
    2025-12-08T05:37:55.33+00:00

    Here’s a polished version of your text with corrected grammar and improved clarity:


    Hi Shruti,

    Thank you for your comment. As per your recommendation, I have checked all the steps, and they worked. However, I have a concern: in the first step, when I start configuring mssql-server for the first time, it sometimes takes a long time to configure or even hangs at that step. Then, suddenly, I get a pop-up with the error message below, and I have no idea why it takes so long at times, while other times it is quick.

    We are using a pre-installed SQL Server instance. Instance Information:

    • AMI: Ubuntu_22.04-x86_64-SQL_2022_Standard-2025.08.28
    • Location: amazon/Ubuntu_22.04-x86_64-SQL_2022_Standard-2025.08.28

    Error Message:

    Broadcast message from root@ip-* (Thu 2025-12-04 05:03:42 UTC):
    
    The system is going down for reboot at Thu 2025-12-04 05:04:42 UTC!
    
    Session terminated, killing shell...  Filename: /usr/lib/python3.10/subprocess.py
      Function: _try_wait
      Line number: 1917
        Filename: /usr/lib/python3.10/subprocess.py
        Function: _wait
        Line number: 1959
          Filename: /usr/lib/python3.10/subprocess.py
          Function: wait
          Line number: 1209
     ...killed.
    Terminated
    
    Hangup 
    

    Would you like me to make this more formal and professional for email communication, or keep it conversational for internal chat?

    0 comments No comments

  3. Shruti Dhruv 405 Reputation points Microsoft External Staff Moderator
    2025-12-08T11:59:25.2166667+00:00

    Hi Pratik,

    Thank you for sharing the error details.
    The instance broadcasted a system-wide reboot “The system is going down for reboot…” which forcibly terminated your interactive Python process, hence the subprocess.py … killed / Hangup).
    This usually happens due to unattended upgrades.

    According to the documentation, Ubuntu will apply security updates automatically, without user interaction. This is done via the unattended-upgrades package, which is installed by default.
    If for some reason the package is not present, it can be installed with the following command-
    sudo apt install unattended-upgrades

    Refer- https://documentation.ubuntu.com/server/how-to/software/automatic-updates/
    For more information on Automatic Security Updates, please refer-
    https://help.ubuntu.com/community/AutomaticSecurityUpdates
    This will help you get some clarity on the issue.

    Thank You. Let me know if that helps!


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.