Cosmos DB Emulator: Failed to get authorization he

2019-02-17 02:51发布

I upgraded Azure Cosmos DB Emulator from version 1.22 to 2.0. Now when I go to the local Data Explorer, nothing loads in the Explorer tab and I see error

Failed to get authorization headers for offers: {"readyState":4,"responseText":"{\"code\":\"InternalServerError\",\"message\":\"Unknown server error occurred when processing this request.\r\nActivityId: 48afdb03-e04b-4a5e-b568-e268c32eb10f, Microsoft.Azure.Documents.Common/2.0.0.0\"}","responseJSON":{"code":"InternalServerError","message":"Unknown server error occurred when processing this request.\r\nActivityId: 48afdb03-e04b-4a5e-b568-e268c32eb10f, Microsoft.Azure.Documents.Common/2.0.0.0"},"status":500,"statusText":"error"}

I have tried reinstalling it, restarting the PC, and running it as an administrator.

What can I do to fix this?

2条回答
Summer. ? 凉城
2楼-- · 2019-02-17 03:16

In my case, I had to uninstall / reinstall the emulator, then after a reboot I did a "Reset data..." in the emulator's context menu (as described by Nick), and afterwards it was working again.

Resetting the data alone did not do the trick in my case.

Note: "Reset data..." deletes the local Cosmos DB Emulator folder, then it stops and restarts the emulator service. This is the directory the emulator is using:

C:\Users\[userid]\AppData\Local\CosmosDBEmulator

While the emulator itself doesn't have many config options, there are 3 config files in the directory mentioned above: ComputeMachine.Config, Machine.Config and GatewayMachine.Config.


Update: There doesn't seem to be a permanent solution for the behavior that the emulator service hangs up. It is still unreliable. I am contacting the developer team, hope it helps.

查看更多
【Aperson】
3楼-- · 2019-02-17 03:27

It looks like 2.0.0 CosmosDB Emulator requires you to reset the data that's in it. That's the only thing that fixed it for me.

You can do that from the CosmosDB emulator icon

enter image description here

Once you reset, it will work. Also keep in mind that pre 2.0 SDKs won't work on the new emulator.

查看更多
登录 后发表回答