0

I have a website hosted on EC2 using IIS 8.5. I've got a virtual directory with BITS uploads enabled, and everything works over http and now https when my URL points to the instance's public EIP.

The design calls for using an Elastic Load Balancer in front instance(s). The trick is, when I connect an ELB, I start to get 500 errors for the BITS sessions. We've determined that when we don't use the ELB, the jobs complete correctly.

The specific BITS errors we were seeing in the IIS logs were "Invalid Index." inside of an HTTP 500 error. See this question about tracking down BITS error codes.

We have a hypothesis that since BITS uses extended HTTP verbs (such as BITS_POST) that maybe some of the ELB magic was mangling our headers. Before I try setting up WireShark to dig deeper, I wanted to check if anyone else has encountered this problem.

Jay Carlton
  • 133
  • 7

1 Answers1

2

Despite AWS claiming that ELB supports all HTTP verbs as of late 2013, I am experiencing the same issue and have had to settle for using TCP forwarding to get BITS uploads to work through the ELB.

Details: I have two Server 2012 R2 VMs, one on an vSphere 5.5 cluster at a colo (VM1), the other at AWS (VM2), both fully patched as of 6/1/2016. VM1 utilizes PowerShell (Start-BitsTransfer -TransferType Upload) to push files to VM2 (running IIS 8.5 with both HTTP and HTTPS bindings, the latter using a CA-issued certificate).

  • HTTP BITS uploads from VM1 to VM2's Elastic IP succeed.
  • HTTPS BITS uploads from VM1 to VM2's Elastic IP succeed.
  • HTTPS BITS uploads from VM1 to VM2's ELB configured for HTTPS (layer 7) with SSL offloading, pointed at the instance's HTTP binding fail.
  • HTTPS BITS uploads from VM1 to VM2's ELB configured for TCP forwarding (layer 4; no SSL offloading) to the instance's HTTPS binding succeed.

Bullet point 3 is what I (and it seems you) wanted but Option 4 is what I've settled for and it works.

Error details for posterity (/the 50 people a year who stumble across this question): Investigating option 3, VM1 throws the following error:

PS C:\> $error[0] | Select-Object *
writeErrorStream      : True
PSMessageDetails      : 
Exception             : System.Exception: Invalid index.

TargetObject          : 
CategoryInfo          : InvalidOperation: (:) [Start-BitsTransfer], Exception
FullyQualifiedErrorId : StartBitsTransferCOMException,Microsoft.BackgroundIntelligentTransfer.Management.NewBitsTransferCommand
ErrorDetails          : 
InvocationInfo        : System.Management.Automation.InvocationInfo
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {0, 1}

VM2's IIS logs show the following:

#Software: Microsoft Internet Information Services 8.5
#Version: 1.0
#Date: 2016-06-03 01:08:56
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
2016-06-03 01:20:52 xxx.xx.x.xx BITS_POST /upload/file.dat (bits_error:,500,0x80070585) 8080 - xxx.xx.x.xxx Microsoft+BITS/7.7 - 500 0 0 0

As you noted, 0x80070585 corresponds to the Invalid index exception and as you noted on another Stack Overflow question, Failed Request Tracing shows the exception to be occurring in bitssrv.dll but I couldn't identify anything actionable in the logs.

Dan
  • 36
  • 5