# AWS S3 sync error

**URL:** <https://forum.buildkite.community/t/aws-s3-sync-error/3282>\
**Category:** Elastic CI Stack for AWS\
**Created:** [October 5, 2023, 2:56am UTC](https://forum.buildkite.community/t/aws-s3-sync-error/3282 "2023-10-05T02:56:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![farhan](https://avatars.discourse-cdn.com/v4/letter/f/b2d939/32.png) [@farhan](https://forum.buildkite.community/u/farhan)\
**Post date:** [October 5, 2023, 2:56am UTC](https://forum.buildkite.community/t/aws-s3-sync-error/3282/1 "2023-10-05T02:56:49Z")

</div>

We are observing random occurrence of following error on our builds  
An error occurred in a `before(:suite)` hook.  
Failure/Error: bucket.object(path).get(response\_target: destination)

Aws::S3::Errors::RequestTimeTooSkewed:  
The difference between the request time and the current time is too large

stack version for agents: 5.21.0

Curious to know if anyone else is having the same problem

---

<div class="post-metadata">

**Author:** ![paula](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/paula/32/954_2.png) [@paula](https://forum.buildkite.community/u/paula)\
**Post date:** [October 5, 2023, 3:04am UTC](https://forum.buildkite.community/t/aws-s3-sync-error/3282/2 "2023-10-05T03:04:04Z")

</div>

That is a curious error. Our elastic stack should have NTP configured by default, are you modifying anything about the system time on your instances? Or are you running the command in a docker image that might be interfering with time?

I couldn’t find a configuration option for the AWS CLI to ignore or modify its errors related to time. So I think the best bet is to investigate where the time difference is coming from. I found this article which might help: [amazon web services - AWS S3 upload fails: RequestTimeTooSkewed - Stack Overflow](https://stackoverflow.com/questions/25964491/aws-s3-upload-fails-requesttimetooskewed). And this article might be helpful as well [How to fix S3 (RequestTimeTooSkewed) error | Ottomatik Help Center](http://support.ottomatik.io/en/articles/2345890-how-to-fix-s3-requesttimetooskewed-error)

And one last thought, that looks like ruby from that snippet, is it possible that your tests are changing anything with the system time?

---

<div class="post-metadata">

**Author:** ![farhan](https://avatars.discourse-cdn.com/v4/letter/f/b2d939/32.png) [@farhan](https://forum.buildkite.community/u/farhan)\
**Post date:** [October 5, 2023, 4:12am UTC](https://forum.buildkite.community/t/aws-s3-sync-error/3282/3 "2023-10-05T04:12:06Z")

</div>

> [@paula](#):
>
> And one last thought, that looks like ruby from that snippet, is it possible that your tests are changing anything with the system time?

Yes our ruby test are running in docker container

we configured to get times this error happens

```auto
NTP time is 2023-10-05 13:44:03 +1100 (1696473843)
Local time (Time.zone) is 2023-10-05 00:00:00 +1100 (1696424400)
Local time (Process.clock_gettime) is 2023-10-05 13:44:03 +1100 (1696473843.316994)

```

---

<div class="post-metadata">

**Author:** ![benmc](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/benmc/32/1159_2.png) [@benmc](https://forum.buildkite.community/u/benmc)\
**Post date:** [October 5, 2023, 4:47am UTC](https://forum.buildkite.community/t/aws-s3-sync-error/3282/4 "2023-10-05T04:47:03Z")

</div>

Hey @farhan!

Would it be possible to email us at [support@buildkite.com](mailto:support@buildkite.com) with a link to at least one of the builds you’re seeing this error in, but preferably more than 1 and including the first build you saw it occur in?

Thanks!

---

<div class="post-metadata">

**Author:** ![farhan](https://avatars.discourse-cdn.com/v4/letter/f/b2d939/32.png) [@farhan](https://forum.buildkite.community/u/farhan)\
**Post date:** [October 5, 2023, 5:23am UTC](https://forum.buildkite.community/t/aws-s3-sync-error/3282/5 "2023-10-05T05:23:52Z")

</div>

sending now
