We found a new bug in htcondor2 that does not occur with the HTCondor v1 python bindings.
We are using HTCondor 25.0.2.
I could not easily reproduce the bug just by adding that extra classad in one of the jobs, but we managed to find a way to reproduce the issue in an isolated environment. Could you please help us fix this?
And this is the script (this script does submit just fine with htcondor v1 python bindings):
$ cat test4_simple.py
import classad2 as classad
import htcondor2 as htcondor
#import classad as classad
#import htcondor as htcondor
sub = htcondor.Submit("""
universe = vanilla
executable = test.sh
output = out.$(Cluster)-$(Process)
log = log.$(Cluster).log
""")
schedd = htcondor.Schedd()
jobAds = []
job1 = {'initial_Dir': '/tmp/job_2221', 'transfer_input_files': '/tmp/test.txt', 'Arguments': 'amaltaro_DQMHarvest_RunWhitelist_Oct2025_Val_251022_213529_2035-Sandbox.tar.bz2 2221 1', 'transfer_output_files': 'Report.1.pkl,wmagentJob.log', 'My.x509userproxy': '"/data/certs/myproxy.pem"', 'My.DESIRED_Sites': '"T2_CH_CERN"', 'My.ExtDESIRED_Sites': '"T2_CH_CERN"', 'My.CMS_JobRetryCount': '1', 'My.WMAgent_RequestName': '"amaltaro_DQMHarvest_RunWhitelist_Oct2025_Val_251022_213529_2035"', 'My.CMSGroups': 'UNDEFINED', 'My.WMAgent_JobID': '2221', 'My.WMAgent_SubTaskName': '"/amaltaro_DQMHarvest_RunWhitelist_Oct2025_Val_251022_213529_2035/EndOfRunDQMHarvest"', 'My.CMS_JobType': '"Harvesting"', 'My.CMS_Type': '"test"', 'My.CMS_RequestType': '"DQMHarvest"', 'My.CMS_extendedJobType': '"Harvesting"', 'My.CMS_CampaignName': 'UNDEFINED', 'My.AllowOpportunistic': 'False', 'My.DESIRED_CMSDataset': '"/JetMET0/Run2024D-2024CDEReprocessing-v1/DQMIO"', 'My.DESIRED_CMSDataLocations': '"T1_US_FNAL,T2_CH_CERN,T2_CH_CERN_HLT,T2_CH_CERN_P5"', 'My.DESIRED_CMSPileups': 'UNDEFINED', 'My.Requestioslots': '0', 'My.RequiresGPU': '0', 'request_gpus': '0', 'My.DESIRED_GPUMemoryMB': 'UNDEFINED', 'My.DESIRED_GPUMinimumCapability': 'UNDEFINED', 'My.DESIRED_GPUMaximumCapability': 'UNDEFINED', 'My.DESIRED_GPURuntime': 'UNDEFINED', 'gpus_minimum_memory': 'UNDEFINED', 'gpus_minimum_capability': 'UNDEFINED', 'gpus_maximum_capability': 'UNDEFINED', 'gpus_minimum_runtime': 'UNDEFINED', 'My.EstimatedSingleCoreMins': '60', 'My.OriginalMaxWallTimeMins': '60', 'My.MaxWallTimeMins': 'WMCore_ResizeJob ? (EstimatedSingleCoreMins/RequestCpus + 15) : OriginalMaxWallTimeMins', 'My.OriginalMemory': '3000', 'My.ExtraMemory': '500', 'request_memory': 'OriginalMemory + ExtraMemory * (WMCore_ResizeJob ? (RequestCpus-OriginalCpus) : 0)', 'request_disk': '1000000', 'My.MinCores': '1', 'My.MaxCores': '1', 'My.OriginalCpus': '1', 'Rank': 'isUndefined(Cpus) ? 0 : ifThenElse(Cpus > MaxCores, -Cpus, Cpus)', 'My.JOB_GLIDEIN_Cpus': '"$$(Cpus:0)"', 'My.RequestResizedCpus': '(Cpus>MaxCores) ? MaxCores : ((Cpus < MinCores) ? MinCores : Cpus)', 'My.JobCpus': '((JobStatus =!= 1) && (JobStatus =!= 5) && !isUndefined(MATCH_EXP_JOB_GLIDEIN_Cpus) && (int(MATCH_EXP_JOB_GLIDEIN_Cpus) isnt error)) ? int(MATCH_EXP_JOB_GLIDEIN_Cpus) : OriginalCpus', 'request_cpus': 'WMCore_ResizeJob ? (!isUndefined(Cpus) ? RequestResizedCpus : JobCpus) : OriginalCpus', 'My.WMCore_ResizeJob': 'False', 'My.JobPrio': '50999999', 'My.PostJobPrio1': '-1', 'My.PostJobPrio2': '-827', 'My.REQUIRED_OS': '"rhel8"', 'My.CMSSW_Versions': '"CMSSW_14_0_19_patch2"', 'My.REQUIRED_ARCH': '"X86_64"', 'My.REQUIRED_MINIMUM_MICROARCH': '0', 'Requirements': 'stringListMember(TARGET.Arch, REQUIRED_ARCH)'}
job2 = {'initial_Dir': '/tmp/job_2231', 'transfer_input_files': '/tmp/test.txt', 'Arguments': 'amaltaro_SC_ProdPsi_Oct2025_Val_251022_213530_6474-Sandbox.tar.bz2 2231 1', 'transfer_output_files': 'Report.1.pkl,wmagentJob.log', 'My.x509userproxy': '"/data/certs/myproxy.pem"', 'My.DESIRED_Sites': '"T1_US_FNAL,T2_CH_CERN"', 'My.ExtDESIRED_Sites': '"T1_US_FNAL,T2_CH_CERN"', 'My.CMS_JobRetryCount': '1', 'My.WMAgent_RequestName': '"amaltaro_SC_ProdPsi_Oct2025_Val_251022_213530_6474"', 'My.CMSGroups': 'UNDEFINED', 'My.WMAgent_JobID': '2231', 'My.WMAgent_SubTaskName': '"/amaltaro_SC_ProdPsi_Oct2025_Val_251022_213530_6474/GenSimFull"', 'My.CMS_JobType': '"Production"', 'My.CMS_Type': '"test"', 'My.CMS_RequestType': '"StepChain"', 'My.CMS_extendedJobType': '"GEN,SIM,DIGI_nopileup,RECO,MINIAOD"', 'My.CMS_CampaignName': '"RelVal_Generic_Campaign"', 'My.AllowOpportunistic': 'False', 'My.DESIRED_CMSDataset': 'UNDEFINED', 'My.DESIRED_CMSDataLocations': '"T1_US_FNAL,T2_CH_CERN,T2_CH_CERN_HLT,T2_CH_CERN_P5"', 'My.DESIRED_CMSPileups': 'UNDEFINED', 'My.Requestioslots': '0', 'My.RequiresGPU': '0', 'request_gpus': '0', 'My.DESIRED_GPUMemoryMB': 'UNDEFINED', 'My.DESIRED_GPUMinimumCapability': 'UNDEFINED', 'My.DESIRED_GPUMaximumCapability': 'UNDEFINED', 'My.DESIRED_GPURuntime': 'UNDEFINED', 'My.DESIRED_ExtraMatchRequirements': 'MY.OriginalCpus >= 1', 'gpus_minimum_memory': 'UNDEFINED', 'gpus_minimum_capability': 'UNDEFINED', 'gpus_maximum_capability': 'UNDEFINED', 'gpus_minimum_runtime': 'UNDEFINED', 'My.EstimatedSingleCoreMins': '6240', 'My.OriginalMaxWallTimeMins': '780', 'My.MaxWallTimeMins': 'WMCore_ResizeJob ? (EstimatedSingleCoreMins/RequestCpus + 15) : OriginalMaxWallTimeMins', 'My.OriginalMemory': '8000', 'My.ExtraMemory': '500', 'request_memory': 'OriginalMemory + ExtraMemory * (WMCore_ResizeJob ? (RequestCpus-OriginalCpus) : 0)', 'request_disk': '1000000', 'My.MinCores': '4.0', 'My.MaxCores': '8', 'My.OriginalCpus': '8', 'Rank': 'isUndefined(Cpus) ? 0 : ifThenElse(Cpus > MaxCores, -Cpus, Cpus)', 'My.JOB_GLIDEIN_Cpus': '"$$(Cpus:0)"', 'My.RequestResizedCpus': '(Cpus>MaxCores) ? MaxCores : ((Cpus < MinCores) ? MinCores : Cpus)', 'My.JobCpus': '((JobStatus =!= 1) && (JobStatus =!= 5) && !isUndefined(MATCH_EXP_JOB_GLIDEIN_Cpus) && (int(MATCH_EXP_JOB_GLIDEIN_Cpus) isnt error)) ? int(MATCH_EXP_JOB_GLIDEIN_Cpus) : OriginalCpus', 'request_cpus': 'WMCore_ResizeJob ? (!isUndefined(Cpus) ? RequestResizedCpus : JobCpus) : OriginalCpus', 'My.WMCore_ResizeJob': 'False', 'My.JobPrio': '600000', 'My.PostJobPrio1': '-2', 'My.PostJobPrio2': '-829', 'My.REQUIRED_OS': '"rhel7"', 'My.CMSSW_Versions': '"CMSSW_12_0_0,CMSSW_12_0_0,CMSSW_12_0_0"', 'My.REQUIRED_ARCH': '"X86_64"', 'My.REQUIRED_MINIMUM_MICROARCH': '0', 'Requirements': 'MY.OriginalCpus >= 1 && stringListMember(TARGET.Arch, REQUIRED_ARCH)'}
jobAds = [job1, job2]
print("HTCondor2 version = %s" % htcondor.version())
print("jobAds len = %s" % len(jobAds))
submitRes = schedd.submit(sub, itemdata=iter(jobAds))
clusterId = submitRes.cluster()
print("ClusterId = %s" % clusterId)
print("submitRes: {0}".format(submitRes))
print("submitRes numprocs: {0}".format(submitRes.num_procs()))
print("submitRes first_proc: {0}".format(submitRes.first_proc()))
print("dir(submitRes): {0}".format(dir(submitRes)))
print("ClusterId: {}".format(submitRes.cluster()))