grisu / gricli

Grisu commandline client
7 stars 2 forks source link

submit clause throws an exception if unexpected input occurred #90

Closed sgenie68 closed 13 years ago

sgenie68 commented 13 years ago

I tried submitting matlab job using redirection and gricli barfed:

gricli> submit "/share/apps/matlab/bin/matlab <mat.m"

[Fatal Error] :19:75: Element type "mat.m" must be followed by either attribute specifications, ">" or "/>". java.lang.RuntimeException: org.xml.sax.SAXParseException: Element type "mat.m" must be followed by either attribute specifications, ">" or "/>". at grisu.utils.SeveralXMLHelpers.fromString(SeveralXMLHelpers.java:257) at grisu.utils.SimpleJsdlBuilder.buildJsdl(SimpleJsdlBuilder.java:171) at grisu.model.job.JobSubmissionObjectImpl.getJobDescriptionDocument(JobSubmissionObjectImpl.java:412) at grisu.model.job.JobSubmissionObjectImpl.getJobDescriptionDocumentAsString(JobSubmissionObjectImpl.java:432) at grisu.frontend.model.job.JobObject.createJob(JobObject.java:458) at grisu.gricli.command.SubmitCommand.createJob(SubmitCommand.java:34) at grisu.gricli.command.SubmitCommand.execute(SubmitCommand.java:50) at grisu.gricli.Gricli.runCommand(Gricli.java:145) at grisu.gricli.Gricli.executionLoop(Gricli.java:115) at grisu.gricli.Gricli.main(Gricli.java:89) Caused by: org.xml.sax.SAXParseException: Element type "mat.m" must be followed by either attribute specifications, ">" or "/>". at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:239) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283) at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124) at grisu.utils.SeveralXMLHelpers.fromString(SeveralXMLHelpers.java:251) ... 9 more command failed. Either connection to server failed, or this is gricli bug. Please send /home/gsou008/.grisu.beta/gricli.debug to eresearch-admin@auckland.ac.nz together with description of what triggered the problem

yuriyh commented 13 years ago

exception is bug, but note that redirection is not going to work anyway. submit command does not understand shell syntax.

sgenie68 commented 13 years ago

True - I've already added a wrapper, I am mostly concerned of the exception.

makkus commented 13 years ago

Hm. Yuriy, what do you think, could we implement it in Grisu that it parses the commandline and if it finds "<" it would take the filename and set the stdin value? Would that make sense.

Otherwise, does Gricli support setting stdin via globals, can't remember at the moment...

yuriyh commented 13 years ago

we should discuss semantics of submit in its own issue.

yuriyh commented 13 years ago

ok, fixed this one. Users will still be very surprised at the result of execution though (globus escapes all shell characters).