[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] submit file double quoting issue



That error message is coming from cmd.exe, the windows command interpreter.

When your executable is a batch file, what HTCondor must to to run it is to invoke cmd.exe and pass
your batch file and arguments to it.  It does it like this.

"C:\WINDOWS\system32\cmd.exe" /Q /C "tw.bat" c:\data\program.pl -i c:\data\dataset.dat --point="2014-01-01 01:00:00"

(actually tw.bat will have been renamed as part of file transfer, but that has no effect on the result)

try running this command yourself and you will see that the result is
"The filename, directory name, or volume label syntax is incorrect"

The help for cmd.exe tells why (emphasis mine):

If /C or /K is specified, then the remainder of the command line after
the switch is processed as a command line, where the following logic is
used to process quote (") characters:

    1.  If all of the following conditions are met, then quote characters
        on the command line are preserved:

        - no /S switch
        - exactly two quote characters
        - no special characters between the two quote characters,
          where special is one of: &<>()@^|
        - there are one or more whitespace characters between the
          two quote characters
        - the string between the two quote characters is the name
          of an executable file.

    2.  Otherwise, old behavior is to see if the first character is
        a quote character and if so, strip the leading character and
        remove the last quote character on the command line, preserving
        any text after the last quote character.

Adding /S before /Q to the arguments doesn't  not change the result.  You could use a small .exe program
instead of a .bat to invoke perl - or rely on file associations to treat .pl as an executable without the need to invoke perl explicitly.
or move your quoted arguments into the job as attributes and use a more complicated .bat file to assemble the
command line that is passed to the perl program.  I think this last solution is your best bet.

For instance.   If your submit file has
Arguments = c:\data\program.pl -i c:\data\largedataset.dat
+Point="2014-01-01 01:00:00"
tw.bat can get the value of Point by using condor_q against the copy of the job classad that is stored in the execute directory while the job is running.
for /F "tokens=*" %%I in ('condor_q -jobad .job.ad -autoformat Point') do set POINT=%%I
perl %* --point="%POINT%"

-tj

On 8/27/2015 8:48 PM, Rita wrote:
Phhew, i thought I was going crazy. Please let me know if you find the cause. 


On Thu, Aug 27, 2015 at 6:09 PM, John (TJ) Knoeller <johnkn@xxxxxxxxxxx> wrote:
I can reproduce your problem, still trying to figure out where that error message is coming from.
-tj



On 8/27/2015 4:24 PM, Rita wrote:
Very strange. 

Has anyone ran commands on condor (8.2.9/Windows)  which have double quotes. I believe this could be a bug.
 

On Thu, Aug 27, 2015 at 1:52 PM, Rita <rmorgan466@xxxxxxxxx> wrote:
good news is condor likes that but the bad news is this problem I am getting from windows. In my error log I get
"The filename, directory name, or volume label syntax is incorrect"


On Thu, Aug 27, 2015 at 12:41 PM, John (TJ) Knoeller <johnkn@xxxxxxxxxxx> wrote:
When condor_submit sees the value for your arguments begin with a ", then it switches to a different parsing mode that's designed to allow you
to supply " and ' characters inside your arguments.    So I think you want this.

arguments = “c:\data\program.pl -i c:\data\largedataset.dat --point=""2014-01-01 01:00:00"""

http://research.cs.wisc.edu/htcondor/manual/v8.3/condor_submit.html#man-condor-submit-arguments

-tj


On 8/27/2015 11:21 AM, Rita wrote:
Yes, but the program takes in a string for --point. So it will return an error. It need to be double quoted. 
x:\sub\tw.bat c:\data\program.pl -i c:\data\largedataset.dat --point="2014-01-01 01:00:00"


On Thu, Aug 27, 2015 at 11:49 AM, Krieger, Donald N. <kriegerd@xxxxxxxx> wrote:

Hi Rita – just a thought.

Have you tried enclosing the entire argument string in quotes without the escape characters?

  arguments = “c:\data\program.pl -i c:\data\largedataset.dat --point=2014-01-01 01:00:00"

 

 

Best regards,

 

Don

 

Signature0001

Don Krieger, Ph.D.

Department of Neurological Surgery

University of Pittsburgh

 

From: HTCondor-users [mailto:htcondor-users-bounces@xxxxxxxxxxx] On Behalf Of Rita
Sent: Thursday, August 27, 2015 11:36 AM
To: HTCondor-Users Mail List
Subject: [HTCondor-users] submit file double quoting issue

 

I have a windows bat script (tw.bat) like this,

 

@ECHO OFF

 

perl %*

 

 

When I run my code manually on the windows server I run it like this

 

x:\sub\tw.bat c:\data\program.pl -i c:\data\largedataset.dat --point="2014-01-01 01:00:00"

 

works!

 

 

And my submit file is like this,

Universe = vanilla

executable = x:\sub\tw.bat

arguments = c:\data\program.pl -i c:\data\largedataset.dat --point=\"2014-01-01 01:00:00\"

queue

 

it submits fine! But I get this error in my error file

The filename, directory name, or volume label syntax is incorrect.

 

I have tried many variations but all seem to fail or have condor_submit complain about double quoting/escaping

 

Any ideas?

 

 

 

--

--- Get your facts first, then you can distort them as you please.--


_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/



--
--- Get your facts first, then you can distort them as you please.--


_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/


_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/



--
--- Get your facts first, then you can distort them as you please.--



--
--- Get your facts first, then you can distort them as you please.--


_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/


_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/



--
--- Get your facts first, then you can distort them as you please.--


_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/