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

Minio does not: implement Region in config.json / Retry when http response is AuthorizationHeaderMalformed #2570

Closed
ghost opened this issue Oct 15, 2018 · 6 comments

Comments

@ghost
Copy link

ghost commented Oct 15, 2018

Hi, I'm a developper from Scaleway and we release our object storage. We love use minio client but we can't use it with a signature V4.

Expected behaviour

$> ./mc mb sis/test-minio -debug
mc: <DEBUG> PUT / HTTP/1.1
Host: test-minio.s3.nl-ams.scw.cloud
User-Agent: Minio (darwin; amd64) minio-go/v6.0.8 mc/2018-10-15T15:09:26Z
Content-Length: 150
Authorization: AWS4-HMAC-SHA256 Credential=**REDACTED**/20181015/nl-ams/s3/aws4_request, SignedHeaders=content-md5;host;x-amz-content-sha256;x-amz-date, Signature=**REDACTED**
Content-Md5: 8p7tByecW7sUlTxMbWAA/A==
X-Amz-Content-Sha256: b86017d61d4ad22a838e75e918325b623687c3e84d631bc2b6435970bf12473d
X-Amz-Date: 20181015T151557Z
Accept-Encoding: gzip

mc: <DEBUG> HTTP/1.1 200 OK
Content-Length: 0
Content-Type: text/html; charset=UTF-8
Date: Mon, 15 Oct 2018 15:15:57 GMT
Location: http://test-minio.s3.nl-ams.scw.cloud/test-minio
X-Amz-Id-2: txb6b044c543ba4564a9a2f-005bc4af2d
X-Amz-Request-Id: txb6b044c543ba4564a9a2f-005bc4af2d

mc: <DEBUG> Response Time:  159.607086ms
Bucket created successfully `sis/test-minio`.

Actual behaviour

$> ./mc ls sis --debug
mc: <DEBUG> GET / HTTP/1.1
Host: s3.nl-ams.scw.cloud
User-Agent: Minio (darwin; amd64) minio-go/5.0.1 mc/2018-03-25T01:22:22Z
Authorization: AWS4-HMAC-SHA256 Credential=**REDACTED**/20181015/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=**REDACTED**
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20181015T095239Z
Accept-Encoding: gzip

mc: <DEBUG> HTTP/1.1 403 Forbidden
Transfer-Encoding: chunked
Content-Type: application/xml
Date: Mon, 15 Oct 2018 09:52:39 GMT
X-Amz-Id-2: txbc616aca981c49e7a5d11-005bc46367
X-Amz-Request-Id: txbc616aca981c49e7a5d11-005bc46367

115
<?xml version='1.0' encoding='UTF-8'?>
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><RequestId>txbc616aca981c49e7a5d11-005bc46367</RequestId></Error>
0

As you can see minio handle by default us-east-1, the only way to change region on your current version is with mc mb sis/test -region nl-ams but it is impossible with other option and/or set it globally.

Authorization: AWS4-HMAC-SHA256 Credential=**REDACTED**/20181015/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=**REDACTED**

Steps to reproduce the behaviour

Use a object storage solution with other endpoint than us-east-1.

mc version

$> ./mc version
Version: 2018-10-15T15:09:26Z
Release-tag: DEVELOPMENT.2018-10-15T15-09-26Z
Commit-id: 7bbc81ffa4c49aabb9e2d62fa0c4d704e066400c

System information

OS:darwin - Arch:amd64 - Lang:go1.11
@ghost ghost changed the title Minio does not implement Region from config.json Minio does not implement Region in config.json Oct 15, 2018
@ghost
Copy link
Author

ghost commented Oct 15, 2018

I made a Pull Request to fix this issue: #2570

@kannappanr
Copy link
Collaborator

@quentinselle Thanks for the PR. In s3, region doesn't make much sense when listing buckets. In the case of minio server, it lists the buckets in a minio instance even if the region is set to us-east-1

In the case of AWS S3, I tried to list buckets by connecting to s3.us-west-2.amazonaws.com
Following is the output that I got.

GET
/

host:s3.us-west-2.amazonaws.com
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20181016T062834Z

host;x-amz-content-sha256;x-amz-date
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
2018-10-15 23:28:34,352 - MainThread - botocore.auth - DEBUG - StringToSign:
AWS4-HMAC-SHA256
20181016T062834Z
20181016/us-east-1/s3/aws4_request
5b1233fff7e7db4779fb0d45dfa06a26b08580392d0eb5881352b476a097a087
2018-10-15 23:28:34,352 - MainThread - botocore.auth - DEBUG - Signature:
be4c74f78bf2de853521bb1aebdf7a8966f076d540c81713807e02d55203c3a0
2018-10-15 23:28:34,352 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=GET, url=https://s3.us-west-2.amazonaws.com/, headers={'User-Agent': b'aws-cli/1.11.139 Python/3.6.3 Linux/4.13.0-46-generic botocore/1.12.19', 'X-Amz-Date': b'20181016T062834Z', 'X-Amz-Content-SHA256': b'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'Authorization': b'AWS4-HMAC-SHA256 Credential=REDACTED/20181016/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=be4c74f78bf2de853521bb1aebdf7a8966f076d540c81713807e02d55203c3a0'}>
2018-10-15 23:28:34,570 - MainThread - botocore.parsers - DEBUG - Response headers: {'x-amz-request-id': '4451412E55F5BA94', 'x-amz-id-2': 'RPfeqUpKrXa0ZQq/2iVWAmU4sBPzLElLIkPoEOxl93Pax7YjepiCarlf4H0OPLtBb3pu35C0VYo=', 'Content-Type': 'application/xml', 'Transfer-Encoding': 'chunked', 'Date': 'Tue, 16 Oct 2018 06:28:33 GMT', 'Connection': 'close', 'Server': 'AmazonS3'}
2018-10-15 23:28:34,570 - MainThread - botocore.parsers - DEBUG - Response body:
b'<?xml version="1.0" encoding="UTF-8"?>\n<Error><Code>AuthorizationHeaderMalformed</Code><Message>The authorization header is malformed; the region \'us-east-1\' is wrong; expecting \'us-west-2\'</Message><Region>us-west-2</Region><RequestId>4451412E55F5BA94</RequestId><HostId>RPfeqUpKrXa0ZQq/2iVWAmU4sBPzLElLIkPoEOxl93Pax7YjepiCarlf4H0OPLtBb3pu35C0VYo=</HostId></Error>'
2018-10-15 23:28:34,572 - MainThread - botocore.hooks - DEBUG - Event needs-retry.s3.ListBuckets: calling handler <botocore.retryhandler.RetryHandler object at 0x7f1ccb3f9c88>
2018-10-15 23:28:34,572 - MainThread - botocore.retryhandler - DEBUG - No retry needed.
2018-10-15 23:28:34,572 - MainThread - botocore.hooks - DEBUG - Event needs-retry.s3.ListBuckets: calling handler <bound method S3RegionRedirector.redirect_from_error of <botocore.utils.S3RegionRedirector object at 0x7f1ccb3186a0>>
2018-10-15 23:28:34,573 - MainThread - botocore.utils - DEBUG - S3 client configured for region us-east-1 but the bucket None is in region us-west-2; Please configure the proper region to avoid multiple unnecessary redirects and signing attempts.
2018-10-15 23:28:34,573 - MainThread - botocore.utils - DEBUG - Updating URI from https://s3.us-west-2.amazonaws.com/ to https://s3.us-west-2.amazonaws.com/
2018-10-15 23:28:34,573 - MainThread - botocore.endpoint - DEBUG - Response received to retry, sleeping for 0 seconds
2018-10-15 23:28:34,574 - MainThread - botocore.hooks - DEBUG - Event request-created.s3.ListBuckets: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f1ccb3182e8>>
2018-10-15 23:28:34,574 - MainThread - botocore.hooks - DEBUG - Event choose-signer.s3.ListBuckets: calling handler <bound method ClientCreator._default_s3_presign_to_sigv2 of <botocore.client.ClientCreator object at 0x7f1ccb3a6eb8>>
2018-10-15 23:28:34,575 - MainThread - botocore.hooks - DEBUG - Event choose-signer.s3.ListBuckets: calling handler <function set_operation_specific_signer at 0x7f1ccc7106a8>
2018-10-15 23:28:34,575 - MainThread - botocore.auth - DEBUG - Calculating signature using v4 auth.
2018-10-15 23:28:34,576 - MainThread - botocore.auth - DEBUG - CanonicalRequest:
GET
/

