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

Getting.."The difference between the request time and the server's time is too large" while checking if bucket Exists. #701

Closed
LahariGuntha opened this issue Aug 31, 2018 · 17 comments

Comments

@LahariGuntha
Copy link

Hi...
I am trying to clone Bucket ion Minio..

It used to work fine..but all of a sudden started throwing the below error:

My code is of below format:
MinioClient minioClient = new MinioClient("https://play.minio.io:9000", "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");
boolean isExist = minioClient.bucketExists("asiatrip");
if(isExist) {
System.out.println("Bucket already exists.");
} else {
minioClient.makeBucket("asiatrip");
}
Getting error while checking if bucketExists with below error code:

error occured

  | ErrorResponse(code=RequestTimeTooSkewed, message=The difference between the request time and the server's time is too large., bucketName=null, objectName=null, resource=/confpagecr/, requestId=3L137, hostId=3L137)
  | request={method=GET, url=https://play.minio.io:9000/mybucket/?location=, headers=Host: play.minio.io:9000
  | User-Agent: Minio (amd64; amd64) minio-java/dev
  | x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
  | x-amz-date: 20180831T130351Z
  | Authorization: AWS4-HMAC-SHA256 Credential=REDACTED/20180831/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=REDACTED
  | }
  | response={code=403, headers=Accept-Ranges: bytes
  | Content-Type: application/xml
  | Server: Minio/RELEASE.2018-02-09T22-40-05Z (linux; amd64)
  | Vary: Origin
  | X-Amz-Request-Id: 154FFA9E2A386AFC
  | Date: Fri, 31 Aug 2018 13:19:15 GMT
  | Transfer-Encoding: chunked
  | }

How can we resolve this??Should I set time somewhere??

@nitisht
Copy link
Contributor

nitisht commented Aug 31, 2018

Can you confirm if the time on the client machine is set correctly

@nitisht nitisht self-assigned this Aug 31, 2018
@nitisht nitisht added this to the Current milestone Aug 31, 2018
@LahariGuntha
Copy link
Author

Hi Nitisht,

We are having Minio as a docker container. We are hitting minio from another application which is also a docker container. I have checked the time on both the containers. It is same.I did not get what to change because both are having the same time set.

Thanks,
Lahari G

@nitisht
Copy link
Contributor

nitisht commented Aug 31, 2018

well the URL i see in the issue is of our Play server so I got confused.

Can you paste sample code snippet for us to reproduce the issue

I see code is here already. Let me try this and get back

@harshavardhana
Copy link
Member

@LahariGuntha setup ntp on client and as well as servers it will work fine.

@nitisht
Copy link
Contributor

nitisht commented Sep 6, 2018

@LahariGuntha were you able to setup ntp on client and server

@LahariGuntha
Copy link
Author

Hi,

Since both the applications are containers..I have checked the time in both the containers. Both are in Sync.

I have a small query:
According to me:
Client will be the container from which I am accessing Minio and the server will be Minio container

Is it the same from what you meant by the server and the client??

@nitisht
Copy link
Contributor

nitisht commented Sep 6, 2018

Client will be the container from which I am accessing Minio and the server will be Minio container

That is correct

@LahariGuntha
Copy link
Author

Hi,
I have checked the time in both the containers. Both are having same time.

@nitisht
Copy link
Contributor

nitisht commented Sep 7, 2018

It is difficult to say what is wrong because the error clearly says that time is not matching on client and server.

Are you sure the client is making request to your local server and not Minio Play server. The code you pasted refers Minio Play server

@LahariGuntha
Copy link
Author

Hi,

Yeah...My code is referring to Our Minio server only and moreover we are facing this issue intemittently.

@nitisht
Copy link
Contributor

nitisht commented Sep 7, 2018

Can you pls join us on Slack https://slack.minio.io we can check further on possible causes for this

@nitisht
Copy link
Contributor

nitisht commented Sep 13, 2018

@LahariGuntha any progress here?

@LahariGuntha
Copy link
Author

Hi Nitisht,

The Issue we are facing is Intermittent. We did not face this Issue again.

@nitisht
Copy link
Contributor

nitisht commented Sep 17, 2018

okay, thanks. I am closing this issue for now, please feel free to reopen/join us on slack if it happens again.

@muzammilhussnain14
Copy link

@nitisht I'm using MinIO Java client for uploading files. On Android devices Some time it's common for users to have incorrect time. This shouldn't fail the uploading of file. anyone workaround to solve this issue for users having incorrect time on their android devices ?

@nitisht
Copy link
Contributor

nitisht commented Nov 27, 2018

@muzammilhussnain14 current timestamp is a part of S3 signature calculation process (ref: https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html) - i.e. server uses current time to validate a REST request sent by the client. If client is using incorrect time (or different time than server) this validation will fail. This is true if you use AWS S3 as well. This is how the S3v4 works and there is not much we can do

note that we do allow 15 mins of skew time, i.e. server and client can be 15 mins apart

@muzammilhussnain14
Copy link

muzammilhussnain14 commented Nov 28, 2018

@muzammilhussnain14 current timestamp is a part of S3 signature calculation process (ref: https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html) - i.e. server uses current time to validate a REST request sent by the client. If client is using incorrect time (or different time than server) this validation will fail. This is true if you use AWS S3 as well. This is how the S3v4 works and there is not much we can do

note that we do allow 15 mins of skew time, i.e. server and client can be 15 mins apart

@nitisht Thanks for getting back.
Any way to set x-amz-date in header instead of device time using Java client ?

muzammilhussnain14 pushed a commit to muzammilhussnain14/minio-java that referenced this issue Nov 28, 2018
Introduced a new constructor to accept client timestamp. In Order to empower clients.
minio#701
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants