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

AWS permission errors are hidden during upload #167

Open
cole-h opened this issue Jun 30, 2022 · 1 comment
Open

AWS permission errors are hidden during upload #167

cole-h opened this issue Jun 30, 2022 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@cole-h
Copy link
Contributor

cole-h commented Jun 30, 2022

I was attempting to use this tool to upload a disk image inside an EC2 instance, but the estimates were out of control (16h for a recent one). After a bit of dbg!ing, I found out it was because the instance did not have the ebs:PutSnapshotBlock capability. After adding that to its IAM policy, the uploader actually made progress and the estimates shrunk down to ~5 minutes.

The only reason I figured this out was because I littered dbg! statements everywhere, which led me to here:

coldsnap/src/upload.rs

Lines 171 to 188 in 5e3adc5

let upload = stream::iter(block_contexts).for_each_concurrent(
SNAPSHOT_BLOCK_WORKERS,
|context| async move {
for attempt in 0..SNAPSHOT_BLOCK_ATTEMPTS {
// Increasing wait between attempts. (No wait to start, on 0th attempt.)
time::sleep(Duration::from_secs(attempt * SNAPSHOT_BLOCK_RETRY_SCALE)).await;
let block_result = self.upload_block(&context).await;
let mut block_errors = context.block_errors.lock().expect("poisoned");
if let Err(e) = block_result {
block_errors.insert(context.block_index, e);
continue;
}
block_errors.remove(&context.block_index);
break;
}
},
);

where I inspected the error being uncovered at

coldsnap/src/upload.rs

Lines 180 to 183 in 5e3adc5

if let Err(e) = block_result {
block_errors.insert(context.block_index, e);
continue;
}

which told me that I was missing that permission in my IAM policy.

It would be ideal for these errors to be printed out eventually (I did notice them still happening, despite adding that capability to the policy, so maybe not always? No, this was just some AWS eventual-consistency stuff -- no longer happens after letting things settle for a bit).

(I also needed the ebs:CompleteSnapshot capability, but maybe that's already obvious to more experienced AWS users.)

@etungsten etungsten added enhancement New feature or request good first issue Good for newcomers labels Jun 30, 2022
@etungsten
Copy link

Thanks for the issue. We'll take a closer look at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants