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

s3fs - how to correct connect and get access to BTFS S3 storage node? #382

Closed
dipol0 opened this issue Oct 1, 2023 · 8 comments
Closed

Comments

@dipol0
Copy link

dipol0 commented Oct 1, 2023

Hi all.

I fount when go-btfs now have S3 srorage mode. I configure it and it work over WebUI. Files uploads/downloads fine (strange- when delete it - dash dont show decrease free space on storage ??? - may be data store on BTFS a little time? )

s3fs version - Amazon Simple Storage Service File System V1.90 (commit:unknown) with GnuTLS(gcrypt)

Main Q: i try mount S3 btfs storage bucket on Ubuntu 22.04 with s3fs. But cant read/write to mounted storage. Only see content list.

Install s3fs use apt: apt install s3fs
I create bucket "iso-images" and upload 1 iso-image file over WebUI:

Выделение_058

  1. Create keys from WebUI - Access Keay Management
  2. Create ~./passdw-s3 and put KEY:SECRET to it.
  3. Create folder /media/btfs-s3 and set user owner and chmod to 755
  4. Try mount:
    s3fs iso-images:/ /media/btfs-s3 -o passwd_file=/home/manager/.passwd-s3fs,nonempty -o use_path_request_style -o host=http://192.168.0.50:6001/

Storage mounted and i can see content in Midnight commander? but cant r/w from/to it.

Выделение_059

Try copy file to it get:

cp: cant close '/media/btfs-s3/awscliv2.zip': Operation not permitted.

In LOG btfs i see (when try copy file to bucket):

s3-api: | 2023-10-01T13:24:52+03:00 | <HEAD> | /iso-images/awscliv2.zip | HeadObjectHandler | &{UserId:a8ba917c-5fa1-43e6-8b84-b46a5c874c55 Bucket:iso-images Object:awscliv2.zip WithBody:false} | object not found |  254.992µs
s3-api: | 2023-10-01T13:24:52+03:00 | <HEAD> | /iso-images/awscliv2.zip/ | HeadObjectHandler | &{UserId:a8ba917c-5fa1-43e6-8b84-b46a5c874c55 Bucket:iso-images Object:awscliv2.zip/ WithBody:false} | object not found |  132.49µs
s3-api: | 2023-10-01T13:24:52+03:00 | <HEAD> | /iso-images/awscliv2.zip_$folder$ | HeadObjectHandler | &{UserId:a8ba917c-5fa1-43e6-8b84-b46a5c874c55 Bucket:iso-images Object:awscliv2.zip_$folder$ WithBody:false} | object not found |  225.309µs
s3-api: | 2023-10-01T13:24:52+03:00 | <GET > | /iso-images/?delimiter=/&max-keys=2&prefix=awscliv2.zip/ | ListObjectsHandler | &{UserId:a8ba917c-5fa1-43e6-8b84-b46a5c874c55 Bucket:iso-images MaxKeys:2 Marker: Prefix:awscliv2.zip/ Delimiter:/ EncodingType:} | <nil> |  254.084µs
s3-api: | 2023-10-01T13:24:52+03:00 | <HEAD> | /iso-images/awscliv2.zip | HeadObjectHandler | &{UserId:a8ba917c-5fa1-43e6-8b84-b46a5c874c55 Bucket:iso-images Object:awscliv2.zip WithBody:false} | object not found |  232.782µs
s3-api: | 2023-10-01T13:24:52+03:00 | <HEAD> | /iso-images/awscliv2.zip/ | HeadObjectHandler | &{UserId:a8ba917c-5fa1-43e6-8b84-b46a5c874c55 Bucket:iso-images Object:awscliv2.zip/ WithBody:false} | object not found |  210.153µs
s3-api: | 2023-10-01T13:24:52+03:00 | <HEAD> | /iso-images/awscliv2.zip_$folder$ | HeadObjectHandler | &{UserId:a8ba917c-5fa1-43e6-8b84-b46a5c874c55 Bucket:iso-images Object:awscliv2.zip_$folder$ WithBody:false} | object not found |  234.179µs
s3-api: | 2023-10-01T13:24:52+03:00 | <GET > | /iso-images/?delimiter=/&max-keys=2&prefix=awscliv2.zip/ | ListObjectsHandler | &{UserId:a8ba917c-5fa1-43e6-8b84-b46a5c874c55 Bucket:iso-images MaxKeys:2 Marker: Prefix:awscliv2.zip/ Delimiter:/ EncodingType:} | <nil> |  348.719µs
s3-api: | 2023-10-01T13:24:52+03:00 | <HEAD> | /iso-images/awscliv2.zip | HeadObjectHandler | &{UserId:a8ba917c-5fa1-43e6-8b84-b46a5c874c55 Bucket:iso-images Object:awscliv2.zip WithBody:false} | object not found |  158.541µs
s3-api: | 2023-10-01T13:24:52+03:00 | <HEAD> | /iso-images/awscliv2.zip/ | HeadObjectHandler | &{UserId:a8ba917c-5fa1-43e6-8b84-b46a5c874c55 Bucket:iso-images Object:awscliv2.zip/ WithBody:false} | object not found |  209.595µs
s3-api: | 2023-10-01T13:24:52+03:00 | <HEAD> | /iso-images/awscliv2.zip_$folder$ | HeadObjectHandler | &{UserId:a8ba917c-5fa1-43e6-8b84-b46a5c874c55 Bucket:iso-images Object:awscliv2.zip_$folder$ WithBody:false} | object not found |  97.01µs
s3-api: | 2023-10-01T13:24:52+03:00 | <GET > | /iso-images/?delimiter=/&max-keys=2&prefix=awscliv2.zip/ | ListObjectsHandler | &{UserId:a8ba917c-5fa1-43e6-8b84-b46a5c874c55 Bucket:iso-images MaxKeys:2 Marker: Prefix:awscliv2.zip/ Delimiter:/ EncodingType:} | <nil> |  222.795µs

