【问题标题】:Azure Worker role Inner Exception of 'One of the request inputs is out of range.'Azure Worker 角色“请求输入之一超出范围”的内部异常。
【发布时间】:2012-09-03 17:19:35
【问题描述】:

我正在以我的辅助角色调用 CloudTableClient.CreateTableIfNotExist 方法,但我遇到了一个内部异常“请求输入之一超出范围”的异常。

我做了一些研究,发现这是由于将表命名为非法表名引起的,但是,我尝试为我的表命名几个不同的名称,但都没有成功。我尝试过的一些表名是:

  • 例外情况
  • 异常信息
  • 错误列表

他们都失败了,出现了同样的错误。

编辑

这是我用来创建表格的代码:

    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);
    }

这是出错的 HTTP 请求:

请求:

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

&lt;account&gt; 全部为小写,&lt;AcountName&gt; 为驼峰式(如果这意味着什么) 回复如下:

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>

我已经使用同一个 CloudStorageAccount 来创建队列和 Blob,并且成功了。

尝试在 azure 中创建表时是否有任何其他原因导致 OutOfRange 异常?

【问题讨论】:

  • 也许运行 Fiddler 跟踪以捕获已进行(和失败)的 REST 调用,并且您可能会在 HTTP 请求中发现一些东西来提示您?
  • 您也可以发布您的代码吗?我尝试创建一个名为“exceptions”的表,并且能够使用“CreateTableIfNotExist()”方法创建。
  • 我刚刚用我的确切代码和 Fiddler 请求和响应更新了帖子

标签: c# azure azure-worker-roles azure-table-storage


【解决方案1】:

我找到了。

查看我从成功的 Queue 请求和失败的 Table 请求中获得的 HTTP 请求和响应,似乎如果 Account Name 有任何大写字母,一切都会失败。

为了解决这个问题,我将帐户名称更改为全部小写,一切正常

【讨论】:

  • FWIW,当我在表名中有 - 时遇到了同样的问题,所以如果您看到此错误,可能是由于您的帐户名或表的字符串无效名字。
  • 评论帮助了我,我的名字中有一个下划线“_”
【解决方案2】:

存储表出现OutOfRangeInput HTTP 400 错误的另一个原因是帐户参数不正确。当我忘记修复 cscfg 文件并使用

部署时,我观察到了该错误
<Setting name="StorageConnectionString" value="DefaultEndpointsProtocol=https;AccountName=TODO;AccountKey=TODO" />

【讨论】:

    猜你喜欢
    • 2014-12-17
    • 1970-01-01
    • 2018-04-10
    • 2012-08-02
    • 2015-07-24
    • 1970-01-01
    • 2014-11-12
    • 2014-03-06
    • 1970-01-01
    相关资源
    最近更新 更多