locked
Create Database in Azure Blob Storage Error RRS feed

  • Question

  • SQL Server Version:  2019 (15.0.2070.41)

    OS Version: Ubuntu: 16.04

    Followed instructions to create:

    - Azure Storage account

    - Storage Account Container 

    - Access Policy/Permissions

    - Generated Shared Access Signature (SAS)

    When attempting to create database receive the following error:

    Msg 1802, Level 16, State 4, Line 12
    CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
    Msg 5159, Level 24, State 5, Line 12
    Operating system error (null) on file "https://<storage_account_name>.blob.core.windows.net/data/testdb_log.ldf" during MakePreviousWritesDurable.
    Msg 596, Level 21, State 1, Line 11
    Cannot continue the execution because the session is in the kill state.
    Msg 0, Level 20, State 0, Line 11
    A severe error occurred on the current command.  The results, if any, should be discarded.

    I receive this error through SSMS and SQLCMD directly on the Ubuntu server.

    Note:  I am able to backup my a DB to this newly created storage account successfully.

    Thursday, December 26, 2019 5:35 PM

Answers

  • Microsoft support provided this as a solution to this problem:

    sudo /opt/mssql/bin/mssql-conf traceflag 3979 on

     

    then restart the Sql Server and try again

     

    systemctl restart mssql-server.service

    I executed this, and it resolved my issue.

    Mark


    • Marked as answer by eschenfe Sunday, January 12, 2020 6:56 PM
    • Edited by eschenfe Sunday, January 12, 2020 6:56 PM
    Sunday, January 12, 2020 6:56 PM

All replies

  • Hi eschenfe,

    Error 1802 is appeared  that one of the file parameters is incorrect. Could you please check the T-SQL that you create database and share it to us?

    Did you create the SQL credential that  will be used to store authentication information to connect outside of SQL Server containing the path to the storage container and the previously generated SAS key?  Could you please check your steps from below blog to see if you have missed something ? Please refer to Creating SQL databases on Azure Blob storage.    

    Please use select @@version to check your SQL server version and share us the result. I suggest you to install the latest SP and CU for it. 

    Best regard,
    Cathy 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to  MSDN Support, feel free to contact MSDNFSF@microsoft.com



    Friday, December 27, 2019 6:00 AM
  • Cathy,

    I did follow the article that you linked and received the same error.  I've also used these Microsoft articles to create my storage account, credential, and attempt to create the database and received the same error:

    "Tutorial: Use Azure Blob storage service with SQL Server 2016"

    "SQL Server data files in Microsoft Azure"

    select @@version

    Microsoft SQL Server 2019 (RTM-GDR) (KB4517790) - 15.0.2070.41 (X64)   Oct 28 2019 19:56:59   Copyright (C) 2019 Microsoft Corporation  Developer Edition (64-bit) on Linux (Ubuntu 16.04.6 LTS) <X64>

    DB creation t-sql:

    USE Master
    GO
    CREATE DATABASE testdb1
    ON
    ( NAME = testdata,
        FILENAME = 'https://<storage_account>.blob.core.windows.net/data/testdata.mdf' )
    LOG ON
    ( NAME = testlog,
        FILENAME =  'https://<storage_account>.blob.core.windows.net/data/testlog.ldf')

    Note:

    <storage_account> above is my azure storage account name.

    Mark

    • Marked as answer by eschenfe Sunday, January 12, 2020 6:54 PM
    • Unmarked as answer by eschenfe Sunday, January 12, 2020 6:54 PM
    Friday, December 27, 2019 3:41 PM
  • Microsoft support provided this as a solution to this problem:

    sudo /opt/mssql/bin/mssql-conf traceflag 3979 on

     

    then restart the Sql Server and try again

     

    systemctl restart mssql-server.service

    I executed this, and it resolved my issue.

    Mark


    • Marked as answer by eschenfe Sunday, January 12, 2020 6:56 PM
    • Edited by eschenfe Sunday, January 12, 2020 6:56 PM
    Sunday, January 12, 2020 6:56 PM