Couldn't connect to server: backblaze b2

I want to use backblaze b2 to storage files, but I can’t create library after configuration. Other s3 server is used normally.
My seafile_storage_classes.json:

{
"storage_id": "b2_storage",
"name": "b2 Storage",
"for_new_library": true,
"is_default": false,
"commits": {"backend": "s3", "bucket": "sea-commits", "key": "key***", "key_id": "id***", "host": "s3.us-west-002.backblazeb2.com", "path_style_request": "true"},

"fs": {"backend": "s3", "bucket": "sea-fs", "key": "key***", "key_id": "id***", "host": "s3.us-west-002.backblazeb2.com", "path_style_request": "true"},

"blocks": {"backend": "s3", "bucket": "sea-blocks", "key": "key***", "key_id": "id***", "host": "s3.us-west-002.backblazeb2.com", "path_style_request": "true"}
}

seafile.log:

[07/14/2020 03:32:01 PM] ../common/s3-client.c(704): [S3] libcurl failed to put sea-commits:77296716-de9e-4961-8463-f86bcb574134/d486d20a8ce4e2ec9d6db587b45eeb91050ca383: Couldn't connect to server.
[07/14/2020 03:32:01 PM] repo-mgr.c(6386): Failed to add commit.
1 Like

After browsing https://seafile.gitbook.io/seafile-server-manual/deploy-seafile-pro-edition/storage-backends/amazon-s3-backend I guess that you need at least:

  • add “:443” to the host and
  • add “use_https”: “true”

It doesn’t work. It still connected to server using http.

json

{

"storage_id": "b2_storage",

"name": "b2 Storage",

"for_new_library": true,

"is_default": false,

"commits": {"backend": "s3", "bucket": "seacommits", "key": "***", "key_id": "***", "host": "s3.us-west-002.backblazeb2.com:443", "path_style_request": "true", "use_https": "true"},

"fs": {"backend": "s3", "bucket": "sea-fs", "key": "***", "key_id": "***", "host": "s3.us-west-002.backblazeb2.com:443", "path_style_request": "true", "use_https": "true"},

"blocks": {"backend": "s3", "bucket": "sea-blocks", "key": "***", "key_id": "***", "host": "s3.us-west-002.backblazeb2.com:443", "path_style_request": "true", "use_https": "true"}

}

I’m trying the same with something like this:

 "commits": {
     "backend": "s3",
     "bucket": "seafile-commit-objects",
     "key_id": "BLEP", 
     "key": "BLAH",
     "use_https": true,
     "host": "s3.us-west-001.backblazeb2.com",
     "aws_region": "us-west-001",                                                                                                                                                        
     "use_v4_signature": true                                                                                                                                                            
 }

it seems to get further than yours, but still fails:

[07/15/2020 08:10:19 AM] ../common/s3-client.c(940): S3 error status for HEAD: 403.
[07/15/2020 08:10:19 AM] ../common/s3-client.c(720): S3 error status for PUT: 400.
[07/15/2020 08:10:19 AM] ../common/s3-client.c(721): Request URL: https://seafile-commit-objects.s3.us-west-001.backblazeb2.com/e96d6e9e-70e1-2ebb-89ce-619d9016331f/688ca5aef509e7dc160d8a928ff55b17da7bde55
[07/15/2020 08:10:19 AM] ../common/s3-client.c(722): Request headers:
[07/15/2020 08:10:19 AM] ../common/s3-client.c(621): Date: Wed, 15 Jul 2020 13:10:19 +0000
[07/15/2020 08:10:19 AM] ../common/s3-client.c(621): Authorization: AWS4-HMAC-SHA256 Credential=BLEP/20200715/us-west-001/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256,Signature=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[07/15/2020 08:10:19 AM] ../common/s3-client.c(621): x-amz-content-sha256: 5024b8f164f1e1f84c59fbea0d7e062f7480f10728b1aea58baeaff25070a685
[07/15/2020 08:10:19 AM] ../common/obj-backend-s3.c(348): Put object 688ca5aef509e7dc160d8a928ff55b17da7bde55 error 400. Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Error>
    <Code>InvalidRequest</Code>
    <Message>Error reading uploaded data: StreamCorruptedException(null)</Message>
</Error>

I got same error. I gave up.

I’ve reported the issue to seafile: github haiwen/seafile/issues/2356

I just came into this issue while trying to configure seafile 8.0 to use backblaze b2.
It’s quite strange that even a HEAD request cannot be fulfilled, which might be related to the implementation. However, it’s not possible for the community to dig into it due to the lack of source code.
Perhaps seafile should provide some guidelines in choosing a “qualified” S3-compitable service provider? Or some script for testing whether an S3 service has all the capabilities that seafile requests.

Currently we only tested with AWS S3. RadosGW from Ceph works too. I also heard that there is success working with ExoScale.

I think perhaps it’s the compatibility with v4 signatures. If the service support v2 signature, you may also try it out.

Thank you for your reply and suggestion.
Unfortunately Backblaze B2 does not support signature v2, so it’s not possible to use that.

Besides, it seems that Seafile has its own S3 client (as the log comes from “s3-client.c”), which makes it impossible for the community to test its compatibility with other services. Is it possible to make this client alone open source? In this way, other people can help with improving its compatibility, while you don’t have to add this feature into the community version of Seafile.

Finally I succeeded in setting up Seafile to work with BackBlaze B2 through s3proxy (GitHub - gaul/s3proxy: Access other storage backends via the S3 API). It can connect to B2 through the B2 API, and allow Seafile to use it with signature v2.
The structure of the whole setup looks like this:

Seafile ==(S3 API with signature v2)==> s3proxy ==(B2 API)==> BackBlaze B2

Everything looks fine so far, and I’ll see if there’s any problems.

Hello there.

Same issue with Filebase and Wasabi when using V4.

Wasabi also supports V2 but not Filebase.

I’ve also the ~/.boto file with the good setting, I’ve tested with some Python script and I can reach Filebase and Wasabi using V4. So something wrong is happening on SeafilePro side I guess? Also logs only show something an issue with commit and that’s all.

I think S3 as backend is getting more and more popular as storage is more and more expensive. B2 for example is a good solution, Wasabi is really known now and Filebase is part of the future imho.

Let me know if you need more informations.