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

Re: [HTCondor-users] schedd.Submit() method in htcondor2



For additional information:

I am using the example from the documentation, and still getting the same error. This is with python 3.12 and htcondor2.version() ==Â'$CondorVersion: 24.0.10 2025-07-28 BuildID: UW_Python_Wheel_Build $'

https://htcondor.readthedocs.io/en/24.x/apis/python-bindings/api/version2/examples.html


$ python3 test1.py
Traceback (most recent call last):
 File "/data/khurtado/late_materialization/python2025/test1.py", line 19, in <module>
  result = htcondor.Schedd().submit(submit, count=1)
 File "/usr/lib64/python3.9/site-packages/htcondor2/_schedd.py", line 434, in submit
  if first_from == 0 or queue_args[first_from - 1] == " ":
IndexError: string index out of range

$ cat test1.py
#! /bin/env python3

import time
import htcondor2 as htcondor

# Create a job description. It _must_ set `log` to create a job event log.
logFileName = "sleep.log"
submit = htcondor.Submit(
  f"""
  executable = /bin/sleep
  transfer_executable = false
  arguments = 20

  log = {logFileName}
  """
)

# Submit the job description, creating the job.
result = htcondor.Schedd().submit(submit, count=1)
clusterID = result.cluster()


On Fri, Sep 12, 2025 at 4:12âPM Kenyi Hurtado Anampa <khurtado@xxxxxx> wrote:
Hello,

I am trying to migrate from htcondor to htcondor2. I have the following Submit() call [1], but I am getting the following error:


Traceback (most recent call last):
 File "/data/python2025/submit2_items2.py", line 22, in <module>
  submitRes = schedd.submit(sub, itemdata=iter(itemdata))
 File "/usr/lib64/python3.9/site-packages/htcondor2/_schedd.py", line 434, in submit
  if first_from == 0 or queue_args[first_from - 1] == " ":
IndexError: string index out of range


What is wrong?
In htcondor, this worked, but I had to include count
submitRes = schedd.submit(sub,1, itemdata=iter(itemdata))


[1]
import classad2 as classad
import htcondor2 as htcondor

sub = htcondor.Submit("""
    universe = vanilla
    executable = test.sh
    arguments = 3
    max_idle = 1
    output = out.$(Cluster)-$(Process)
    log = log.$(Cluster).log
    """)

itemdata = []
undefined = "UNDEFINED"
for name in ("Job1", "Job2"):
  itemdata.append({"My.JobName": classad.quote(name)})
  #itemdata.append({"My.JobTask": undefined})

schedd = htcondor.Schedd()
#submitRes = schedd.submit(sub, 1, itemdata=iter(itemdata))
submitRes = schedd.submit(sub, itemdata=iter(itemdata))
clusterId = submitRes.cluster()
print("ClusterId = %s" % clusterId)