I initially got "server does not support functionality required". I
set up a new instance of Win2003 in a VM..
The vbs sample on MSDN shows the following settings which does not
correspond with my understanding of what Upload (without response)
requires. -
MSDN sets scripting on:
oVdir.AccessScript = true
But when I try to upload the server rejects saying that scripting or
execute is enabled on the dirs and to disable. So I changed that.
I tried to configure the virtual dir using the IIS API. It creates the
Bits-sessions subdirectories etc. Doesn't make a difference. Uploads
fail..
I confirmed Bits is set to allow anonymous uploads in the UI. I also
added permission for the IUSR account to have "change" permission, but
nothing else. Same for anonymous. But I still can't get it to work and
I have a strange error from the server... "Parameter Incorrect"
I am obviously missing something. I "THINK" I am using Bitsadmin
correctly to test. Maybe not?? The Status shows as Transient, so I
assume it can be fixed for retry.
I am totally stumped at this point.
Bitsadmin /create foo /upload
Bitsadmin /addfile foo http://blah.com/test c:\test\xxx.txt
Bitsadmin /info foo /verbose
BITSADMIN version 2.0 [ 6.6.3790.3959 ]
BITS administration utility.
(C) Copyright 2000-2004 Microsoft Corp.
GUID: {BAC3D355-1857-411C-8536-922BE2142F6D} DISPLAY: foo
TYPE: UPLOAD STATE: SUSPENDED OWNER: VM2003\Administrator
PRIORITY: NORMAL FILES: 0 / 1 BYTES: 0 / 350
CREATION TIME: 5/15/2009 2:31:52 PM MODIFICATION TIME: 5/15/2009
2:32:12 PM
COMPLETION TIME: UNKNOWN ACL FLAGS:
NOTIFY INTERFACE: UNREGISTERED NOTIFICATION FLAGS: 3
RETRY DELAY: 600 NO PROGRESS TIMEOUT: 1209600 ERROR COUNT: 0
PROXY USAGE: PRECONFIG PROXY LIST: NULL PROXY BYPASS LIST: NULL
DESCRIPTION:
JOB FILES:
0 / 350 WORKING http://pxx.com -> c:\test\t1.ppt
NOTIFICATION COMMAND LINE: none
Resume - > bitsadmin /resume foo
No success:
ERROR FILE: http://pxx.com/vdir -> c:\test\t1.ppt
ERROR CODE: 0x80070057 - The parameter is incorrect.
ERROR CONTEXT: 0x00000005 - The error occurred while the remote file
was being processed.
I did figure it out.. It WAS Incorrect syntax on Bitsadmin. I had
tried the exact SAME syntax on the client web server and it hadn't
worked, but thats because the web server was messed up and the app did
not work the way that they had told me. I set up my own server
instance and finally tried the correct syntax again. Should have
included the filename in the target URL. BITS doesn't give a
meaningful error when the syntax is incorrect.
Correct syntax should have been
BITSADMIN //addfile myjob http://host.com/vdir/upfile.txt c:\docs
\myfile.txt <<-Target file needs to be in the target URL
Backstory: (simplified version)
Of course the correct answers are obvious in hindsight.. They always
are. Its been 9 years since I worked inside of Windows and I am a
moron besides, so this was an interesting exercise.
My client had a desktop app that apparently uploads files to a
webserver using BITS.. The WebServer hosts 120 sites. No backup. No
dev server. No Documentation of any kind. My client said that the web
server had become "corrupt" and he had to recreate all of the
individual sites from memory and a few exports (no documentation). He
said he had put everything back as it was. But now the desktop
client mysteriously canceled every upload attempt without any
diagnostic. It hadn't been "corrupted". Turns out that he had
casually destroyed global permissions with a single mouse click, but
was too embarrassed to tell me even after I spent an hour having him
walk me through how the server worked and what had happened.
He had source code for the desktop app, but the source would not
compile.. I could still debug from the object code, set some
breakpoints and found that there was no event on the client side that
caused the cancellation. I used a packet sniffer to see what the
conversation between client and host looked like. I also saw that the
upload from the client was unauthenticated. I also saw that the host
was canceling the upload with "Server doesn't support functionality
required" (very helpful).
I am a UNIX guy and didn't know anything about BITS so this was new to
me...
I tried to recreate the VDirs on his server and test them with
BitsAdmin. Nothing worked. Thats because nothing ever would. The
correct BitsAdmin syntax was one that I had tried on the production
server without success. I set up my own Win2003 server in a VM on my
Unix Laptop and eventually realized that I was and still am a moron
and what the correct syntax was. Still didn't work on the production
server - but the rest was easy.
I got the VDirs working on the production server (no dev or backup
available). App still didn't work, but using my packet sniffer, I
could see that everything else he had told me about his application
was incorrect. He also had duplicate Vdirs - only one of which was
actually necessary.
Anyway.. Its all fixed. I found BITS hard to debug, but using a Packet
Sniffer to watch the conversations was extremely helpful. I could
compare the conversations against what the protocol called for..
And of course, I should have figured this out in half the time.. But
as I said - I am a moron :) :)