normalian blog

Let's talk about Microsoft Azure, ASP.NET and Java!

Windows Azure Storage Emulator のインストールに失敗する場合の TIPS

Web Platform Installer 等を利用して Azure SDK のセットアップをする際、Windows Azure Storage Emulator のインストールに失敗することがある。今回はこちらを解決するかもしれない TIPS を紹介する。今回の作業による影響範囲は見切っていないので、実施は自己責任でお願いしたい

概要

Web Platform Installer 等を利用してインストールに失敗した場合、エラーダイアログからログを閲覧することができる。インストールの失敗ログを開き、以下のエラーが存在しているかを確認する。

<中略>
Action start 11:02:11: InstallFinalize.
CAQuietExec:  Windows Azure Storage Emulator 3.4.0.0 command line tool
CAQuietExec:  Error: Cannot create database.
CAQuietExec:  Error 0xfffffff3: Command line returned an error.
CAQuietExec:  Error 0xfffffff3: CAQuietExec Failed
CustomAction RunInitialize returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 11:02:12: InstallFinalize. Return value 3.
Action ended 11:02:12: INSTALL. Return value 3.
Property(S): UpgradeCode = {CF5CD495-AEDE-42DA-B7CF-A70D398D4E6A}
<中略>

上記を見ると、どうやらデータベースを作成できないらしい。ご存知の方もいるかもしれないが、Azure のエミュレータはローカルにデータベースを持つので、そちらが再作成がうまくいっていないようだ。
こちらのエラーで検索すると MSDN フォーラムで "CAQuietExec: Error: Cannot create database." の記事を見つけた。いろいろと議論がある様だが、ポイントは以下だ。

Hi,

That may not be sufficient.

As far as I'm concerned, my first install attemp left some files in my c:\users\[user] directory :

WAStorageEmulatorDb30.mdf
WAStorageEmulatorDb30_log.ldf

The sqllocaldb logs would mention these files still existed and it would not erase them.

I just deleted them manually.
Recreated the v11.0 (without the double quotes, please):

sqllocaldb stop v11.0
sqllocaldb delete v11.0
sqllocaldb create v11.0

私の場合は C:\users\[user directory] に以下のファイルが存在したので、すべて削除(別フォルダに移動)した。

  • WAStorageEmulatorDb33.mdf
  • WAStorageEmulatorDb33_log.ldf
  • WAStorageEmulatorDb34.mdf
  • WAStorageEmulatorDb34_log.ldf

次にコマンドラインを開き(管理者権限は不要)、以下のコマンドを実行した。

sqllocaldb stop v11.0
sqllocaldb delete v11.0
sqllocaldb create v11.0

後は再度 Azure SDK のインストールを実行すれば問題なくインストールが完了すると思われる。