This project is read-only.

Exceptions related to Microsoft.WindowsAzure.*

Oct 31, 2013 at 4:43 AM
Edited Oct 31, 2013 at 4:44 AM
Hello,

I was trying to run the DummyApp, but it choked when it was connecting to Azure and stopped a couple of seconds after. I have tried using a non-default Azure storage account but that didn't make a difference. I pasted the console output below. Hope someone can point me to the right direction. Thanks!

Tao

======== Console Output =======
No usable HostAdapter parts could be found in assembly "C:\Users\dongtao\Documents\HomeSensing\labofthings\Hub\output\bi
naries\Pipeline\HostSideAdapters\HomeOS.Hub.Platform.Contracts.dll".
No usable HostAdapter parts could be found in assembly "C:\Users\dongtao\Documents\HomeSensing\labofthings\Hub\output\bi
naries\Pipeline\HostSideAdapters\HomeOS.Hub.Platform.Views.dll".
No usable AddInAdapter parts could be found in assembly "C:\Users\dongtao\Documents\HomeSensing\labofthings\Hub\output\b
inaries\Pipeline\AddInSideAdapters\HomeOS.Hub.Platform.Contracts.dll".
No usable AddInAdapter parts could be found in assembly "C:\Users\dongtao\Documents\HomeSensing\labofthings\Hub\output\b
inaries\Pipeline\AddInSideAdapters\HomeOS.Hub.Platform.Views.dll".
While inspecting an assembly, caught a BadImageFormatException: The file is not a valid binary: C:\Users\dongtao\Documen
ts\HomeSensing\labofthings\Hub\output\binaries\Pipeline\AddIns\HomeOS.Hub.Apps.SmartCam\msvcp110d.dll This occurred whil
e inspecting assembly C:\Users\dongtao\Documents\HomeSensing\labofthings\Hub\output\binaries\Pipeline\AddIns\HomeOS.Hub.
Apps.SmartCam\msvcp110d.dll.
While inspecting an assembly, caught a BadImageFormatException: The file is not a valid binary: C:\Users\dongtao\Documen
ts\HomeSensing\labofthings\Hub\output\binaries\Pipeline\AddIns\HomeOS.Hub.Apps.SmartCam\msvcr110d.dll This occurred whil
e inspecting assembly C:\Users\dongtao\Documents\HomeSensing\labofthings\Hub\output\binaries\Pipeline\AddIns\HomeOS.Hub.
Apps.SmartCam\msvcr110d.dll.
Socket create/connect failed with error: A connection attempt failed because the connected party did not properly respon
d after a period of time, or established connection failed because connected host has failed to respond 138.91.82.195:50
02
Waiting for commands
>
Unhandled Exception: Microsoft.WindowsAzure.StorageClient.StorageClientException: One of the request inputs is out of ra
nge. ---> System.Net.WebException: The remote server returned an error: (400) Bad Request.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at Microsoft.WindowsAzure.StorageClient.EventHelper.ProcessWebResponse(WebRequest req, IAsyncResult asyncResult, Even
tHandler`1 handler, Object sender)
   --- End of inner exception stack trace ---
   at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result()
   at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.ExecuteAndWait()
   at Microsoft.WindowsAzure.StorageClient.TaskImplHelper.ExecuteImplWithRetry[T](Func`2 impl, RetryPolicy policy)
   at Microsoft.WindowsAzure.StorageClient.CloudBlobContainer.CreateIfNotExist(BlobRequestOptions options)
   at Microsoft.WindowsAzure.StorageClient.CloudBlobContainer.CreateIfNotExist()
   at HomeOS.Hub.Common.DataStore.AzureBlobStore.CreateContainer() in c:\Users\dongtao\Documents\HomeSensing\labofthings
\Hub\Common\DataStore\Sync\AzureBlobStore.cs:line 74
   at HomeOS.Hub.Common.DataStore.AzureBlobStore..ctor(String targetContainer, CloudStorageAccount storageAccount) in c:
\Users\dongtao\Documents\HomeSensing\labofthings\Hub\Common\DataStore\Sync\AzureBlobStore.cs:line 56
   at HomeOS.Hub.Common.DataStore.AzureSynchronizer..ctor(RemoteInfo ri, String container) in c:\Users\dongtao\Documents
\HomeSensing\labofthings\Hub\Common\DataStore\Sync\AzureSynchronizer.cs:line 30
   at HomeOS.Hub.Common.DataStore.SyncFactory.CreateAzureSynchronizer(RemoteInfo ri, String container) in c:\Users\dongt
ao\Documents\HomeSensing\labofthings\Hub\Common\DataStore\Sync\SyncFactory.cs:line 55
   at HomeOS.Hub.Common.DataStore.SyncFactory.CreateSynchronizer(SynchronizerType st, RemoteInfo ri, String container) i
n c:\Users\dongtao\Documents\HomeSensing\labofthings\Hub\Common\DataStore\Sync\SyncFactory.cs:line 43
   at HomeOS.Hub.Common.Logger.InitSyncing(String accountName, String accountKey, String containerName) in c:\Users\dong
tao\Documents\HomeSensing\labofthings\Hub\Common\Logger.cs:line 131
   at HomeOS.Hub.Platform.Platform.UniqueHomeIdCheckCompleted(Boolean isUnique) in c:\Users\dongtao\Documents\HomeSensin
g\labofthings\Hub\Platform\Platform\Platform.cs:line 713
   at HomeOS.Hub.Platform.HeartbeatService.webClient_CanIClaimHomeIdCompleted(Object sender, UploadStringCompletedEventA
rgs arg) in c:\Users\dongtao\Documents\HomeSensing\labofthings\Hub\Platform\Platform\HeartbeatService.cs:line 179
   at System.Net.WebClient.OnUploadStringCompleted(UploadStringCompletedEventArgs e)
   at System.Net.WebClient.UploadStringOperationCompleted(Object arg)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object
state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, B
oolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
PS C:\Users\dongtao\Documents\HomeSensing\labofthings\Hub\output\binaries\Platform>
Oct 31, 2013 at 6:59 AM
Hi Tao,
Unhandled Exception: Microsoft.WindowsAzure.StorageClient.StorageClientException: One of the request inputs is out of ra
nge. ---> System.Net.WebException: The remote server returned an error: (400) Bad Request.
You may see the above exception when a blob container name violates the following naming rules:
  1. Blob container names must start with a letter or number, and can contain only letters, numbers, and the dash (-) character.
  2. Every dash (-) character must be immediately preceded and followed by a letter or number
  3. All letters in a container name must be lowercase.
  4. Blob container names must be from 3 through 63 characters long.
My guess is that when the logger is trying to create a container in the blob storage, but it's not happy with the container name. And the container name for the log would be "log-" + HomeId.ToLower().

Does your HomeID (in settings.xml) have character(s) that might break the rules above?

Thanks,
Danny

dongtao wrote:
Hello,

I was trying to run the DummyApp, but it choked when it was connecting to Azure and stopped a couple of seconds after. I have tried using a non-default Azure storage account but that didn't make a difference. I pasted the console output below. Hope someone can point me to the right direction. Thanks!

Tao

