Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bad log message when sending fails. #1334

Closed
petersilva opened this issue Dec 9, 2024 · 1 comment
Closed

bad log message when sending fails. #1334

petersilva opened this issue Dec 9, 2024 · 1 comment
Assignees
Labels
bug Something isn't working harmless likely-fixed likely fix is in the repository, success not confirmed yet. log log messages inscrutable UserStory interesting to read to consider improving

Comments

@petersilva
Copy link
Contributor

          ( Including this in this issue as it has to do with logging being misintepreted. )

When a file fails to be put through a ftp transfer with a sender, the logging gives a very confusing response. It states that it fails but then goes on to confirm success of the transfer. I confirmed that the transfer did in fact fail and the success log is wrong.

2024-12-06 16:04:45,324 [ERROR] sarracenia.transfer.ftp put failed to put cmcrfe.2024120600_036 to cmcrfe.2024120600_036: 550 Permission denied.
2024-12-06 16:04:45,325 [DEBUG] sarracenia.transfer.ftp chmod sr_ftp chmod 420 cmcrfe.2024120600_036
2024-12-06 16:04:45,389 [INFO] sarracenia.flow send Sent: /apps/sarra/public_data//20241206/MSC-SCI-CMC-OPS/noaa/cmcrfe.2024120600_036  into
/in/cmcrfe.2024120600_036 0-41063
2024-12-06 16:04:45,389 [DEBUG] sarracenia.flow.sender do processing 1 messages worked!
2024-12-06 16:04:45,389 [DEBUG] sarracenia.flowcb.retry after_work loading from post_retry_001: qty=24 ... got: 0
2024-12-06 16:04:45,389 [INFO] sarracenia.flowcb.log after_work sent ok: /in/cmcrfe.2024120600_036

I think the problem is that the try/except statement in here

elif inflight[0] == '.':
new_inflight_path = new_file + inflight
if not self.o.dry_run:
try:
if accelerated:
len_written = self.proto[self.scheme].putAccelerated(
msg, local_file, new_inflight_path)
else:
len_written = self.proto[self.scheme].put(msg, local_file, new_inflight_path)
except Exception as ex:
logger.error( f"could not send {local_dir}{os.sep}{local_file} inflight={inflight} {sendTo} {msg['new_dir']}/{new_file}: {ex}" )
return 0
try:
self.proto[self.scheme].rename(new_inflight_path, new_file)
except Exception as ex:
logger.error( f"could not rename inflight={inflight} {sendTo} {msg['new_dir']}/{new_file}: {ex}" )
return 0

we should be checking if the len_written is greater then 0, and indicate a failed transfer if it is.

Originally posted by @andreleblanc11 in #1325 (comment)

@petersilva petersilva added bug Something isn't working harmless UserStory interesting to read to consider improving log log messages inscrutable labels Dec 9, 2024
@petersilva
Copy link
Contributor Author

slight complication... some files are zero length... have to compare intended length as well.
if could be ok to send a zero length file.

@petersilva petersilva self-assigned this Dec 9, 2024
@petersilva petersilva added the likely-fixed likely fix is in the repository, success not confirmed yet. label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working harmless likely-fixed likely fix is in the repository, success not confirmed yet. log log messages inscrutable UserStory interesting to read to consider improving
Projects
None yet
Development

No branches or pull requests

1 participant