Bug 3931 - Failed to retrieve Resource Properties from ManagedJobService
: Failed to retrieve Resource Properties from ManagedJobService
Status: RESOLVED
: GRAM
wsrf gram clients
: 4.0.1
: PC Linux
: P3 major
: 4.0.2
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2005-11-21 18:46 by
Modified: 2005-12-02 16:31 (History)


Attachments
jobhandle xml file in target cluster (7.20 KB, text/plain)
2005-11-30 17:20, Kenny Jin
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2005-11-21 18:46:29
I am trying to retrieve the JobStatus by submitting a query to 
ManagedJobFactoryService using java.  It always returns the wrong answer. The 
command line ws-get-property works fine. 


Input:   User GSSCredential, JobHandle
Output:  JobStatus.
private void setStubSecurityProperties(Stub stub,GSSCredential credential)
    {
        ClientSecurityDescriptor secDesc = new    ClientSecurityDescriptor();
        secDesc.setGSISecureMsg(Constants.SIGNATURE );
        secDesc.setAuthz(HostAuthorization.getInstance());
        secDesc.setGSSCredential(credential);
        stub._setProperty(Constants.CLIENT_DESCRIPTOR, secDesc);
    }
  public String getJobStatus(GSSCredential credential, String jobHandle){
        try{
          EndpointReferenceType epr =
ManagedJobClientHelper.getEndpoint(jobHandle);

          ManagedJobPortType port = ManagedJobClientHelper.getPort(epr);
          setStubSecurityProperties((Stub) port, credential);
          GetMultipleResourceProperties_Element request = new
GetMultipleResourceProperties_Element();
          request.setResourceProperty(new QName[] {
                ManagedJobConstants.RP_STATE,
                ManagedJobConstants.RP_HOLDING,
                ManagedJobConstants.RP_FAULT,
                ManagedExecutableJobConstants.RP_EXIT_CODE});
          GetMultipleResourcePropertiesResponse response =
                       port.getMultipleResourceProperties(request);
          SOAPElement [] any = response.get_any();
       // I wish this will return the state ResourceProperty
       // but it always return "Unsubmitted"  
       System.out.println("Raw status query response message:\n"
                        + AnyHelper.toSingleString((MessageElement[]) any));

    }catch(Exception ee){
                System.out.println("GETJOBSTATUS: "+ee);
        }
        return "Unknown";
    }

it happen the same if you pass the job handle to WS GramJob class, it will 
also always return "Unsubmitted". The following is function i wrote.  

 public String getStatus(GSSCredential credential, String jobHandle){

              String state = "Unknown";
              GramJob gjob = new GramJob();
              try{
                gjob.setCredentials(credential);
                gjob.setHandle(jobHandle);
                gjob.refreshStatus(); 
                StateEnumeration jobstate =gjob.getState();
                state = jobstate.getValue();
                System.out.println("Job State: "+state); 
          }catch(Exception ee){
                System.out.println("GETJOBSTATUS: "+ee);
        } 
         return state; 
}


I tries to use globusrun-ws to query the job, it will return me the right 
answer too.  Therefore, I submitted the problem to Bugzilla, and hope the 
developer could take a look on this.  Thank you very much. 

K.J.
------- Comment #1 From 2005-11-22 14:34:36 -------
I found a bug in the deprecated GlobusRun class that caused an NPE, but aside
from that I could not reproduce this with the version of GramJob checked into
CVS in both the trunk and the globus_4_0_branch. The only thing I can suggest is
that you checkout the latest client (ws-gram/client/java/source) code in the
globus_4_0_branch and see if the problem goes away.
------- Comment #2 From 2005-11-30 17:20:09 -------
Created an attachment (id=773) [details]
jobhandle xml file in target cluster

take a look to the state, and localJobState, one is Unsubmitted, another is
"Pending".  
------- Comment #3 From 2005-11-30 17:23:28 -------
I don't think so. I did not use GlobusRun. I am writing my own code which is
being executed in tomcat web server. I also check the [jobhandle].xml file
written by ManagedJobFactoryService, it says the same, the state is unsubmitted   

<ns17:state xsi:type="ns17:StateEnumeration"
xmlns:ns17="http://www.globus.org/namespaces/2004/10/gram/job/types">Unsubmitted</ns17:state>

but the localJobState is "Pending"  

<ns18:localJobState xsi:type="ns23:StateEnumeration"
xmlns:ns23="http://www.globus.org/namespaces/2004/10/gram/job/types">Pending</ns18:localJobState>

How come it is not the same?  
Any thing wrong with GRAM ? 

Thank you very much. 

K.J. 
Academic Technology Services
UCLA
------- Comment #4 From 2005-11-30 17:24:26 -------
I don't think so. I did not use GlobusRun. I am writing my own code which is
being executed in tomcat web server. I also check the [jobhandle].xml file
written by ManagedJobFactoryService, it says the same, the state is unsubmitted   

<ns17:state xsi:type="ns17:StateEnumeration"
xmlns:ns17="http://www.globus.org/namespaces/2004/10/gram/job/types">Unsubmitted</ns17:state>

but the localJobState is "Pending"  

<ns18:localJobState xsi:type="ns23:StateEnumeration"
xmlns:ns23="http://www.globus.org/namespaces/2004/10/gram/job/types">Pending</ns18:localJobState>

How come it is not the same?  
Any thing wrong with GRAM ? 

Thank you very much. 

K.J. 
Academic Technology Services
UCLA
------- Comment #5 From 2005-11-30 17:37:06 -------
If the internal state is "Pending", that means that no SEG events were received
that indicate that the job ever started. This is compatible with the external
state of "Unsubmitted" since no SEG events equals no state notifications sent to
the client. That perhaps suggests that the SEG is misconfigured if you can
verify that the job actually runs. I don't know of any reason that globusrun-ws
vs. Java would act differently. Are you sure they submit to the same container?
------- Comment #6 From 2005-11-30 17:38:52 -------
I just check the local Job ID

77485     0 sge_job_sc kjin         r     11/30/2005 15:07:26 s86-24h    MASTER 

the job is running. The LocalJobState is also wrong.  
------- Comment #7 From 2005-11-30 17:42:49 -------
Yes. I submitted to the same container. 
globusrun-ws seems working fine, but not java. You said SEG is misconfigured, any 
suggestion or documentation on how to configure SEG? 
Just want to let you know that I actually submitted a BATCH job using GramJob.  

Thank you very much.  


------- Comment #8 From 2005-11-30 17:47:38 -------
i look at the SEG  (using Sun Grid Engine in our organization), it seems fine. 
I use the command to submit the batch job, and the job status could be retrieved
correctly. 
------- Comment #9 From 2005-11-30 22:05:15 -------
What kind of things that we have to take care before we deploy the GRAM client
to apache tomcat 5.5.12?   

I have take care of the following: 
     -  client-*.wsdd is in class 
     -  axis-url.jar is added to classpath 
     -  GLOBUS_LOCATION is also define system wise. 

I run the Globus Toolkit Container alone. I just want to invoke the service from 
tomcat. After many tries, 
I still could not submit the job correctly.  If i use globusrun-ws, it works fine.  
I have to say there is some problem in invoking the service from the tomcat.   

Any suggestion? 
 
Thank you very much. 

K.J. 
University Of California, Los Angeles
------- Comment #10 From 2005-12-01 13:08:15 -------
I also try to deploy GT4 to tomcat. I am successfully get everything works in
jakarta-tomcat-5.0.28 except the GRAM client. The state for the batch job is
never get changed. It always shows "Unsubmitted".  
------- Comment #11 From 2005-12-01 15:46:25 -------
This is the documentation we have for Tomcat deployments:

http://www-unix.globus.org/toolkit/docs/4.0/execution/wsgram/admin-index.html#s-wsgram-admin-deploying-tomcat

As for the state being stuck in "Unsubmitted", have you tried submitting a batch
job and checking it's status with globusrun-ws?
------- Comment #12 From 2005-12-02 15:18:23 -------
problem solved. It is because the SEG configuration is not correct. Reporting
mechanism in SGE 5.3 are not supported.  We have to upgrade to SGE 6.0 in order
to have this SEG for SunGridEngine work.  

------- Comment #13 From 2005-12-02 15:53:23 -------
Just curuious, are you using the SGE implementation from here?
http://www.lesc.ic.ac.uk/projects/SGE-GT4.html

It's the SGE link off WS GRAM admin page here:
http://www-unix.globus.org/toolkit/docs/4.0/execution/wsgram/admin-index.html#s-wsgram-admin-
schedulerAdpaters
------- Comment #14 From 2005-12-02 16:30:46 -------
Shouldn't be marked as "FIXED" when nothing was fixed.
------- Comment #15 From 2005-12-02 16:31:34 -------
Sorry, I didn't realize you were using SGE. We don't support SGE.