======== Console Output =======
No usable HostAdapter parts could be found in assembly "C:\Users\dongtao\Documents\HomeSensing\labofthings\Hub\output\bi
naries\Pipeline\HostSideAdapters\HomeOS.Hub.Platform.Contracts.dll".
No usable HostAdapter parts could be found in assembly "C:\Users\dongtao\Documents\HomeSensing\labofthings\Hub\output\bi
naries\Pipeline\HostSideAdapters\HomeOS.Hub.Platform.Views.dll".
No usable AddInAdapter parts could be found in assembly "C:\Users\dongtao\Documents\HomeSensing\labofthings\Hub\output\b
inaries\Pipeline\AddInSideAdapters\HomeOS.Hub.Platform.Contracts.dll".
No usable AddInAdapter parts could be found in assembly "C:\Users\dongtao\Documents\HomeSensing\labofthings\Hub\output\b
inaries\Pipeline\AddInSideAdapters\HomeOS.Hub.Platform.Views.dll".
While inspecting an assembly, caught a BadImageFormatException: The file is not a valid binary: C:\Users\dongtao\Documen
ts\HomeSensing\labofthings\Hub\output\binaries\Pipeline\AddIns\HomeOS.Hub.Apps.SmartCam\msvcp110d.dll This occurred whil
e inspecting assembly C:\Users\dongtao\Documents\HomeSensing\labofthings\Hub\output\binaries\Pipeline\AddIns\HomeOS.Hub.
Apps.SmartCam\msvcp110d.dll.
While inspecting an assembly, caught a BadImageFormatException: The file is not a valid binary: C:\Users\dongtao\Documen
ts\HomeSensing\labofthings\Hub\output\binaries\Pipeline\AddIns\HomeOS.Hub.Apps.SmartCam\msvcr110d.dll This occurred whil
e inspecting assembly C:\Users\dongtao\Documents\HomeSensing\labofthings\Hub\output\binaries\Pipeline\AddIns\HomeOS.Hub.
Apps.SmartCam\msvcr110d.dll.
Socket create/connect failed with error: A connection attempt failed because the connected party did not properly respon
d after a period of time, or established connection failed because connected host has failed to respond 138.91.82.195:50
02
Waiting for commands
>
Unhandled Exception: Microsoft.WindowsAzure.StorageClient.StorageClientException: One of the request inputs is out of ra
nge. ---> System.Net.WebException: The remote server returned an error: (400) Bad Request.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at Microsoft.WindowsAzure.StorageClient.EventHelper.ProcessWebResponse(WebRequest req, IAsyncResult asyncResult, Even
tHandler`1 handler, Object sender)
   --- End of inner exception stack trace ---
   at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result()
   at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.ExecuteAndWait()
   at Microsoft.WindowsAzure.StorageClient.TaskImplHelper.ExecuteImplWithRetry[T](Func`2 impl, RetryPolicy policy)
   at Microsoft.WindowsAzure.StorageClient.CloudBlobContainer.CreateIfNotExist(BlobRequestOptions options)
   at Microsoft.WindowsAzure.StorageClient.CloudBlobContainer.CreateIfNotExist()
   at HomeOS.Hub.Common.DataStore.AzureBlobStore.CreateContainer() in c:\Users\dongtao\Documents\HomeSensing\labofthings
\Hub\Common\DataStore\Sync\AzureBlobStore.cs:line 74
   at HomeOS.Hub.Common.DataStore.AzureBlobStore..ctor(String targetContainer, CloudStorageAccount storageAccount) in c:
\Users\dongtao\Documents\HomeSensing\labofthings\Hub\Common\DataStore\Sync\AzureBlobStore.cs:line 56
   at HomeOS.Hub.Common.DataStore.AzureSynchronizer..ctor(RemoteInfo ri, String container) in c:\Users\dongtao\Documents
\HomeSensing\labofthings\Hub\Common\DataStore\Sync\AzureSynchronizer.cs:line 30
   at HomeOS.Hub.Common.DataStore.SyncFactory.CreateAzureSynchronizer(RemoteInfo ri, String container) in c:\Users\dongt
ao\Documents\HomeSensing\labofthings\Hub\Common\DataStore\Sync\SyncFactory.cs:line 55
   at HomeOS.Hub.Common.DataStore.SyncFactory.CreateSynchronizer(SynchronizerType st, RemoteInfo ri, String container) i
n c:\Users\dongtao\Documents\HomeSensing\labofthings\Hub\Common\DataStore\Sync\SyncFactory.cs:line 43
   at HomeOS.Hub.Common.Logger.InitSyncing(String accountName, String accountKey, String containerName) in c:\Users\dong
tao\Documents\HomeSensing\labofthings\Hub\Common\Logger.cs:line 131
   at HomeOS.Hub.Platform.Platform.UniqueHomeIdCheckCompleted(Boolean isUnique) in c:\Users\dongtao\Documents\HomeSensin
g\labofthings\Hub\Platform\Platform\Platform.cs:line 713
   at HomeOS.Hub.Platform.HeartbeatService.webClient_CanIClaimHomeIdCompleted(Object sender, UploadStringCompletedEventA
rgs arg) in c:\Users\dongtao\Documents\HomeSensing\labofthings\Hub\Platform\Platform\HeartbeatService.cs:line 179
   at System.Net.WebClient.OnUploadStringCompleted(UploadStringCompletedEventArgs e)
   at System.Net.WebClient.UploadStringOperationCompleted(Object arg)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object
state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, B
oolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
PS C:\Users\dongtao\Documents\HomeSensing\labofthings\Hub\output\binaries\Platform>
Oct 31, 2013 at 8:26 PM
Hi Danny,

You nailed it! I had an underscore in my HomeID. After correcting that, the DummyApp was up and running, and it successfully created a blob container under the testdrive account. However, the app wasn't able to actually write to the container with the following error messages:
> Created stream C:\Users\dongtao\Documents\HomeSensing\labofthings\hub\output\Data\AppDummy/DummyHomeTD/AppDummy/dumb for AppDummy
AppDummy is now writing to stream C:\Users\dongtao\Documents\HomeSensing\labofthings\hub\output\Data\AppDummy/DummyHomeTD/AppDummy/dumb
Successfully created/attached to container log-dummyhometd.
Socket create/connect failed with error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 138.91.82.195:5002
Would you mind taking a look at this new issue? Thank you so much for your help!

Tao
Oct 31, 2013 at 9:37 PM
Hi Tao,
I am glad you figured out the first hurdle :)
Socket create/connect failed with error: A connection attempt failed because the connected party did not properly respond after a period of time, or established >connection failed because connected host has failed to respond 138.91.82.195:5002
The exception message above is due to a known bug which occurs when the home hub is trying to establish a connection with the gatekeeper service. When this connection is established successfully, it enables remote access (e.g. accessing your hub via authenticated web session). We have a fix for this issue and are currently testing the fix. It will be rolled out in the next couple of days. The fix will have both server side and hub side impacts. You'd need to get the latest build from here when we release it in the next two days.

As for the app writing to the container... have you installed Microsoft Sync Framework 2.1 (x86) SDK or the redistribution bits? If not, the files on the disk won't get sync'd to the cloud
thanks,
Danny




dongtao wrote:
Hi Danny,

You nailed it! I had an underscore in my HomeID. After correcting that, the DummyApp was up and running, and it successfully created a blob container under the testdrive account. However, the app wasn't able to actually write to the container with the following error messages:
> Created stream C:\Users\dongtao\Documents\HomeSensing\labofthings\hub\output\Data\AppDummy/DummyHomeTD/AppDummy/dumb for AppDummy
AppDummy is now writing to stream C:\Users\dongtao\Documents\HomeSensing\labofthings\hub\output\Data\AppDummy/DummyHomeTD/AppDummy/dumb
Successfully created/attached to container log-dummyhometd.
Socket create/connect failed with error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 138.91.82.195:5002
Would you mind taking a look at this new issue? Thank you so much for your help!

Tao
Nov 5, 2013 at 6:35 PM
Hi Danny,

I upgraded to the latest version, and it solved the socket connection error. However, I still can't get the output stream sync'ed to Azure. Here is what I did and the screenshot from each stage.

This is what my Azure storage account looked like after running DummyApp after a fresh build. It created the log-dummyhometd container, but there is nothing in it.

Image

However, the configs container has one item:

Image

I then realized that I probably should set the remoteSync flag to "true" which by default was "false" in Dummy.cs, so I did that.
datastream = base.CreateFileStream<StrKey, StrValue>("dumb", true /* remoteSync */);
I rebuilt the project, and ran DummyApp again. Here is the shell output:

Image

This time, an additional container was created, but again nothing was uploaded to it.

Image

And I verified that I do have the Sync Framework installed.

Image

Could you show me how to further diagnose this problem? Thanks a lot!

Tao