or then try read from it:

s3-api: | 2023-10-01T13:27:31+03:00 | <GET > | /iso-images/?delimiter=/&max-keys=1000&prefix= | ListObjectsHandler | &{UserId:a8ba917c-5fa1-43e6-8b84-b46a5c874c55 Bucket:iso-images MaxKeys:1000 Marker: Prefix: Delimiter:/ EncodingType:} | <nil> |  424.428µs
s3-api: | 2023-10-01T13:27:31+03:00 | <GET > | /iso-images/?delimiter=/&max-keys=1000&prefix= | ListObjectsHandler | &{UserId:a8ba917c-5fa1-43e6-8b84-b46a5c874c55 Bucket:iso-images MaxKeys:1000 Marker: Prefix: Delimiter:/ EncodingType:} | <nil> |  416.815µs
s3-api: | 2023-10-01T13:27:50+03:00 | <HEAD> | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | HeadObjectHandler | &{UserId:a8ba917c-5fa1-43e6-8b84-b46a5c874c55 Bucket:iso-images Object:XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 WithBody:false} | <nil> |  349.627µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  245.494µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  189.76µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  220.56µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  230.897µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  232.783µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  159.937µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  191.645µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  211.061µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  191.157µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  203.868µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  187.735µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  170.763µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  189.76µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  166.572µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  175.581µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  180.751µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  203.449µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  203.449µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  192.135µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  192.135µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  207.22µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  160.846µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  160.775µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  160.845µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  163.639µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  165.105µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  162.312µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  182.985µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  132.49µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  211.481µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  163.709µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  95.613µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  118.8µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  173.696µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  183.125µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  232.852µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  203.379µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  200.096µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  167.481µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  386.993µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  216.23µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  157.982µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  216.23µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  213.785µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  203.868µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  177.048µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  202.89µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  143.385µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  176.978µs
s3-api: | 2023-10-01T13:27:50+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  277.691µs
s3-api: | 2023-10-01T13:27:51+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  199.189µs
s3-api: | 2023-10-01T13:27:51+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  225.728µs
s3-api: | 2023-10-01T13:27:51+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  205.754µs
s3-api: | 2023-10-01T13:27:51+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  185.988µs
s3-api: | 2023-10-01T13:27:51+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  214.344µs
s3-api: | 2023-10-01T13:27:51+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  203.03µs
s3-api: | 2023-10-01T13:27:51+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  103.645µs
s3-api: | 2023-10-01T13:27:51+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  190.667µs
s3-api: | 2023-10-01T13:27:51+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  210.084µs
s3-api: | 2023-10-01T13:27:51+03:00 | <GET > | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | GetObjectHandler | <nil> | param Range is unsported |  323.157µs
s3-api: | 2023-10-01T13:27:53+03:00 | <GET > | /iso-images/?delimiter=/&max-keys=1000&prefix= | ListObjectsHandler | &{UserId:a8ba917c-5fa1-43e6-8b84-b46a5c874c55 Bucket:iso-images MaxKeys:1000 Marker: Prefix: Delimiter:/ EncodingType:} | <nil> |  279.646µs
s3-api: | 2023-10-01T13:27:53+03:00 | <HEAD> | /iso-images/XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 | HeadObjectHandler | &{UserId:a8ba917c-5fa1-43e6-8b84-b46a5c874c55 Bucket:iso-images Object:XigmaNAS-x64-LiveCD-13.2.0.5.9876.iso.tar.bz2 WithBody:false} | <nil> |  183.614µs
s3-api: | 2023-10-01T13:27:53+03:00 | <GET > | /iso-images/?delimiter=/&max-keys=1000&prefix= | ListObjectsHandler | &{UserId:a8ba917c-5fa1-43e6-8b84-b46a5c874c55 Bucket:iso-images MaxKeys:1000 Marker: Prefix: Delimiter:/ EncodingType:} | <nil> |  243.747µs

What wrong or my mistake ??? Or s2fs don't work correct with btfs ???

+++ I see this in dashboard - "You can use AWS CLI to interact with BTFS's S3-compatible API"
May be anybody can give link to how use AWS CLI with btfs-s3 ? How to configure access...etc...

PS btfs config file for S3:

 "S3CompatibleAPI": {
    "Enable": true,
    "Address": "192.168.0.50:6001",
    "HTTPHeaders": null
  },

may be need add someone for HTTPHeaders for enable access over s3fs ?

Tnx.

  • UPD * May be usefull for )) - Use AWS CLI

Configure:

aws configure --profile=BTFS-S3

where BTFS-S3 - any name you choice (it can be any value)

Enter:

AWS Access Key ID [None]: KEY_FROM_ACCESS_MANAGEMENT_BTFS_WEB_UI
AWS Secret Access Key [None]: SECRET_FROM_ACCESS_MANAGEMENT_BTFS_WEB_UI
Default region name [None]: 
Default output format [None]:

and use:

aws --endpoint=aws --endpoint=http://192.168.0.50:6001 --profile=BTFS-S3 s3 ls s3://
2023-10-01 02:03:48 iso-images

copy local file to bucket:

aws --endpoint=aws --endpoint=http://192.168.0.50:6001 --profile=BTFS-S3 s3 cp OPNsense-23.7-dvd-amd64.iso.bz2 s3://iso-images
upload: ./OPNsense-23.7-dvd-amd64.iso.bz2 to s3://iso-images/OPNsense-23.7-dvd-amd64.iso.bz2

see in webui:

Выделение_060

@CrCati
Copy link
Collaborator

CrCati commented Oct 2, 2023

Hi, @dipol0; as to read the mounted file, the error may caused by https://github.com/s3fs-fuse/s3fs-fuse/issues/1815, you can upgrade the s3fs to 1.88 or 1.93 and try again. BTW, the BTFS S3-compatible API only supports [AWS v4 signatures (AWS4-HMAC-SHA256)] for authentication and does not support AWS v2 signatures at this time. So, the command should be sudo s3fs iso-images /media/btfs-s3 -o passwd_file=~/passwd-s3fs,nonempty -o use_path_request_style -o sigv4 -o host=http://192.168.0.50:6001/

@dipol0
Copy link
Author

dipol0 commented Oct 2, 2023

@CrCati , tnx for advise. may be i try it ))

PS + when a ise native aws-cli (aws) for upload file to BTFS-S3 - all fine

aws --endpoint=aws --endpoint=http://192.168.0.50:6001 --profile=BTFS-S3 s3 cp /home/manager/Yandex.deb s3://iso-images/Yandex.deb`

but then try download from get fail:

aws --endpoint=aws --endpoint=http://192.168.0.50:6001 --profile=BTFS-S3 s3 cp s3://iso-images/Yandex.deb /home/manager/Yandex.deb
download failed: s3://iso-images/Yandex.deb to ../home/manager/Yandex.deb An error occurred (NotImplemented) when calling the GetObject operation: A header you provided implies functionality that is not implemented

in btfs daeon log see:

