Nitro Enclave can't be run when I have a file a that's ~4.9gb in it

0

The docker image can be found at nesopie/tee-server-register:large. I've run images that are much larger (although the individual files are much smaller) than this that work, but I assume since this has a single file that's so big the aws nitro cli has issues running it.

Here are the logs:

[    3.818830] NSM RNG: returning rand bytes = 16
[    3.819617] NSM RNG: returning rand bytes = 64
[    3.820150] random: fast init done
[    3.820597] NSM RNG: returning rand bytes = 64
[    3.821021] random: crng init done
[    3.821397] NSM RNG: returning rand bytes = 64
[    3.821879] NSM RNG: returning rand bytes = 64
Could not open /env file: No such file or directory
Could not open /env file: No such file or directory
[    3.822869] init[1]: segfault at 0 ip 00000000004089a4 sp 00007ffe6d7c07f0 error 4 in init[400000+b2000]
[    3.822885] NSM RNG: returning rand bytes = 64
[    3.823900] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    3.823900] 
[    3.824451] NSM RNG: returning rand bytes = 64
[    3.825244] CPU: 2 PID: 1 Comm: init Tainted: G           OE   4.14.256-209.484.amzn2.x86_64 #1
[    3.826546] Call Trace:
[    3.826799]  dump_stack+0x6d/0x8b
[    3.827130]  panic+0xdf/0x242
[    3.827438]  ? do_coredump+0x743/0xf70
[    3.827813]  do_exit+0x7d6/0xb80
[    3.828135]  do_group_exit+0x3e/0xb0
[    3.828490]  get_signal+0x11b/0x6d0
[    3.828838]  do_signal+0x32/0x610
[    3.829179]  ? __bad_area_nosemaphore+0xd2/0x1b0
[    3.829674]  ? printk+0x4d/0x69
[    3.830012]  ? __do_page_fault+0x345/0x4b0
[    3.830447]  exit_to_usermode_loop+0x52/0x90
[    3.830902]  ? async_page_fault+0x2f/0x50
[    3.831329]  prepare_exit_to_usermode+0x64/0x70
[    3.831810]  retint_user+0x8/0x8
[    3.832156] RIP: 0033:0x4089a4
[    3.832485] RSP: 002b:00007ffe6d7c07f0 EFLAGS: 00010206
[    3.836628] Kernel Offset: disabled
[    3.836984] Rebooting in 30 seconds..
asked 14 days ago15 views
1 Answer
0

The issue you're experiencing with Nitro Enclaves appears to be related to the large file size in your Docker image. While Nitro Enclaves can generally handle large images, having a single file of approximately 4.9GB may be causing problems during the enclave initialization process.

The logs you provided show that the enclave is encountering a segmentation fault and kernel panic during startup. This suggests that the system is having difficulty allocating or managing memory for such a large file.

To resolve this issue, you could try the following approaches:

  1. Split the large file into smaller chunks if possible. This may help the enclave manage memory more effectively during initialization.

  2. Optimize your Docker image to reduce its overall size. This could involve using multi-stage builds or removing unnecessary files and dependencies.

  3. Check if there are any size limitations or recommendations for individual files within Nitro Enclaves. You may need to consult AWS documentation or support for specific guidelines.

  4. Consider using a different approach to handle the large file, such as streaming it into the enclave after initialization or storing it externally and accessing it as needed.

  5. Verify that your EC2 instance has sufficient resources (memory and CPU) to handle the enclave with such a large file.

If these suggestions don't resolve the issue, you may need to reach out to AWS support for further assistance, as there could be specific limitations or configurations required for handling extremely large files within Nitro Enclaves.
Sources
Temporary failure in name resolution | AWS re:Post

profile picture
answered 14 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions