Bot-docs: The remote server returned an error: (404) Not Found

Created on 29 Jun 2019  路  5Comments  路  Source: MicrosoftDocs/bot-docs

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
support customer

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.

All 5 comments

  1. If you restart the bot, does it work again?
  2. Is your storage service still running?
  3. Are you developing from a sample? I can try to repro, but I'd like my bot to be as close to yours as possible.
  4. If you can provide your appId, I can look into this further, as well.
  5. Do you have BLOB_STORAGE_NAME set in Azure Portal > App Service > Configuration > Application Settings?

Hi @mdrichardson, Thank you for your cooperation.

  1. The bot worked after the restart.
  2. The storage service is running and I can see new written data in the blob.
  3. I am developing the bot based on the Basic Bot sample.
  4. I am sorry, I can not provide the appId for security purpose.
  5. I did not add the 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 :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amthomas46 picture amthomas46  路  4Comments

olucafont6 picture olucafont6  路  5Comments

ceuk picture ceuk  路  4Comments

hansmbakker picture hansmbakker  路  7Comments

MisinformedDNA picture MisinformedDNA  路  4Comments