s3-api: | 2023-10-02T11:41:34+03:00 | <HEAD> | /iso-images/Yandex.deb | HeadObjectHandler | &{UserId:a8ba917c-5fa1-43e6-8b84-b46a5c874c55 Bucket:iso-images Object:Yandex.deb WithBody:false} | <nil> |  425.755µs
s3-api: | 2023-10-02T11:41:34+03:00 | <GET > | /iso-images/Yandex.deb | GetObjectHandler | <nil> | param Range is unsported |  302.344µs
s3-api: | 2023-10-02T11:41:34+03:00 | <GET > | /iso-images/Yandex.deb | GetObjectHandler | <nil> | param Range is unsported |  197.373µs
s3-api: | 2023-10-02T11:41:34+03:00 | <GET > | /iso-images/Yandex.deb | GetObjectHandler | <nil> | param Range is unsported |  243.119µs

aws-cli/2.13.22 Python/3.11.5 Linux/6.2.0-33-generic exe/x86_64.ubuntu.22 prompt/off

@CrCati
Copy link
Collaborator

CrCati commented Oct 2, 2023

Hi, @dipol0; I can't reproduce it. I used the aws-cli to upload and download different files, and all success:
image
image

aws-cli/1.29.57 Python/3.11.5 Darwin/22.5.0 botocore/1.31.57
BTW, I install aws-cli with this cmd python -m pip install awscli

@dipol0
Copy link
Author

dipol0 commented Oct 2, 2023

@CrCati , you can show/share you BTFS node config file? Without critical info ;)

  • and how OS you use and BTFS from (precompiled/self-compiled) ???

@CrCati
Copy link
Collaborator

CrCati commented Oct 2, 2023

OK, the config file is:
image

My node is using pre-compiled version: https://github.com/bittorrent/go-btfs/releases/download/btfs-v2.3.3/btfs-linux-amd64

@dipol0
Copy link
Author

dipol0 commented Oct 2, 2023

@CrCati , tnx. Hmmm...very strange. I have same version pre-compiled 2.3.3-linux-amd64.
but
aws-cli/2.13.22 Python/3.11.5 Linux/6.2.0-33-generic exe/x86_64.ubuntu.22 prompt/off
and upload worked, download - not. If use cli. WebUI up/down - work fine.

UPD
I found then standart "aws cp" can upload BIG size file to btfs s3 storage. And aws - btfs put it as multipart file. But then try "aws cp" from S3 to local place - it not woked by default.
With small files "aws cp" worked correct.

Выделение_070

If need get BIG size file back from S3 to local i can like this (it worked for me):

manager@host:~/src$ aws --endpoint=http://192.168.0.50:6001 --profile=BTFS-S3 s3api get-object --bucket iso-images --key OPNsense-23.7-dvd-amd64.iso.bz2 /home/manager/OPNsense-23.7-dvd-amd64.iso.bz2
{
    "AcceptRanges": "bytes",
    "LastModified": "2023-10-02T21:06:46+00:00",
    "ContentEncoding": "",
    "ContentType": ", application/x-iso9660-image",
    "Metadata": {
        "Cid": "QmXH*******************evLU1Y"
    }
}

I dont profi and dont know is issue awscli or btfs S3-API realization ))

Read AWS doc - Downloading an object - Using the AWS CLI

May be useful for somebody ))

@CrCati , if you can confirm my investigation ? Try upload big file ~200..300Mb to btfs and try download it back:
1 use "asw cp" (you get alerts about error downloading or not)
2. use "asw get-object"

Tnx.

UPD a little off topic))
Noob questions.

  1. There is a local BTFS node. I upload data/files to it via WebUI or awscli. In this case, these data/files are stored only locally or distributed in the BTFS nodes network?
  2. When deleting a file from storage, no reduction in space is displayed. Is this how it should be? Or what...?

@CrCati
Copy link
Collaborator

CrCati commented Oct 7, 2023

Hi, @dipol0; I've tried that; the extra_args 'range' is not supported in this version. So, the 'aws cp' will get the 'A header you provided implies functionality that is not implemented' message. The feature to support more header formats is on the way. You can use 'aws get-object' for now.
As to 1. these data/files are stored only locally; 2. the space value should be updated; it will be fixed soon.

@CrCati
Copy link
Collaborator

CrCati commented Oct 8, 2023

I'll close this GitHub issue now; if you have more information to share, please feel free to reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants