accre / lstore-gridftp

Gridftp DSI plugin directly interface with LStore
1 stars 1 forks source link

Fix error reporting #8

Open PerilousApricot opened 8 years ago

PerilousApricot commented 8 years ago

Every time the server comes back with an obtuse error message, it's because we're not properly propagating an error message back up to the client:

[14984] Mon Nov  9 11:25:58 2015 :: Open file /lio/lfs/cms/store/user/meloam/testgridftp/gurrola/DYJetsToLL_M-10to50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/DYJetsToLL_M-10to50_amcatnloFXFX_Asympt25ns_TNTMaker_MiniAODv2/151103_223913/0000/log/cmsRun_69.log.tar.gz.
[14984] Mon Nov  9 11:25:58 2015 :: ERROR opening the file!
[14984] Mon Nov  9 11:25:58 2015 :: Aborted read before transfer began
[14984] Mon Nov  9 11:25:58 2015 :: Failure attempting to transfer "/lio/lfs/cms/store/user/meloam/testgridftp/gurrola/DYJetsToLL_M-10to50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/DYJetsToLL_M-10to50_amcatnloFXFX_Asympt25ns_TNTMaker_MiniAODv2/151103_223913/0000/log/cmsRun_69.log.tar.gz".
[14984] Mon Nov  9 11:25:58 2015 :: Transfer failure:
an unknown error occurred

This is caused by:

        if (retval != OP_STATE_SUCCESS) {                                                                        
            globus_gfs_log_message(GLOBUS_GFS_LOG_INFO, "ERROR opening the file!\n");
            log_printf(1, "ERROR opening the file!\n");                            
            rc = GLOBUS_FAILURE;                                                   
            goto cleanup;                                                          
        } 

Which sends an error message to the server log, but doesn't send it along to the client. In order to pass it back to the client, the message needs to be passed back via:

    char * errstr = strdup("Error message here");
    memset(&finished_info, 0, sizeof(globus_gfs_finished_info_t));                 
    finished_info.type = GLOBUS_GFS_OP_SESSION_START;                                                                   
    finished_info.info.session.username = session_info->username;                  
    finished_info.info.session.home_dir = "/";                                                                
    finished_info.result = GLOBUS_FAILURE;                                 
    finished_info.msg = errstr;                                                                                  
    globus_gridftp_server_operation_finished(                                   
                          op, GLOBUS_FAILURE, &finished_info);                                                
PerilousApricot commented 8 years ago

https://github.com/accre/lstore-gridftp/blob/13686bc6bcf38fc45d6a531876bdace2de886c9d/src/gridftp_lfs_recv.c#L95