host:s3.us-west-2.amazonaws.com
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20181016T062834Z

host;x-amz-content-sha256;x-amz-date
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
2018-10-15 23:28:34,576 - MainThread - botocore.auth - DEBUG - StringToSign:
AWS4-HMAC-SHA256
20181016T062834Z
20181016/us-west-2/s3/aws4_request
5b1233fff7e7db4779fb0d45dfa06a26b08580392d0eb5881352b476a097a087
2018-10-15 23:28:34,576 - MainThread - botocore.auth - DEBUG - Signature:
8a0b0fba2cd16e81be78720d6090d332f583b46b4774fb59aa4d2997ded5d774
2018-10-15 23:28:34,577 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=GET, url=https://s3.us-west-2.amazonaws.com/, headers={'User-Agent': b'aws-cli/1.11.139 Python/3.6.3 Linux/4.13.0-46-generic botocore/1.12.19', 'X-Amz-Date': b'20181016T062834Z', 'X-Amz-Content-SHA256': b'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'Authorization': b'AWS4-HMAC-SHA256 Credential=REDACTED/20181016/us-west-2/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=8a0b0fba2cd16e81be78720d6090d332f583b46b4774fb59aa4d2997ded5d774'}>
2018-10-15 23:28:35,119 - MainThread - botocore.parsers - DEBUG - Response headers: {'x-amz-id-2': 'tpy9yGQPfm7l6IgIP9RyS5HQ4QFpTNgZI7GIsWarmFh0omQzwlEeJHyk6CAMB4b++mhyGuHQvsI=', 'x-amz-request-id': 'DAB5CA3C60BAB343', 'Date': 'Tue, 16 Oct 2018 06:28:35 GMT', 'Content-Type': 'application/xml', 'Transfer-Encoding': 'chunked', 'Server': 'AmazonS3'}



In the output of the first GET command, it returns a AuthorizationHeaderMalformed saying that the region expected is us-west-2.

If scaleway, can return an error like that instead of signature malformed error, then minio-go SDK code can be modified to use that error to retry the API again with the correct region set.

@ghost
Copy link
Author

ghost commented Oct 16, 2018

Hi, thanks for your comment, I update the Scaleway backend (in local env) to deal with the AuthorizationHeaderMalformed response when region is not good.

As it is necessary to update the minio-go to implement the retry with the good endpoint I test my patch with aws-cli (as you did, I put a bad region in the ~/.aws/config file) and much to my surprise I get:

GET
/

host:localhost:6007
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20181016T160353Z

host;x-amz-content-sha256;x-amz-date
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
2018-10-16 18:03:53,416 - MainThread - botocore.auth - DEBUG - StringToSign:
AWS4-HMAC-SHA256
20181016T160353Z
20181016/TestTwo/s3/aws4_request
4a28687c12ed91cae4e02ac882af040a2a7ba724a061a31d2a81d812c42780f1
2018-10-16 18:03:53,416 - MainThread - botocore.auth - DEBUG - Signature:
3bcb46244cbd3144a715e295a6316e826c8551a37d1da0614075c42e34aa7a1b
2018-10-16 18:03:53,416 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=GET, url=http://localhost:6007/, headers={'User-Agent': b'aws-cli/1.16.8 Python/3.7.0 Darwin/17.7.0 botocore/1.11.8', 'X-Amz-Date': b'20181016T160353Z', 'X-Amz-Content-SHA256': b'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'Authorization': b'AWS4-HMAC-SHA256 Credential=**REDACTED**/20181016/TestTwo/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=3bcb46244cbd3144a715e295a6316e826c8551a37d1da0614075c42e34aa7a1b'}>
2018-10-16 18:03:53,424 - MainThread - botocore.parsers - DEBUG - Response headers: {'x-amz-id-2': 'tx9c4b0d2f824b4b4ab36b2-005bc60be9', 'Connection': 'Close', 'x-amz-request-id': 'tx9c4b0d2f824b4b4ab36b2-005bc60be9', 'Content-Type': 'application/xml', 'Date': 'Tue, 16 Oct 2018 16:03:53 GMT', 'Transfer-Encoding': 'chunked'}
2018-10-16 18:03:53,424 - MainThread - botocore.parsers - DEBUG - Response body:
b"<?xml version='1.0' encoding='UTF-8'?>\n<Error><Code>AuthorizationHeaderMalformed</Code><Message>The authorization header is malformed; the region 'TestTwo' is wrong; expecting 'TestOne'</Message><RequestId>tx9c4b0d2f824b4b4ab36b2-005bc60be9</RequestId><Region>TestOne</Region></Error>"
2018-10-16 18:03:53,424 - MainThread - botocore.hooks - DEBUG - Event needs-retry.s3.ListBuckets: calling handler <botocore.retryhandler.RetryHandler object at 0x10c212c50>
2018-10-16 18:03:53,425 - MainThread - botocore.retryhandler - DEBUG - No retry needed.
2018-10-16 18:03:53,425 - MainThread - botocore.hooks - DEBUG - Event needs-retry.s3.ListBuckets: calling handler <bound method S3RegionRedirector.redirect_from_error of <botocore.utils.S3RegionRedirector object at 0x10c212fd0>>
2018-10-16 18:03:53,425 - MainThread - botocore.utils - DEBUG - S3 client configured for region TestTwo but the bucket None is in region TestOne; Please configure the proper region to avoid multiple unnecessary redirects and signing attempts.
2018-10-16 18:03:53,425 - MainThread - botocore.client - DEBUG - Assuming an endpoint for s3, TestOne: https://s3.TestOne.amazonaws.com
2018-10-16 18:03:53,425 - MainThread - botocore.utils - DEBUG - Updating URI from http://localhost:6007/ to http://s3.TestOne.amazonaws.com/
2018-10-16 18:03:53,425 - MainThread - botocore.endpoint - DEBUG - Response received to retry, sleeping for 0 seconds
2018-10-16 18:03:53,425 - MainThread - botocore.hooks - DEBUG - Event request-created.s3.ListBuckets: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x10c2128d0>>
2018-10-16 18:03:53,425 - MainThread - botocore.hooks - DEBUG - Event choose-signer.s3.ListBuckets: calling handler <function set_operation_specific_signer at 0x10b4a2a60>
2018-10-16 18:03:53,425 - MainThread - botocore.auth - DEBUG - Calculating signature using v4 auth.
2018-10-16 18:03:53,426 - MainThread - botocore.auth - DEBUG - CanonicalRequest:
GET
/

host:s3.TestOne.amazonaws.com
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20181016T160353Z

host;x-amz-content-sha256;x-amz-date
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
2018-10-16 18:03:53,494 - MainThread - botocore.auth - DEBUG - StringToSign:
AWS4-HMAC-SHA256
20181016T160353Z
20181016/TestOne/s3/aws4_request
e6b0873e226e9774770ea48c7fe16c1f2b526a012a9426f55e57263a851b01a7
2018-10-16 18:03:53,494 - MainThread - botocore.auth - DEBUG - Signature:
4b0c6f8b71cc34e4b5aa82ff941112a6c77f5561a6e7854c2fba58eea360b8f1
2018-10-16 18:03:53,495 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=GET, url=http://s3.TestOne.amazonaws.com/, headers={'User-Agent': b'aws-cli/1.16.8 Python/3.7.0 Darwin/17.7.0 botocore/1.11.8', 'X-Amz-Date': b'20181016T160353Z', 'X-Amz-Content-SHA256': b'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'Authorization': b'AWS4-HMAC-SHA256 Credential=**REDACTED**/20181016/TestOne/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=4b0c6f8b71cc34e4b5aa82ff941112a6c77f5561a6e7854c2fba58eea360b8f2}>
2018-10-16 18:03:53,501 - MainThread - botocore.endpoint - DEBUG - Exception received when sending HTTP request.
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 171, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 56, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socket.py", line 748, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

-> url=http://s3.TestOne.amazonaws.com/,

Indeed, boto retry with the new Region but not with the endpoint from conf... it retry with a amazonaws.com hardcoded endpoint instead of retry with the precedent request and change it with the new region and the recalculate signature...

Have you got any suggestion for the implementation of this retry ?

@ghost
Copy link
Author

ghost commented Oct 16, 2018

This is harcoded here: https://github.com/boto/botocore/blob/develop/botocore/client.py#L349
I made a patch who works.
I prepare a PR for botocore :)

@ghost ghost changed the title Minio does not implement Region in config.json Minio does not: implement Region in config.json / Retry when http response is AuthorizationHeaderMalformed Oct 22, 2018
@kannappanr
Copy link
Collaborator

Pasting comment from @poornas in #2571 here

@quentinselle, minio-go already retries with region when response code is InvalidRegion. response message for AuthorizationHeaderMalformed needs to be parsed to get the correct region and set as errResp.region in https://github.com/minio/minio-go/blob/master/api-error-response.go#L179 and
https://github.com/minio/minio-go/blob/master/api.go#L630 to use the errResp.Region in case of AuthorizationHeaderMalformed

@kannappanr kannappanr removed the triage label Nov 8, 2018
@kannappanr kannappanr modified the milestones: Current, Futures Nov 8, 2018
Praveenrajmani added a commit to Praveenrajmani/minio-go that referenced this issue Feb 12, 2019
update metadata.bucketLocation with the correct region from the error response.

Fixes minio/mc#2570
Praveenrajmani added a commit to Praveenrajmani/minio-go that referenced this issue Feb 12, 2019
Update metadata.bucketLocation with the correct region from the error response.

Fixes minio/mc#2570
@Praveenrajmani
Copy link
Collaborator

mc works as intended. Regions are bucket level concepts. Please refer to this comment here minio/minio-go#1074 (comment) for more info.

This is not an issue w.r.t mc. It matters on server implementation. The compatible server should honour all the regions in ListBuckets() as minio does.

julien-sobczak pushed a commit to julien-sobczak/thanos that referenced this issue Apr 19, 2019
Minio is able to autodetect the region for cloud providers like AWS but the logic fails with Scaleway Object Storage solution.

Related issue on Minio: minio/mc#2570
julien-sobczak pushed a commit to julien-sobczak/thanos that referenced this issue Apr 19, 2019
Minio is able to autodetect the region for cloud providers like AWS but the logic fails with Scaleway Object Storage solution.

Related issue on Minio: minio/mc#2570
julien-sobczak pushed a commit to julien-sobczak/thanos that referenced this issue Apr 23, 2019
Minio is able to autodetect the region for cloud providers like AWS but the logic fails with Scaleway Object Storage solution.

Related issue on Minio: minio/mc#2570
julien-sobczak pushed a commit to julien-sobczak/thanos that referenced this issue Apr 23, 2019
Minio is able to autodetect the region for cloud providers like AWS but the logic fails with Scaleway Object Storage solution.

Related issue on Minio: minio/mc#2570
julien-sobczak pushed a commit to julien-sobczak/thanos that referenced this issue Apr 23, 2019
Minio is able to autodetect the region for cloud providers like AWS but the logic fails with Scaleway Object Storage solution.

Related issue on Minio: minio/mc#2570
julien-sobczak pushed a commit to julien-sobczak/thanos that referenced this issue Apr 23, 2019
Minio is able to autodetect the region for cloud providers like AWS but the logic fails with Scaleway Object Storage solution.

Related issue on Minio: minio/mc#2570
julien-sobczak pushed a commit to julien-sobczak/thanos that referenced this issue Apr 23, 2019
Minio is able to autodetect the region for cloud providers like AWS but the logic fails with Scaleway Object Storage solution.

Related issue on Minio: minio/mc#2570
julien-sobczak pushed a commit to julien-sobczak/thanos that referenced this issue Apr 23, 2019
Minio is able to autodetect the region for cloud providers like AWS but the logic fails with Scaleway Object Storage solution.

Related issue on Minio: minio/mc#2570
bwplotka pushed a commit to thanos-io/thanos that referenced this issue Apr 23, 2019
Minio is able to autodetect the region for cloud providers like AWS but the logic fails with Scaleway Object Storage solution.

Related issue on Minio: minio/mc#2570
@deekoder deekoder added the fixed label May 13, 2019
smalldirector pushed a commit to smalldirector/thanos that referenced this issue Jun 20, 2019
* query: cleanup store statuses as they come and go (thanos-io#910)

Signed-off-by: Adrien Fillon <adrien.fillon@cdiscount.com>

* [docs] Example of using official prometheus helm chart to deploy server with sidecar (thanos-io#1003)

* update documentation with an example of using official prometheus helm chart

Signed-off-by: Ivan Kiselev <ivan@messagebird.com>

* a little formatting to values

Signed-off-by: Ivan Kiselev <ivan@messagebird.com>

* satisfy PR comments

Signed-off-by: Ivan Kiselev <ivan@messagebird.com>

* Compact: group concurrency  (thanos-io#1010)

* compact: add concurrency to group compact

* add flag to controll the number of goroutines to use when compacting group

* update compact.md for group-compact-concurrency

* fixed: miss wg.Add()

* address CR

* regenerate docs

* use err group

* fix typo in flag description

* handle context

* set up workers in main loop

* move var initialisation

* remove debug log

* validate concurrency

* move comment

* warn -> error

* remove extra newline

* fix typo

* dns: Added miekgdns resolver as a hidden option to query and ruler. (thanos-io#1016)

Fixes: thanos-io#1015

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

* query: set default evaluation interval (thanos-io#1028)

Subqueries allows request with no [specified resolution](https://prometheus.io/blog/2019/01/28/subquery-support/).
Set it up and allow to configure default evaluation interval.

* store+compactor: pre-compute index cache during compaction (thanos-io#986)

Fixes first part of thanos-io#942

This changes allow to safe some startup & sync time in store gateway as it is no longer is needed to compute index-cache from block index on its own. For compatibility store GW still can do it, but it first checks bucket if there is index-cached uploaded already.

In the same time, compactor precomputes the index cache file on every compaction. To allow quicker addition of index cache files we added `--index.generate-missing-cache-file` flag, that if enabled precompute missing files on compactor startup. Note that it will take time and it's only one-off step per bucket.

Signed-off-by: Aleksei Semiglazov <xjewer@gmail.com>

* Added website for Thanos' docs using Hugo. (thanos-io#807)

Hosted in github pages.

Signed-off-by: adrien-f <adrien.fillon@gmail.com>
Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

* gcs: Fixed scopes for inline ServiceAccount option. (thanos-io#1033)

Without this that option was unusable.

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

* Fixed root docs and liche is now checking root dir as well. (thanos-io#1040)

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

* storage docs: add detail about GCS policies and testing (thanos-io#1037)

* add more details about GCS policies and testing

* remove fixed names from exec command

* Prometheus library updated to v2.8.1 (thanos-io#1009)

* compact:  group concurrency improvements (thanos-io#1029)

* group concurrency improvements

* remove unnecessary error check

* add to wg in main goroutine

* receive: Add block shipping (thanos-io#1011)

* receive: Add retention flag for local tsdb storage (thanos-io#1046)

* querier: Add /api/v1/labels support (thanos-io#905)

* Feature: add /api/v1/labels support

Signed-off-by: jojohappy <sarahdj0917@gmail.com>

* Disabled gossip by default, marked all flags as deprecated. (thanos-io#1055)

+ changed small label.

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

* ruler: Fixed Chunk going out or Max Uint16. (thanos-io#1041)

Fixes thanos-io#1038

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

* store: azure: allow passing an endpoint parameter for specific regions (thanos-io#980)

Fix thanos-io#968

Signed-off-by: Adrien Fillon <adrien.fillon@cdiscount.com>

* feature: support POST method for series endpoint (thanos-io#1021)

Signed-off-by: Joseph Lee <joseph.t.lee@outlook.com>

* bucket verify: repair out of order labels (thanos-io#964)

* bucket verify: repair out of order labels

* verify repair: correctly order series in the index on rewrite

When we have label sets that are not in the correct order, fixing that
changes the order of the series in the index.  So the index must be
rewritten in that new order.  This makes this repair tool take up a
bunch more memory, but produces blocks that verify correctly.

* Fix the TSDB block safe-delete function

The directory name must be the block ID name exactly to verify.  A temp
directory or random name will not work here.

* verify repair: fix duplicate chunk detection

Pointer/reference logic error was eliminating all chunks for a series in
a given TSDB block that wasn't the first chunk.  Chunks are now
referenced correctly via pointers.

* PR feedback: use errors.Errorf() instead of fmt.Errorf()

* Use errors.New()

Some linters catch errors.Errorf() as its not really part of the errors
package.

* Liberally comment this for loop

We're comparing items by pointers, using Go's range variables is
misleading here and we need not fall into the same trap.

* Take advantage of sort.Interface

This prevents us from having to re-implement label sorting.

* PR Feedback: Comments are full sentences.

* Cut release 0.4.0-rc.0 (thanos-io#1017)

* Cut release 0.4.0-rc.0 🎉 🎉

NOTE: This is last release that has gossip.

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

Co-Authored-By: povilasv <p.versockas@gmail.com>

* Fixed crossbuild.

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

* ci: Env fixes. (thanos-io#1058)

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

* Removed bzr requirement for make crossbuild.

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

* Bump github.com/hashicorp/golang-lru from 0.5.0 to 0.5.1 (thanos-io#1051)

Bumps [github.com/hashicorp/golang-lru](https://github.com/hashicorp/golang-lru) from 0.5.0 to 0.5.1.
- [Release notes](https://github.com/hashicorp/golang-lru/releases)
- [Commits](hashicorp/golang-lru@v0.5.0...v0.5.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Initialze and correctly register all index cache metrics. (thanos-io#1069)

* store/cache: add more tests (thanos-io#1071)

*  Fixed Downsampling process; Fixed `runutil.CloseAndCaptureErr` (thanos-io#1070)

* runutil. Simplified CloseWithErrCapture.

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

* Fixed Downsampling process; Fixed runutil.CloseAndCaptureErr

Fixes thanos-io#1065

Root cause:
* runutil defered capture error function was not passing error properly so unit tests were passing, event though there was bug
* streamed block write index cache requires index file which was not closed (saved) properly yet. Closers need to be closed to perform this.

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

* objstore: Expose S3 region attribute (thanos-io#1060)

Minio is able to autodetect the region for cloud providers like AWS but the logic fails with Scaleway Object Storage solution.

Related issue on Minio: minio/mc#2570

* Fixed fetching go-bindata failed (thanos-io#1074)

* Fixed bug:
- fetching go-bindata failed.
- change the repo of go-bindata to github.com/go-bindata/go-bindata,
because old repo has been archived.
- pin the go-bindata as v3.3.1.

Signed-off-by: jojohappy <sarahdj0917@gmail.com>

* Add CHANGELOG

Signed-off-by: jojohappy <sarahdj0917@gmail.com>

* Remove CHANGELOG

Signed-off-by: jojohappy <sarahdj0917@gmail.com>

* add compare flags func to compare flags between prometheus and sidecar (thanos-io#838)

Original message:

* update documentation for a max/min block duration

add compare flags func to compare flags between prom and sidecar

* fix some nits


Functional change: now we check the configured flags (if possible) and error out if MinTime != MaxTime. We need to check this always since if that is not true then we will get overlapping blocks. Additionally, an error message is printed out if it is not equal to 2h (the recommended value).

* Ensured index cache is best effort, refactored tests, validated edge cases. (thanos-io#1073)

Fixes thanos-io#651

Current size also includes slice header.

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

* website: Moved to netlify. (thanos-io#1078)

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

* website: Fixing netlify. (thanos-io#1080)

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

* website: Added "founded by" footer. (thanos-io#1081)

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

* store/proxy: properly check if context has ended (thanos-io#1082)

How the code was before it could happen that we might receive some
series from the stream however by the time we'd send them back to the
reader, it would not read it anymore since the deadline would have been
exceeded.

Properly use a `select` here to get out of the goroutine if the deadline
has been exceeded.

Might potentially fix a problem where we see one goroutine hanging
constantly (and thus blocking from work being done):

```
goroutine profile: total 126
25 @ 0x42f62f 0x40502b 0x405001 0x404de5 0xe7435b 0x45cc41
	0xe7435a	github.com/improbable-eng/thanos/pkg/store.startStreamSeriesSet.func1+0x18a	/go/src/github.com/improbable-eng/thanos/pkg/store/proxy.go:318
```

* Cut release v0.4.0-rc.1 (thanos-io#1088)

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

* website: Removed ghpages handling; fixed docs; and status badge. (thanos-io#1084)

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

* Fix readme (thanos-io#1090)

* store: Compose indexCache properly allowing injection for testing purposes. (thanos-io#1098)

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

* website: add sponsor section on homepage (thanos-io#1062)

* website: Adjusted logos sizing and responsiveness. (thanos-io#1105)

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

* Add Monzo to "Used by" section 🎉 (thanos-io#1106)

* Compactor: remove malformed blocks after delay (thanos-io#1053)

* compactor removes malformed blocks after delay

* compactor removes malformed blocks after delay

* include missing file

* reuse existing freshness check

* fix comment

* remove unused var

* fix comment

* syncDelay -> consistencyDelay

* fix comment

* update flag description

* address cr

* fix dupliacte error handling

* minimum value for --consistency-delay

* update

* docs

* add test case

* move test to inmem bucket

* Add Utility Warehouse to "used by" section (thanos-io#1108)

* Add Utility Warehouse logo

* Make logo smaller

* website: add Adform as users (thanos-io#1109)

We use Thanos extensively as well so I have added Adform.

* Cut release v0.4.0 (thanos-io#1107)

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
brancz pushed a commit to brancz/objstore that referenced this issue Jan 28, 2022
Minio is able to autodetect the region for cloud providers like AWS but the logic fails with Scaleway Object Storage solution.

Related issue on Minio: minio/mc#2570
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

3 participants