I am developing a bot using Microsoft Bot Framework, botBuilder SDK v4 for Node.js.
I am using Azure blob storage in order to store the userState and the conversationState. The Blob storage contains 3 containers for production, staging and integration enivrements.
So, I configured that this way:
try {
const blobStorageConfig = botConfig.findServiceByNameOrId(
process.env.BLOB_STORAGE_NAME
);
const blobStorage = new BlobStorage({
containerName: blobStorageConfig.container,
storageAccountOrConnectionString: blobStorageConfig.connectionString
});
conversationState = new ConversationState(blobStorage);
userState = new UserState(blobStorage);
} catch (error) {
console.error(error);
}
The userState and the conversationState was stored successfully while running the bot, but I got this Error in Azure logs, and the bot is not responding anymore:
2019-06-29T15:23:48
Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (404) Not Found. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext)
--- End of inner exception stack trace ---
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext)
at Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.PutBlock(String blockId, Stream blockData, String contentMD5, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.AddNewBlockToBlob(Stream stream, List`1 blockIds, CloudBlockBlob blockBlob)
at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.AppendStreamToBlob(Stream stream)
at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.ConsumeBuffer()
Request Information
RequestID:m2d...
RequestDate:Wed, 29 June 2019 15:23:47 GMT
StatusMessage:The specified resource does not exist.
ErrorCode:ResourceNotFound
appId, I can look into this further, as well.BLOB_STORAGE_NAME set in Azure Portal > App Service > Configuration > Application Settings?Hi @mdrichardson, Thank you for your cooperation.
appId for security purpose.BLOB_STORAGE_NAME in the Application settings, should I?For now the bot is working well, but I still get that exception randomly.
bot-docs/botframework-config
@montacerdk The code you posted has process.env.BLOB_STORAGE_NAME, which means that when deployed, your bot tries to read the Blob Storage Name from Application Settings. So yes, you should have that in there.
There aren't any known service outages that would cause your issue. Without your code or an AppId, there's not much other help I can give, unless you run the bot locally until it breaks and can copy/paste the code block where the exception is thrown.
Thank you @mdrichardson :)
Most helpful comment
@montacerdk The code you posted has
process.env.BLOB_STORAGE_NAME, which means that when deployed, your bot tries to read the Blob Storage Name from Application Settings. So yes, you should have that in there.There aren't any known service outages that would cause your issue. Without your code or an AppId, there's not much other help I can give, unless you run the bot locally until it breaks and can copy/paste the code block where the exception is thrown.