Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Azure Storage Emulator attempts to create LocalDB files in c:\Users #635

Closed
abatishchev opened this issue Feb 20, 2018 · 13 comments
Closed
Labels

Comments

@abatishchev
Copy link

When I run this command:

AzureStorageEmulator.exe init -forcecreate

I'm getting this error:

Windows Azure Storage Emulator 5.3.0.0 command line tool
Found SQL Instance (localdb)\MSSQLLocalDB.
Creating database AzureStorageEmulatorDb53 on SQL instance '(localdb)\MSSQLLocalDB'.
Cannot create database 'AzureStorageEmulatorDb53' : The database 'AzureStorageEmulatorDb53' does not exist. Supply a valid database name. To see available databases, use sys.databases..
One or more initialization actions have failed. Resolve these errors before attempting to run the storage emulator again.
Error: Cannot create database 'AzureStorageEmulatorDb53' : The database 'AzureStorageEmulatorDb53' does not exist. Supply a valid database name. To see available databases, use sys.databases..

In the log file I see this error:

2018-02-20 13:59:03.21 spid53 CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'C:\Users\alexbat.REDMONDAzureStorageEmulatorDb53.mdf'.

So it attempts to create C:\Users\alexbat.REDMONDAzureStorageEmulatorDb53.mdf rather than C:\Users\alexbat.REDMOND\AzureStorageEmulatorDb53.mdf (note the slash before the file name).

Do you know why? How can this be fixed? I was getting the same error with ASE 5.2.

@abatishchev abatishchev changed the title Azure Storage Emulator attemptes to create LocalDB files in c:\Users Azure Storage Emulator attempts to create LocalDB files in c:\Users Feb 21, 2018
@abatishchev
Copy link
Author

Can anyone take a look, please? Our route me to the appropriate team/contact?

@erezvani1529
Copy link
Contributor

Hi @abatishchev,

Please follow the steps that we have outline here and let us know if you still see any issues.

Thanks!

@abatishchev
Copy link
Author

abatishchev commented Feb 22, 2018

As I said in the last paragraph, the issue is that it tries to create %USERPROFILE%AzureStorageEmulatorDb53.mdf instead of %USERPROFILE%\AzureStorageEmulatorDb53.mdf.

@mirobers
Copy link
Member

I see, the final backslash in the path is just missing. We'll take a look. @kfarmer-msft

@abatishchev
Copy link
Author

hi @mirobers, I talked to @kfarmer-msft and we concluded that this issues is likely related to LocalDB/SQL Server rather than to Azure Storage Emulator. Do you have by chance any point of contact there? Here's a public bug report which I'm basically facing too.

@ranouf
Copy link

ranouf commented Mar 20, 2018

I Have the same error, any solution?

@abatishchev
Copy link
Author

@ranouf see my answer on DBA.SE

@ndroussi-xo
Copy link

I tried to clean up localdb but didn't work, so anyone has an issue running storage emulator with local db can benefit from this command to run it on SqlExpress.

Command: AzureStorageEmulator.exe init -server . -sqlinstance SQLEXPRESS -forcecreate

@scottywakefield
Copy link

same problem again upgrading from 5.6 to 5.7...

@neoandeson
Copy link

neoandeson commented Jan 20, 2019

This solution is not recommended in generally, but you can try it.
I think AzureStorageEmulator by somehow can not full access the localDB whitch setup in directory has limited the permission.

  1. You can go to folder propertiy > sercurity > edit to full permission ( with me directory is user > Appdata).
  2. Restart the emulator
    inkeduntitled3_li
    Now it worked. You must consider it's unsercurity later on.

@DawaLaw
Copy link

DawaLaw commented Jan 21, 2019

If you are using LocalDB for SQL Server 2017 and hit the above issue, you may want to try install CU6 for SQL Server 2017 here: https://support.microsoft.com/en-sg/help/4101464

The fixes includes the following:
FIX: "Access is denied" error when you try to create a database in SQL Server 2017 Express LocalDB.
Reference: https://support.microsoft.com/en-us/help/4096875/fix-access-is-denied-error-when-you-try-to-create-a-database-in-sql-se

@davemichel
Copy link

I tried the latest CU yesterday to no avail. I was able to install Emulator with "AzureStorageEmulator init /forcecreate /sqlinstance MSSQLLocalDB". I could not use (localdb)\MSSQLLocalDB for some reason, but you can still connect to .\MSSQLLocalDB in SSMS if you want to see the Emulator data sausage.

It sure would be nice if Microsoft would fix this problem with SQL 2017.

@douglashm
Copy link

If you are using LocalDB for SQL Server 2017 and hit the above issue, you may want to try install CU6 for SQL Server 2017 here: https://support.microsoft.com/en-sg/help/4101464

The fixes includes the following:
FIX: "Access is denied" error when you try to create a database in SQL Server 2017 Express LocalDB.
Reference: https://support.microsoft.com/en-us/help/4096875/fix-access-is-denied-error-when-you-try-to-create-a-database-in-sql-se

it worked for me 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests