简体   繁体   中英

Error while starting Storage Emulator on windows azure

I'm getting the error below while starting the storage emulator. By mistake I deleted the mdf and log files in users/admin folder. It's holding reference someplace and not allowing me to create the DB again. Please help me.

Added reservation for 127.0.0.1:10000/ in user account RaviBorra-PC\Ravi Borra.
Added reservation for 127.0.0.1:10001/ in user account RaviBorra-PC\Ravi Borra.
Added reservation for 127.0.0.1:10002/ in user account RaviBorra-PC\Ravi Borra.

Found SQL Instance (localdb)\v11.0.
Creating database DevelopmentStorageDb201206 on SQL instance '(localdb)\v11.0'.
Cannot create database 'DevelopmentStorageDb201206' : Database 'DevelopmentStorageDb201206' already exists. Choose a different database name..

One or more initialization actions have failed. Resolve these errors before attempting to run the storage emulator again. Please refer to http://go.microsoft.com/fwlink/?LinkID=248088 for more details.

Thank you, Ravi Krishna B.

Do these steps:

  1. Open cmd.exe (Command Prompt)
  2. Write this:

     SqlLocalDb stop "v11.0" SqlLocalDb delete "v11.0"

    and press Enter

Note that "v11.0" is MyInstance .

For more details, visit this link .

This problem may occur if you delete the data file C:\\Users\\<Username>\\DevelopmentStorageDb201206.mdf but do not delete the corresponding database on the LocalDB server instance. One possible solution is:

  1. Connect to the (localdb)\\v11.0 instance from SQL Server Management Studio .
  2. Delete the DevelopmentStorageDb201206 database. There will be the error message that the database deletion ended with an error. Ignore this message and refresh the database list manually.
  3. Now you can start the Azure Storage Emulator.

This is not a problem related with Azure components rather LocalDB instance is reporting back to Azure request that DB still exist. Check LocalDB instances in your machine using "sqllocaldb i" first and the delete the instance using "sqllocaldb d 'instance_name'". I could not test it in my machine but this may unblock you if localdb instance is blocking you.

In Windows Azure SDK 1.7, Windows Azure Storage Emulator uses LocalDB instance specific configuration at following location:

%LocalAppData%\DevelopmentStorage\DevelopmentStorage.201206.config

And based on that you will see that v11.0 instance is Windows Azure Storage Emulator specific so verify if that is running and deleting it will let DSInit to create the DB again in LocalDB.

If you have Sql Express installed on your local box then (localdb)\\v11.0 is most likely not your local Sql instance. It is more likely {MyComputerName}\\SQLEXPRESS.

Going to:

C:\Users\<yourloginname>\AppData\Local\DevelopmentStorage\DevelopmentStorage.201206.config

And changing:

 <SQLInstance>(localdb)\v11.0</SQLInstance>

To:

<SQLInstance>{MyComputerName}\SQLEXPRESS</SQLInstance>

solved this error for me.

I hope this helps..

If you already tried and failed perform:

 SQLLocalDB stop v11.0
 SQLLocalDB delete v11.0
 Delete all the files in C:\Users\<accontname>\WAStorageEmulatorDb* (usually one mdf and one ldf)
 Create a new account (I called it Azure, with administrative rights)
 Run again the installation
 Installation completed!

For me this works... I had tried to format the PC before use this way. I supposte my problem is related to my username that contains "invalid" characters like Name 'NickName' Surname while the "Azure" account seems to be OK for him.

I figure it out 'cause somewhere in the log I have a property destination path set to "C:\\Users\\Name$_" that is far away for the path of my user account folder.

After that you can go on CMD.exe and prompt:

 control userpasswords2

From the control you can delete the Azure login without delete the file folders!

Hope it helps!

I simply deleted all the mdf's and ldf's in C:\\Users\\accountname\\ that started with DevelopmentStorage... or WAStorageEmulator.

Re-ran the install and it worked.

This can also be caused by the folder not existing for localDB. It looks like Visual Studio / Azure will not automatically create containing folders. I just copied the path from the error code into explorer and created the directory up to the .MDF file.

在 Visual Studio 中,转到工具 -> 选项 -> 数据库工具 -> 数据连接并将 localdb 实例名称从 v11.0 更改为其他名称。

I did have SQL Express installed, as Brian Ogden suggested in his answer, but I wanted to try & point Azure Storage Emulator to my SQL Express instance without modifying configuration files.

I did this by running the initialization process for Storage Emulator & passing my server\\instance details for SQL Express using the available switches. Below example of the command I executed (from an elevated command prompt):

AzureStorageEmulator.exe init -server MY-PC-NAME -instance MYSQLINST

This created the database successfully (in my SQL Express instance) & got my Storage Emulator working.

I am using a named instance, but I'm thinking this same approach can be used for default instances by omitting the -instance switch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM