Azure Worker role Inner Exception of 'One of the request inputs is out of range.'

你离开我真会死。 提交于 2019-12-09 19:54:29

问题


I'm calling the CloudTableClient.CreateTableIfNotExist Method in my worker role and I'm getting an exception with an Inner Exception of 'One of the request inputs is out of range.'

I did a little research and found that this is caused by naming the table an illegal table name, however, I've tried name my table several different names and all have not succeeded. Some of the table names I've tried are:

  • exceptions
  • exceptioninfo
  • listoferrors

All of them have failed with the same error.

EDIT

Here is the code that I'm using to create the table:

    public static void InitializeTableStorage()
    {
        var storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting(Constants.StorageConnectionString));
        // Retrieve storage account from connection-string
        // Create the table client

        CloudTableClient tableClient = storageAccount.CreateCloudTableClient();

        // Create the table if it doesn't exist
        string tableName = ExceptionsTableName;
        tableClient.CreateTableIfNotExist(tableName);
    }

And here is the HTTP request that errors out:

Request:

GET https://<account>.table.core.windows.net/Tables('exceptioninfo') HTTP/1.1
User-Agent: Microsoft ADO.NET Data Services
DataServiceVersion: 1.0;NetFx
MaxDataServiceVersion: 2.0;NetFx
x-ms-version: 2011-08-18
x-ms-date: Mon, 03 Sep 2012 21:54:20 GMT
Authorization: SharedKeyLite <AccountName>:aBcDeFgAbCdEfGhIjKlMnOpQrStUba+jKlMn/DqrsTu=
Accept: application/atom+xml,application/xml
Accept-Charset: UTF-8
Host: <account>.table.core.windows.net
Connection: Keep-Alive

<account> is all lowercase and <AcountName> is camel case (if that means anything) Here is the response:

HTTP/1.1 400 One of the request inputs is out of range.
Content-Length: 343
Content-Type: application/xml
Server: Microsoft-HTTPAPI/2.0
x-ms-request-id: abcdefgh-ijkl-44ed-9ff2-3d07df99c266
Date: Mon, 03 Sep 2012 21:54:03 GMT


<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
  <code>OutOfRangeInput</code>
  <message xml:lang="en-US">One of the request inputs is out of range.
RequestId:abcdefgh-ijkl-44ed-9ff2-3d07df99c266
Time:2012-09-03T21:54:03.6716225Z</message>
</error>

I've used the same CloudStorageAccount to create Queues and Blobs, and have succeeded.

are there any other reasons to get an OutOfRange exception when trying to create a table in azure?


回答1:


I found it.

Looking at the HTTP requests and responses that I've been getting from successful Queue requests and the failing Table requests, it seems if the Account Name has any uppercase letters, everything fails.

To fix this, I changed the Account Name to be all lower case and everything worked




回答2:


Another cause of OutOfRangeInput HTTP 400 errors with storage tables is having incorrect account parameters. I've observed that error when I forgot to fix up the cscfg file and deployed with

<Setting name="StorageConnectionString" value="DefaultEndpointsProtocol=https;AccountName=TODO;AccountKey=TODO" />


来源:https://stackoverflow.com/questions/12251900/azure-worker-role-inner-exception-of-one-of-the-request-inputs-is-out-of-range

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!