2015-03-24 22 views
25

Tôi đã có Azure SDK 2.5 và Công cụ dành cho VS2013 được cài đặt và hoạt động tốt trong một thời gian. Hôm nay tôi đã cài đặt SDK và Công cụ cho VS2015 và bây giờ Trình mô phỏng lưu trữ Azure của tôi sẽ không khởi động. Lần thử đầu tiên để bắt đầu nó tôi nhận được một SqlException:Trình giả lập lưu trữ Azure không thành công sau khi thêm VS 2015 SDK

Unhandled Exception: System.Data.SqlClient.SqlException: 
An error occurred while processing the log for database If possible, 
restore from backup. If a backup is not available, it might be 
necessary to rebuild the log. 

Sau khi khởi động lại máy, tôi nhận được một lỗi nhỏ:

C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>WAStorageEmulator start Windows Azure Storage Emulator 
3.4.0.0 command line tool Error: The storage emulator needs to be initialized. Please run the 'init' command. 

Nhưng chạy init không hoạt động:

C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>WAStorageEmulator init Windows Azure Storage Emulator 3.4.0.0 command line tool Error: Cannot create database. 

Bắt đầu bằng -inprocess cho biết thông tin đăng nhập của tôi không thành công. Tôi là quản trị viên trên máy nên điều này thật kỳ quặc.

C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>WAStorageEmulator start -inprocess 
Windows Azure Storage Emulator 3.4.0.0 command line tool 
Cannot open database "WAStorageEmulatorDb34" requested by the login. The login failed. 
Login failed for user 'DOMAIN\genslow'. 
3/24/2015 10:00:57 AM [Info] Starting Service: Blob 
3/24/2015 10:00:57 AM [Verbose_debug] [Nephos.Storage] { Initialize 
3/24/2015 10:00:57 AM [Info_debug] Loading config Param NephosAllowPathStyleUris (Allow path-style URIs) read: true 
3/24/2015 10:00:57 AM [Info_debug] Successfully loaded NephosAllowPathStyleUris: True 
3/24/2015 10:00:57 AM [Info_debug] Loading config Param NephosIncludeInternalDetailsInErrorResponses (Include internal details in error responses) read: false 
3/24/2015 10:00:57 AM [Info_debug] Successfully loaded NephosIncludeInternalDetailsInErrorResponses: False 
3/24/2015 10:00:57 AM [Info_debug] Loading config Param StampName (Stamp Name) read: StorageEmulator 
3/24/2015 10:00:57 AM [Info_debug] BlockBlob: Load Interval failed. IsGC: True, Exception at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt) 
    at Microsoft.WindowsAzure.DevelopmentStorage.Store.BlockBlobGarbageCollector.GetTimerIntervalOrDefault(Boolean isGC) 
3/24/2015 10:00:57 AM [Info_debug] BlockBlob: Load Interval failed. IsGC: False, Exception at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt) 
    at Microsoft.WindowsAzure.DevelopmentStorage.Store.BlockBlobGarbageCollector.GetTimerIntervalOrDefault(Boolean isGC) 
3/24/2015 10:00:57 AM [Verbose_debug] [Nephos.Storage] } Initialize 
Service Status: Blob http://127.0.0.1:10000/ True 
3/24/2015 10:00:57 AM [Info] Starting Service: Queue 
3/24/2015 10:00:57 AM [Verbose_debug] [Nephos.Queue] { Initialize 
3/24/2015 10:00:57 AM [Info_debug] Loading config Param NephosAllowPathStyleUris (Allow path-style URIs) read: true 
3/24/2015 10:00:57 AM [Info_debug] Successfully loaded NephosAllowPathStyleUris: True 
3/24/2015 10:00:57 AM [Info_debug] Loading config Param NephosIncludeInternalDetailsInErrorResponses (Include internal details in error responses) read: false 
3/24/2015 10:00:57 AM [Info_debug] Successfully loaded NephosIncludeInternalDetailsInErrorResponses: False 
3/24/2015 10:00:57 AM [Info_debug] Loading config Param StampName (Stamp Name) read: StorageEmulator 
3/24/2015 10:00:57 AM [Verbose_debug] [DevelopmentStorage.Queue] } Initialize 
Service Status: Queue http://127.0.0.1:10001/ True 
3/24/2015 10:00:57 AM [Info] Starting Service: Table 
3/24/2015 10:00:57 AM [Verbose_debug] [Nephos.Table] { Initialize 
3/24/2015 10:00:57 AM [Info_debug] Loading config Param NephosAllowPathStyleUris (Allow path-style URIs) read: true 
3/24/2015 10:00:57 AM [Info_debug] Successfully loaded NephosAllowPathStyleUris: True 
3/24/2015 10:00:57 AM [Info_debug] Loading config Param NephosIncludeInternalDetailsInErrorResponses (Include internal details in error responses) read: false 
3/24/2015 10:00:57 AM [Info_debug] Successfully loaded NephosIncludeInternalDetailsInErrorResponses: False 
3/24/2015 10:00:57 AM [Info_debug] Loading config Param StampName (Stamp Name) read: StorageEmulator 
3/24/2015 10:00:57 AM [Info] NOT using custom threadpool for blocking calls 
Service Status: Table http://127.0.0.1:10002/ True 

Chạy init với -inprocess cung cấp cho các chi tiết sau đây:

C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>WAStorageEmulator init -inprocess 
Windows Azure Storage Emulator 3.4.0.0 command line tool 
Added reservation for http://127.0.0.1:10000/ in user account DOMAIN\genslow. 
Added reservation for http://127.0.0.1:10001/ in user account DOMAIN\genslow. 
Added reservation for http://127.0.0.1:10002/ in user account DOMAIN\genslow. 

Found SQL Instance (localdb)\MSSQLLocalDB. 

Creating database WAStorageEmulatorDb34 on SQL instance '(localdb)\MSSQLLocalDB'. 
Cannot create database 'WAStorageEmulatorDb34' : Database 'WAStorageEmulatorDb34' 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. 
Error: Cannot create database 'WAStorageEmulatorDb34' : Database 'WAStorageEmulatorDb34' already exists. Choose a different database name.. 

Vì vậy, là có anyway để phục hồi từ này hay tôi nên gỡ bỏ cài đặt tất cả mọi thứ và bắt đầu lại?

Trả lời

74

Bạn có thể sử dụng quy trình sau để khôi phục từ hầu hết các sự cố init liên quan đến cơ sở dữ liệu. Lưu ý rằng bất kỳ dữ liệu nào trong trình mô phỏng hiện tại sẽ bị mất.

Xóa dụ SQL:

sqllocaldb stop MSSQLLocalDB 
sqllocaldb delete MSSQLLocalDB 

Bây giờ xóa các tập tin cơ sở dữ liệu sau đây:

%USERPROFILE%\AzureStorageEmulatorDb*.mdf 
%USERPROFILE%\AzureStorageEmulatorDb*.ldf 

Cuối cùng, tái thẩm sql:

sqllocaldb start MSSQLLocalDB 

Sau đó thử lại các init giả lập.

+2

Cảm ơn, điều đó cũng làm việc hoàn hảo cho tôi. –

+0

Cảm ơn bạn, tôi đã có cùng một vấn đề với Azure SDK 2.8.2 và bộ giả lập lưu trữ 4.2 và điều này giải quyết được vấn đề – Frederic

+0

Tôi đã có một vấn đề tương tự, nhưng tôi không có tệp WAStorageEmulatorDb * .mdf và WAStorageEmulatorDb * .ldf trong % USERPROFILE% thư mục. –

Các vấn đề liên quan