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

Capture and log the nitro-cli log files on error #171

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

crawford
Copy link
Contributor

When nitro-cli encounters an error, it saves additional logs to the disk. Because this happens in a container, those files are lost as soon as the supervisor exits. Instead, try to parse those log paths from the output of nitro-cli and log the contents.

Here's an example of that output:
 INFO  enclaver::run > no egress defined, no egress proxy will be started
 INFO  enclaver::run > starting enclave
 ERROR enclaver::nitro_cli > nitro-cli failed (exit status: 39)
 ERROR enclaver::nitro_cli > stderr:
[ E26 ] Insufficient memory requested. User provided `memory` is 154 MB, but based on the EIF file size, the minimum memory should be 1540 MB

For more details, please visit https://docs.aws.amazon.com/enclaves/latest/user/cli-errors.html#E26

If you open a support ticket, please provide the error log found at "/var/log/nitro_enclaves/err2023-10-27T00:11:04.029215503+00:00.log"
Failed connections: 1
[ E39 ] Enclave process connection failure. Such error appears when the enclave manager fails to connect to at least one enclave process for retrieving the description information.

For more details, please visit https://docs.aws.amazon.com/enclaves/latest/user/cli-errors.html#E39

If you open a support ticket, please provide the error log found at "/var/log/nitro_enclaves/err2023-10-27T00:11:04.029367091+00:00.log"

 ERROR enclaver::nitro_cli > /var/log/nitro_enclaves/err2023-10-27T00:11:04.029215503+00:00.log:
  Action: Run Enclave
  Subactions:
    Failed to execute command `Run`
    Failed to trigger enclave run
    Failed to construct EnclaveManager with given arguments
    Failed to create enclave handle
    At least 1540 MB must be allocated (which is 4 times the EIF file size)
  Root error file: src/enclave_proc/resource_manager.rs
  Root error line: 506
  Build commit: not available
 ERROR enclaver::nitro_cli > /var/log/nitro_enclaves/err2023-10-27T00:11:04.029367091+00:00.log:
  Action: Run Enclave
  Subactions:
    Failed to handle all enclave process replies
    Failed to connect to 1 enclave processes
  Root error file: src/enclave_proc_comm.rs
  Root error line: 349
  Build commit: not available
Error: failed to run enclave
 ERROR enclaver > error running enclave: non-zero exit code from container

When `nitro-cli` encounters an error, it saves additional logs to the
disk. Because this happens in a container, those files are lost as
soon as the supervisor exits. Instead, try to parse those log paths
from the output of `nitro-cli` and log the contents.
@crawford crawford merged commit f9fe68c into edgebitio:main Oct 27, 2023
@crawford crawford deleted the error branch October 27, 2023 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants