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

Logging doesn't capture filename on OSError #172

Closed
drebatto opened this issue Jul 16, 2021 · 5 comments
Closed

Logging doesn't capture filename on OSError #172

drebatto opened this issue Jul 16, 2021 · 5 comments
Assignees
Milestone

Comments

@drebatto
Copy link

drebatto commented Jul 16, 2021

The openssl command is used in /usr/lib/python2.7/site-packages/ssm/crypto.py, but in a bare CentOS7 container the openssl package is not installed. [Fixed in 3.2.1] This lets ssmsend fail with an undescriptive error:

SSM failed to complete successfully.  See log file for details.
2021-07-16 13:28:17,357 - ssmsend - ERROR - Unexpected exception in SSM: [Errno 2] No such file or directory
2021-07-16 13:28:17,358 - ssmsend - ERROR - Exception type: <type 'exceptions.OSError'>

[Investigating this did highlight that OSError is a subclass of EnvironmentError and that has an additional filename attribute which isn't added to the standard args that the generic exception handling is set up to deal with. We could add some generic-ish handling for EnvironmentError that captures the filename. - AC]

@drebatto
Copy link
Author

In general, I'd also suggest that you improve the error messages when [Errno 2] is found, by printing the failed file's name and path.

@tofu-rocketry
Copy link
Member

What version of SSM? We added openssl as a dependency to 3.2.1 back in April (though admittedly it's only been added to UMD this month).

Was there any more log output after that point?

OSError is a subclass of EnvironmentError that has an additional filename attribute which isn't added to the standard args that the generic exception handling is set up to deal with. I guess we could add some generic-ish handling for EnvironmentError.

@drebatto
Copy link
Author

Hi, the version was 3.2.0 from UMD. The subsequent lines in the log file were:

2021-07-27 16:43:54,409 - client - INFO - SSM has shut down.
2021-07-27 16:43:54,409 - client - INFO - ========================================
2021-07-27 16:43:54,410 - client - INFO - SSM stopped.
2021-07-27 16:43:54,410 - client - INFO - =====================

I have rebuilt the container yesterday, and now the ssm version is 3.2.1. I didn't try to remove the explicit installation of openssl from the Dockerfile, but I am reasonably convinced that it would have worked now.

Thanks,
David

@tofu-rocketry tofu-rocketry changed the title Add 'openssl' as a requirement for the rpm Logging doesn't capture filname on OSError Jul 29, 2021
@tofu-rocketry
Copy link
Member

Thanks. That's good to hear. I've tweaked this issue to just track the lack of filename in the logging.

@tofu-rocketry tofu-rocketry changed the title Logging doesn't capture filname on OSError Logging doesn't capture filename on OSError Apr 10, 2024
@tofu-rocketry tofu-rocketry added this to the 3.4.1 milestone Apr 10, 2024
@tofu-rocketry
Copy link
Member

With the changes made in #314, there should now be sufficient logging to track what file is causing the issue.

If you do come across this issue again, feel free to open a new one.

@tofu-rocketry tofu-rocketry closed this as not planned Won't fix, can't repro, duplicate, stale Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants