API/Python/Open-Source Solutions

Expand all | Collapse all

provision sql database using the api, results in Error "action=Make sure databaseName is not empty and try again."

Jump to Best Answer
  • 1.  provision sql database using the api, results in Error "action=Make sure databaseName is not empty and try again."

    Posted 08-12-2014 01:28:00 PM
    Goal

    Provision a SQL Server VDB using the REST API

    Steps to reproduce

    Using the API

    Using the api I discover the target group, host and timeflow parameters and then post the following json

    {    "container": {
            "group": "GROUP-5",
            "name": "VGenesis_2D8",
            "type": "MSSqlDatabaseContainer"
        },
        "recoveryModel": "SIMPLE",
        "source": {
            "type": "MSSqlVirtualSource"
        },
        "sourceConfig": {
            "databaseName": "VGenesis_2D8",
            "instance": {
                "host": "HOST-10",
                "type": "MSSqlInstanceConfig"
            },
            "repository": "MSSQL_INSTANCE-4",
            "type": "MSSqlSIConfig"
        },
        "timeflowPointParameters": {
            "timeflow": "MSSQL_TIMEFLOW-1",
            "timestamp": "2014-08-12T12:45:13.000Z",
            "type": "TimeflowPointTimestamp"
        },
        "type": "MSSqlProvisionParameters"
    }

    Result (status 200)

    {      "error": {          "action": "Make sure databaseName is not empty and try again.",          "details": "The field databaseName of the database configuration is required.",          "message": "exception.db.mssqlvdb.vdb.target_db.no_database_name"      },      "status": "ERROR"  }

    However using the web flash UI and a packet sniffer I see identical post:
    {      "container": {          "group": "GROUP-5",          "name": "VGenesis_2D7",          "type": "MSSqlDatabaseContainer"      },      "recoveryModel": "SIMPLE",      "source": {          "type": "MSSqlVirtualSource"      },      "sourceConfig": {          "databaseName": "VGenesis_2D7",          "instance": {              "host": "HOST-10",              "type": "MSSqlInstanceConfig"          },          "repository": "MSSQL_INSTANCE-4",          "type": "MSSqlSIConfig"      },      "timeflowPointParameters": {          "timeflow": "MSSQL_TIMEFLOW-1",          "timestamp": "2014-08-12T12:45:13.000Z",          "type": "TimeflowPointTimestamp"      },      "type": "MSSqlProvisionParameters"  }

    Which results in (status 200)
    {      "action": "ACTION-24852",      "job": "JOB-17776",      "result": "MSSQL_DB_CONTAINER-1961",      "status": "OK",      "type": "OKResult"  }

    The only difference between the two are the http headers (perhaps the delphix server is keeping track of the selected source db using the client cookie)

    Any ideas?

    Also I noted that the status code for an error is 200, might be better to use http semantics and return in the 400/500 range?


  • 2.  RE: provision sql database using the api, results in Error "action=Make sure databaseName is not empty and try again."

    Posted 08-12-2014 04:27:00 PM
    Hey Ed. I am not in front of a lab to test this, but I would file a ticket. It could just be an issue with the rest api on our end. Suppurt will het back to you much quicker than I can. If you get an answer before I can follow up, please post the result here!


  • 3.  RE: provision sql database using the api, results in Error "action=Make sure databaseName is not empty and try again."

    Posted 08-12-2014 05:00:00 PM
    Hi, please can you post your Delphix Engine version, and the Windows/MSSQL versions?


  • 4.  RE: provision sql database using the api, results in Error "action=Make sure databaseName is not empty and try again."

    Posted 08-12-2014 06:37:00 PM
    Delphix - 
     
    "apiVersion": {             "major": 1,             "micro": 2,             "minor": 2,             "type": "APIVersion"         },         "buildTimestamp": "2013-10-10T17:25:53.000Z",         "buildTitle": "Delphix Engine 3.2.3.1",         "buildVersion": {             "major": 3,             "micro": 3,             "minor": 2,             "patch": 1,             "type": "VersionInfo"         },

    source - host
    {     "action": null,     "job": null,     "result": {         "addresses": [             "*****"         ],         "connectorAuthenticationKey": null,         "connectorPort": 0.0,         "dateAdded": "2013-10-31T13:39:11.753Z",         "enabled": true,         "hostConfiguration": {             "discovered": false,             "lastRefreshed": null,             "lastUpdated": null,             "machine": {                 "memorySize": 0.0,                 "platform": "AMD64",                 "type": "HostMachine"             },             "operatingSystem": {                 "distribution": "Windows",                 "kernel": "7601.win7sp1_gdr.130801-1533",                 "name": "Windows",                 "release": "6.1",                 "timezone": "Europe/London,BST+0100",                 "type": "HostOS",                 "version": "Windows Server 2008 R2 Enterprise"             },             "type": "HostConfiguration"         },         "hostRuntime": {             "available": false,             "traceRouteInfo": null,             "type": "HostRuntime"         },         "name": "******",         "namespace": null,         "reference": "HOST-5",         "rsyncPath": null,         "sshPort": 0,         "toolkitPath": null,         "type": "WindowsHost"     },     "status": "OK",     "type": "OKResult" }
    target - host
    {             "addresses": [                 "*******"             ],             "connectorAuthenticationKey": "******==",             "connectorPort": 9100.0,             "dateAdded": "2013-11-11T11:22:36.791Z",             "enabled": true,             "hostConfiguration": {                 "discovered": false,                 "lastRefreshed": null,                 "lastUpdated": null,                 "machine": {                     "memorySize": 68719009792.0,                     "platform": "AMD64",                     "type": "HostMachine"                 },                 "operatingSystem": {                     "distribution": "Windows",                     "kernel": "7601.win7sp1_rtm.101119-1850",                     "name": "Windows",                     "release": "6.1",                     "timezone": "Europe/London,BST+0100",                     "type": "HostOS",                     "version": "Windows Server 2008 R2 Enterprise"                 },                 "type": "HostConfiguration"             },             "hostRuntime": {                 "available": true,                 "traceRouteInfo": {                     "networkHops": "1     2 ms     3 ms     3 ms  ****",                     "type": "TracerouteInfo"                 },                 "type": "HostRuntime"             },             "name": "*********",             "namespace": null,             "reference": "HOST-10",             "rsyncPath": null,             "sshPort": 0,             "toolkitPath": "C:\Program Files\Delphix\DelphixConnector",             "type": "WindowsHost"         }


    dSource - repository

    {             "environment": "WINDOWS_HOST_ENVIRONMENT-5",             "installationPath": "c:\Program files\\100",             "instanceName": "MSSQLSERVER",             "instanceOwner": "***\SQLService",             "internalVersion": "661",             "linkingEnabled": true,             "name": "MSSQLSERVER",             "namespace": null,             "port": 1433,             "provisioningEnabled": true,             "reference": "MSSQL_INSTANCE-2",             "serverName": "*****",             "staging": false,             "type": "MSSqlInstance",             "version": "10.52.4000.0"  }

    vDatabase - repository

    {             "environment": "WINDOWS_HOST_ENVIRONMENT-13",             "installationPath": "C:\Program Files\Microsoft SQL Server\\100",             "instanceName": "MSSQLSERVER",             "instanceOwner": "***\delphixservice",             "internalVersion": "661",             "linkingEnabled": true,             "name": "MSSQLSERVER",             "namespace": null,             "port": 1433,             "provisioningEnabled": true,             "reference": "MSSQL_INSTANCE-4",             "serverName": null,             "staging": false,             "type": "MSSqlInstance",             "version": "10.50.1600.1"         }


  • 5.  RE: provision sql database using the api, results in Error "action=Make sure databaseName is not empty and try again."

    Posted 08-12-2014 06:40:00 PM
    Thanks Adam, I'll open a ticket referencing this post and post any resolution here.


  • 6.  RE: provision sql database using the api, results in Error "action=Make sure databaseName is not empty and try again."

    Posted 08-14-2014 08:40:00 AM
    The JSON being used is fine, and works for me submitted using curl (with references changed for my Delphix Engine), as well as one of my colleagues. There seems to be some issue with the method of submission, which we are investigating via a support ticket, but I will also update this topic when appropriate.


  • 7.  RE: provision sql database using the api, results in Error "action=Make sure databaseName is not empty and try again."

    Posted 08-14-2014 11:36:00 AM
    POST vs GET?


  • 8.  RE: provision sql database using the api, results in Error "action=Make sure databaseName is not empty and try again."
    Best Answer

    Posted 08-14-2014 11:46:00 AM
    The cause of that error has turned out to be due to the APIVersion being used. The failure happens for 1.1.0, but works fine using 1.2.2, and I get the same error if I retry using that 1.1.0 version, so it's a schema change problem.


  • 9.  RE: provision sql database using the api, results in Error "action=Make sure databaseName is not empty and try again."

    Posted 08-14-2014 11:47:00 AM
    thanks Scott. That is where I was originally guessing the issue was.


  • 10.  RE: provision sql database using the api, results in Error "action=Make sure databaseName is not empty and try again."

    Posted 08-14-2014 12:09:00 PM
    Thanks for the help guys


  • 11.  RE: provision sql database using the api, results in Error "action=Make sure databaseName is not empty and try again."

    Posted 08-22-2014 04:58:00 PM
    I encountered a similar issue... just following the documentation, we'll tend to use 1.1.0. It would be helpful to others to explain API versions in the beginning of the document.


  • 12.  RE: provision sql database using the api, results in Error "action=Make sure databaseName is not empty and try again."

    Posted 08-22-2014 05:00:00 PM
    Avindra,
    That is a great point, we will fix our documentation to make this more clear moving forward!