本文介绍了$ Blob.ICloudBlob.GetPageRanges():异常调用"GetPageRanges";带有"0"参数:“无法从传输连接读取数据:现有连接被远程主机强行关闭."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GetPageRanges()和GetPageRangesAsync()间歇性返回错误-比没有错误更多的错误

The GetPageRanges() and GetPageRangesAsync() return errors intermittently - more errors than not

重现该问题:

Login-AzureRmAccount -Credential (Get-Credential '[email protected]') | Out-Null # -Environment AzureCloud
Get-AzureRmSubscription -SubscriptionName 'xxxxxxxxxxxxxxxxx' -WA 0 | Set-AzureRmContext | Out-Null

$VM = Get-AzureRmVM -WA 0 | select -First 1
$Disk = $VM.StorageProfile.OsDisk | select Name,DiskSizeGB,
                @{n='StorageAccountName';e={$_.Vhd.Uri.Split('.')[0].Split('/')[2]}},
                @{n='BlobName';e={$_.Vhd.Uri.Split('/')[-1]}}
$StorageAccount = Get-AzureRmStorageAccount -ResourceGroupName $VM.ResourceGroupName -Name $Disk.StorageAccountName
$Blob = Get-AzureStorageBlob -Container vhds -Context $StorageAccount.Context -Blob $Disk.BlobName

$Blob.ICloudBlob.GetPageRanges() # ==> "Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."
$Blob.ICloudBlob.GetPageRangesAsync() # ==> same error, more verbose

这是为了确定给定Azure VM的已用磁盘空间量.

This is in an effort to determine the amount of used disk space of a given Azure VM.

宾夕法尼亚州KOP软件逻辑高级顾问Sam Boutros http://superwidgets.wordpress.com(请花点时间在有用的时候投票"和/或标记为答案",如果适用)_________________________________________________________________________________ Powershell:在紧急情况之前了解一下http://technet.microsoft.com/zh-cn/scriptcenter/powershell.aspx http://technet.microsoft.com/zh-cn/scriptcenter/dd793612.aspx

Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) _________________________________________________________________________________ Powershell: Learn it before it's an emergency http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx

推荐答案

英语:已建立与计算机(服务运行的远程主机/服务器/PC)的连接,但由于该服务不可用 on 机器,机器不知道如何处理请求.

In English: The connection to the machine (remote host/server/PC that the service runs at) was made but since the service was not available on that machine, the machine didn't know what to do with the request.

如果与计算机的连接不可用,则会看到另一个错误.我忘记了它是什么,但是它遵循服务无法访问"的原则.或不可用".

这很可能是由防火墙阻止端口引起的,但是考虑到您说它是断断续续的(有时客户端尝试连接"),这是不太可能的.我之所以不包括在内,是因为我已经排除了它 在回复之前会很精神.

It IS possible that this is being caused by a firewall blocking the port, but given that you say it's intermittent ("sometimes when the client tries to connect"), that's very unlikely. I didn't include that originally because I had ruled it out mentally before replying.


这篇关于$ Blob.ICloudBlob.GetPageRanges():异常调用"GetPageRanges";带有"0"参数:“无法从传输连接读取数据:现有连接被远程主机强行关闭."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 01:00