saga-project/saga-adaptors-globus — Issue #1: adaptor exception not catched
Author: andre-merzky
Created: 2012-03-06 07:59:14+00:00
State: open

```
Could you tell me some clues to solve this issue? I tried to submmit a job to GRAM5 with SAGA 1.6 and the globus adaptor(1.0). The job submission stage seemed to be successful and I got the JobID, however, getting status was failed and finally the process was aborted. Please see the following VERVOSE=9 outputs.

--------------------------------------------------------
[ykawai@sg01 job]$ ./test
globus GRAM Adaptor: X.509 context found pointing to user proxy at /tmp/x509up_u40012
Globus Adaptors: Certificate seems to be present.
globus_loader: activate GRAM
globus_loader: activate FTP
globus_loader: activate RLS
globus_loader: activate GSI
globus_loader: activate GASS
call saga::job::job::run()
### GLOBUS GRAM2 ADAPTOR ### RSL: &(executable=/bin/hostname)
### GLOBUS GRAM2 ADAPTOR ### GRAM2 job submission successful: https://qb1.loni.org:50383/16217846432251050936/13773398289657397153/
jobID: https://qb1.loni.org:50383/16217846432251050936/13773398289657397153/ state: -1
check saga::job::job
[JobID]=https://qb1.loni.org:50383/16217846432251050936/13773398289657397153/
----------------------------------------
terminate called after throwing an instance of 'saga::no_success'
what(): SAGA(NoSuccess):
SAGA(NoSuccess): std::exception caught: N23globus_gram_job_adaptor9exceptionE
SAGA(NoSuccess): default_job: posix_job.cpp(89): Could not initialize job for [gram://queenbee.loni-lsu.teragrid.org/jobmanager]. Only these schemas are supported: any://, fork://, none.
SAGA(NoSuccess): proxy.cpp(247): No (other) adaptor implements job_cpi::get_state

Aborted
--------------------------------------------------------

That is saying the adaptor works for GRAM2?? I use GT5 client and submit to GRAM5 sites at LONI.I tried the globus commands to check the job status/results on the LONI server(qb1) as below. but globus-job-get-output returns "Invalid job id", that's strange.

--------------------------------------------------------
[ykawai@qb1 ~]$ globus-job-status https://qb1.loni.org:50383/16217846432251050936/13773398289657397153/
DONE
[ykawai@qb1 ~]$ globus-job-get-output https://qb1.loni.org:50383/16217846432251050936/13773398289657397153/
Invalid job id.
--------------------------------------------------------

The following is the c++ code I tried.

--------------------------------------------------------
#include
#include

namespace sja = saga::job::attributes;
namespace sjad = saga::job::attributes::detail;

int main(int argc, char* argv[])
{

saga::url rm_url ("gram://queenbee.loni-lsu.teragrid.org/jobmanager");
saga::job::service js(rm_url);

saga::job::description* jd;
jd = new saga::job::description();
jd->set_attribute(sja::description_executable, "/bin/hostname");
std::string std_out("stdout0306.txt");
jd->set_attribute(sja::description_output, std_out);
std::string std_err("stderr0306.txt");
jd->set_attribute(sja::description_error, std_err);
std::string path_str("tmp");
jd->set_attribute(sja::description_working_directory, path_str);
jd->set_attribute(sja::description_wall_time_limit, "300");
std::vector ostype;
ostype.push_back (sjad::description_operating_system_linux);
jd->set_vector_attribute(sja::description_operating_system_type, ostype);

saga::job::job j = js.create_job(*jd);

try {
std::cout << "call saga::job::job::run()" << std::endl;
j.run();
std::cout << "check saga::job::job" << std::endl;
std::cout << "[JobID]=" << j.get_job_id() << std::endl;
} catch (saga::exception e) {
std::cout << "!!! exception cought." << std::endl;
std::cout << " [what]" << std::endl
<< e.what() << std::endl;
std::cout << "[error]=" << e.get_error() << std::endl;
return 1;
}

std::cout << "----------------------------------------" << std::endl;
saga::job::state state = j.get_state();
while (state != saga::job::Done &&
state != saga::job::Failed &&
state != saga::job::Canceled) {
std::cout << "[state]=" << saga::job::detail::get_state_name(state)
<< std::endl;
sleep(3);
state = j.get_state();
}
std::cout << "[state]=" << saga::job::detail::get_state_name(state) << std::endl;
std::cout << "----------------------------------------" << std::endl;

return 0;
}
--------------------------------------------------------
```