Skip to content

improve error handling on getoutput #5305

@belforte

Description

@belforte

a spurios "failed to retrieve file" is generated when gfal_copy contains a line with the error string

line.find("error") != -1 or line.find("Failed") != -1 or \

even if the message was harmless and transfer worked OK. E.g.

TLS: Unable to create TLS context; invalid private key.
TLS: 47882433451776:error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch:crypto/x509/x509_cmp.c:303:

see dmwm/CRABServer#8357

It is better to rely on gfal-copy exit code first. And only parse stderr in case of failure so somehow translate known messages into more clear error categories.

relevant code is in

error = simpleOutputCheck(stderr)
logger.debug("Finish executing for file %s" % fileid)
if returncode != 0 or len(error) > 0:
logger.info("%sWarning%s: Failed retrieving %s" % (colors.RED, colors.NORMAL, fileid))
#logger.debug(colors.RED +"Stderr: %s " %stderr+ colors.NORMAL)

def simpleOutputCheck(outlines):

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions