archiecobbs / s3backer

FUSE/NBD single file backing store via Amazon S3
Other
538 stars 77 forks source link

s3backer seems to not work with Swift - special parameters needed? #207

Closed zilti closed 1 year ago

zilti commented 1 year ago

I am calling s3backer like this to create the initial "block device":

s3backer --debug --debug-http --blockSize=128k --size=5T --listBlocks --baseURL=https://s3.pub1.infomaniak.cloud/ --accessFile=/usr/local/etc/passwd-s3fs --blockCacheFile=/tmp/s3backer.cache --blockCacheSize=1000000 test-bucket /mnt/test-bucket

Unfortunately, all I get is a long list of requests failing with status code 400, the last of them:

* We are completely uploaded and fine
* old SSL session ID is stale, removing
< HTTP/1.1 400 Bad Request
< content-type: application/xml
< x-amz-id-2: txfde6c01b81ac4ec4a1692-0064b95295
< x-amz-request-id: txfde6c01b81ac4ec4a1692-0064b95295
< x-trans-id: txfde6c01b81ac4ec4a1692-0064b95295
< x-openstack-request-id: txfde6c01b81ac4ec4a1692-0064b95295
< date: Thu, 20 Jul 2023 15:28:21 GMT
< transfer-encoding: chunked
< strict-transport-security: max-age=63072000
* The requested URL returned error: 400
* Closing connection 0
*   Trying 185.125.25.56:443...
* Connected to s3.pub1.infomaniak.cloud (185.125.25.56) port 443 (#0)
* ALPN: offers h2,http/1.1
*  CAfile: /usr/local/share/certs/ca-root-nss.crt
*  CApath: none
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN: server did not agree on a protocol. Uses default.
* Server certificate:
*  subject: CN=api.pub1.infomaniak.cloud
*  start date: Apr 10 00:00:00 2023 GMT
*  expire date: Apr 23 23:59:59 2024 GMT
*  subjectAltName: host "s3.pub1.infomaniak.cloud" matched cert's "s3.pub1.infomaniak.cloud"
*  issuer: C=GB; ST=Greater Manchester; L=Salford; O=Sectigo Limited; CN=Sectigo RSA Domain Validation Secure Server CA
*  SSL certificate verify ok.
* using HTTP/1.x
> PUT /nextcloud-data/s3backer-mounted HTTP/1.1
Host: s3.pub1.infomaniak.cloud
User-Agent: s3backer/1.5.4/1.5.4
Accept: */*
x-amz-date: 20230720T152755Z
Content-Type: text/plain
Content-MD5: FinHtrwG+zy6PRMrxdGZIw==
x-amz-meta-s3backer-mount-token: 3c6cf4af
x-amz-acl: private
x-amz-content-sha256: 7c01d2bee06105d2a85302b9975a8eb0742e1678ee4006de1cfe54c939649cea
Authorization: AWS4-HMAC-SHA256 Credential=c848973c6ba441bcb9bd582cb7df9169/20230720/us-east-1/s3/aws4_request, SignedHeaders=content-md5;content-type;host;x-amz-acl;x-amz-content-sha256;x-amz-date;x-amz-meta-s3backer-mount-token, Signature=5e39fa70dd1b549a9189a8693d469ecff0c7d67cc6229b1da9033aaebcc1a3fd
Content-Length: 27

* We are completely uploaded and fine
* old SSL session ID is stale, removing
< HTTP/1.1 400 Bad Request
< content-type: application/xml
< x-amz-id-2: tx71c56e027c87445088918-0064b9529a
< x-amz-request-id: tx71c56e027c87445088918-0064b9529a
< x-trans-id: tx71c56e027c87445088918-0064b9529a
< x-openstack-request-id: tx71c56e027c87445088918-0064b9529a
< date: Thu, 20 Jul 2023 15:28:26 GMT
< transfer-encoding: chunked
< strict-transport-security: max-age=63072000
* The requested URL returned error: 400
* Closing connection 0

I also tried --auth-version=aws2 without success. And there seems to be no forcePathStyle argument, which might be the issue?

archiecobbs commented 1 year ago

Try the same thing without the --baseURL=https://s3.pub1.infomaniak.cloud/, i.e., using normal Amazon S3.

If it works, then it's a problem with infomaniak.cloud's service. If it doesn't work, then I'll try to take a further look.

zilti commented 1 year ago

Well never mind, I found out the version I am using (the one on FreeBSD) is 1.5, so this is something that has to be dealt with first...