-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Better error logging for s3 #388
Comments
Thanks for raising this, it's indeed a good idea in general and especially in this case. The PR #366 will exchange the library used for s3, I'll have a look once that is merged. |
I've merged #366 yesterday, could you try again? Specify the repository like this: |
Sure. Thanks.
I have backup in eu-central-1, not in US default region.
I think that github.com/minio/minio-go/utils.go is wrong (maybe not only at this point): // Match if it is exactly Amazon S3 endpoint.
func isAmazonEndpoint(endpointURL *url.URL) bool {
if endpointURL == nil {
return false
}
if endpointURL.Host == "s3.amazonaws.com" {
return true
}
return false
} If I use s3.amazonaws.com then second problem appear:
But
See more information here: |
As far as I know the minio library automatically uses the default region to create new buckets and will figure out the correct region for existing buckets. I'll contact the minio people. |
Using Creating a bucket with restic in a region other than the US default region is not yet implemented, at the moment there is no way to give additional parameters (besides the bucket name and the login credentials) to the s3 backend. I'm working on that, but it will take a few days. In the meantime, if you need a bucket in another region, please use a different client (or the web console) to create the bucket (without |
Thanks for information. Restriction for
|
We are thinking providing some sort of a solution for this in 'minio/minio-go' .. Will update here on how it goes.
The problem happens when you initially create a bucket, since bucket is part of DNS it takes time for it to be propagated until 'us-east-1' region.
They are performing requests perhaps directly to the end point i.e 'eu-central-1' . |
minio/minio-go#309 - fixes all the issues mentioned here, including supporting bucketNames with '.' . Thanks for reporting these problems. |
@harshavardhana thanks for stepping in! I'll create a PR for restic that updates the minio library as soon as your PR is merged. |
This has been merged. |
@harshavardhana shall I update now? |
Yes @fd0 |
Thanks, I'll update minio-go tomorrow. |
Updated minio-go is in #398, once the CI tests pass I'll merge that, then you can please try again :) |
Thanks. I am out off access to good internet. Will be able to test again not earlier than in two weeks. |
Sure, that's fine. I'm working with @harshavardhana to get the CI tests to pass on Go < 1.5 ;) |
Looks like it don't want to work with my region.
I can't find way how to force it to work. What am I doing wrong? |
This is more likely a redirect which failed and possibly a wrong a region was indeed selected. Does the
You don't need to force it, minio-go internally does 'getBucketLocation()' - unless this API is disabled by your policies on 'work-backup-vshalts-com' bucket. |
@vshalts which exact version of restic are you using? What does @harshavardhana When an s3 backend is opened, the following code is executed, this calls Does this execute a HEAD request? |
Yes that is correct, possible issue here could be 'restic' older version. |
The version was latest:
But I found issue with my policy (error in bucket name). My mistake :( |
Hey, that's great to hear! Do you think the error message is sufficient in this case? If so, please close this issue. Otherwise we'll see that we can give more high-level error messages in such cases. |
Indeed @fd0 is correct, we would like to cleanly handle it - rather than throwing S3 messages. It would be nice if you can show your previous bucket policy so that we can test and fix messaging on our end. |
It is simple to reproduce. I use Frankfurt region. I replaced bucket with new one with '.'
If I try to execute any operation against correct bucket name:
I see: I prefer to see detailed message in best scenario. Something like that: Unable to access such resource 'name of resource here'. Please ensure you enable such actions 'list of action here'. |
This is not possible since this issue is successful and occurred such that the detected/received value for getBucketLocation() was 'us-east-1' not 'eu-central-1'
This we need to do, but since the policies can change underneath there is no real consistent way one error handling will work for all cases. If the S3 server changes and replies with a different error code then we are basically going to break a lot of applications. |
What is needed is a trace output of the network request, so that we can see what was replied back from the S3 server for such a bucket. @fd0 any ideas ? |
Just curious. |
Actually Golang redirect has some issues which we are working with them upstream, but we would like to see network trace output. That way we can tell if the problem is minio-go libraries not handling some corner case properly.
What we need to do is look at the error and retry the request again. Request retry is a work in progress right now at minio-go layer. |
Sound great. Also, can you prefix unexpected S3 errors somehow?
you will show to user additional hint that this was s3 related error (who was the source of the problem).
Or maybe not S3 but some general term, like error at transport level. |
it is already prefixed, it has an minio.ErrorResponse structure embedded in it - restic can construct a meaningful message from there.
|
These errors should be generally be retried since it's minio-go's issue as it sent a wrong request to the server and server replied accordingly to retry with a valid endpoint. @vshalts can you please open a bug against https://github.com/minio/minio-go - reference this issue there so that we can track these properly? |
@harshavardhana this issue is more about the restic UI that does not indicate in what part of the code the error occurred. :) |
This was implemented when #580 was merged, a stack trace is printed now. Closing. |
Hi,
I found that error reporting is not obvious (maybe not only for s3):
with such error it is not obvious is it broken repo or problem with access rights to s3.
At the end I found problem, but it was not easy.
s3cmd do much better job:
Can restic report errors more precisely?
Thanks.
The text was updated successfully, but these errors were encountered: