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

support for the new Scaleway Object Storage (S3 compatible) #2023

Closed
tapionx opened this issue Oct 5, 2018 · 22 comments
Closed

support for the new Scaleway Object Storage (S3 compatible) #2023

tapionx opened this issue Oct 5, 2018 · 22 comments

Comments

@tapionx
Copy link

tapionx commented Oct 5, 2018

Output of restic version

0.8.3

What should restic do differently? Which functionality do you think we should add?

Add a new backend supporting the new Scaleway Object Storage

https://www.scaleway.com/docs/object-storage-feature/

What are you trying to do?

I would like to use restic to backup my VPS on Scaleway.
Since the internal traffic will be free, i would love to use that Object Storage.

Did restic help you or made you happy in any way?

Restic is awesome!

@rawtaz
Copy link
Contributor

rawtaz commented Oct 5, 2018

@tapionx Thanks for filling out the issue template!

First, please update your restic version, the latest version is 0.9.2 and has lots of improvements and fixes since 0.8.3. You can go to https://github.com/restic/restic/releases to get a binary for your OS, if your package manager isn't updated.

Second, Scaleway say on their website that the object storage is S3 compliant, so you should be able to use it straight off with restic using the S3 backend. They do say that they "currently support a subset of S3 operations", but give it a shot and see how it works. More info is at https://www.scaleway.com/docs/s3-object-storage-api/ apparently.

@tapionx
Copy link
Author

tapionx commented Oct 5, 2018

i think version is not relevant here..
I will try indeed! Do you think it's just a matter of replacing s3.amazonaws.com with Scaleway endpoint?

@rawtaz
Copy link
Contributor

rawtaz commented Oct 5, 2018

Yes, the version note was just a friendly suggestion, considering your current version is very old. If you can, I recommend you update.

Yeah, that's the first thing to do; Try to use it as regular S3 (but obviously with a valid endpoint, as you say). See https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#amazon-s3 for more detailed instructions 👍

@fd0
Copy link
Member

fd0 commented Oct 6, 2018

I agree with @rawtaz, it should work out of the box with either the s3 backend or with the rclone backend, given that it works with programs like aws-cli: https://computingforgeeks.com/how-to-backup-files-to-scaleway-object-storage-using-aws-cli/

I'm going to close this issue for now, please feel free to add further comments when you try it. Thanks!

@fd0 fd0 closed this as completed Oct 6, 2018
@fd0 fd0 added the backend: s3 label Oct 6, 2018
@juzam
Copy link

juzam commented Oct 9, 2018

It seems that Scaleway Object storage is unusable if you are using V4 Signatures (works fine with V2, at least using https://s3browser.com/)
with restic 0.9.2 i get:

Fatal: create repository at s3:s3.nl-ams.scw.cloud/restic-test failed: client.BucketExists: The request signature we calculated does not match the signature you provided. Check your key and signing method.

which is consistent with what I get when using V4 signature with s3browser:

image

@fd0
Copy link
Member

fd0 commented Oct 9, 2018

Hm, as far as I know the s3 library we're using (minio-go) supports v2 and v4 signatures. Can you maybe say a word on that @harshavardhana?

Did you try using the rclone backend yet?

We're trying not to add new backends for now, doing so creates a lot of maintenance and testing work...

@harshavardhana
Copy link
Contributor

which is consistent with what I get when using V4 signature with s3browser:

This looks like a bug in Scaleway @juzam @fd0 - we could get. TraceOn() to see the request headers and see what is going to Scaleway.

But since both restic, s3browser are seeing same errors it is most probably a server issue.

@juzam
Copy link

juzam commented Oct 10, 2018

Did you try using the rclone backend yet?

@fd0 not yet, I'll try and report back

We're trying not to add new backends for now, doing so creates a lot of maintenance and testing work...

Ack. no need to add new backends if we can manage with the existing ones.

@harshavardhana From my limited testing it seems that Scaleway only supports v2 signatures but it should still be useable with minio-go, isn't it? maybe I'm missing something obvious, sorry for that.

@harshavardhana
Copy link
Contributor

@harshavardhana From my limited testing it seems that Scaleway only supports v2 signatures but it should still be useable with minio-go, isn't it? maybe I'm missing something obvious, sorry for that.

yes, in that case, you need to use minio.NewV2() - I don't think restic supports that @fd0 ?

@juzam
Copy link

juzam commented Oct 11, 2018

tl;dr: it works via rclone with v2 signatures

@fd0 happy to report that Scaleway S3 can be used if configured via rclone backend with a preexisting bucket.

here's the relevant rclone v1.43.1 remote configuration:

[scaleway]
type = s3
provider = Other
env_auth = false
access_key_id = xxxxxx
secret_access_key = yyyy
endpoint = s3.nl-ams.scw.cloud
acl = private
region = other-v2-signature

at first i've specified nothing as region using option 1 in rclone remote configuration:

Choose a number from below, or type in your own value
 1 / Use this if unsure. Will use v4 signatures and an empty region.
   \ ""
 2 / Use this only if v4 signatures don't work, eg pre Jewel/v10 CEPH.
   \ "other-v2-signature"

but it didn't work, just another info that corroborate the theory that v4 signatures are not a thing on Scaleway.

Edit: the bucket must be already present, if not, rclone can't create it with the above configuration, giving this error:

Post request put error: InvalidLocationConstraint: The specified location constraint is not valid.

@fd0
Copy link
Member

fd0 commented Oct 11, 2018

thank you very much for leaving feedback! :)

@johackim
Copy link

Actually, I use this command restic --repo rclone:scaleway:my-bucket init

# ~/.config/rclone/rclone.conf 

[scaleway]
type = s3
provider = Other
env_auth = false
access_key_id = MY_ACCESS_KEY
secret_access_key = MY_SECRET_KEY
endpoint = s3.nl-ams.scw.cloud
acl = private
region = other-v2-signature

Thanks @juzam

@juzam
Copy link

juzam commented Apr 5, 2019

just a quick update to anyone is looking to use Scaleway service. I had trouble saving backups to the nl-ams region recently and the support suggested changing the region parameter to region = nl-ams and the issue was resolved. I didn't try any bucket in the now available fr-par region.

@newtoncorp
Copy link

FYI, this works both on nl-ams or fr-par region (with no ~/.aws/*):

ip route add blackhole 169.254.169.254/32
mc config host add s3 https://s3.fr-par.scw.cloud:443 ACCESS SECRET
sed -i 's/S3v4/s3v2/g' ~/.mc/config.json
./restic_0.9.5_linux_amd64 -r s3:https://s3.fr-par.scw.cloud/BUCKETNAME init

We do support SigV4, but we don't have a "common" endpoint and Minio does not switch region (The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'fr-par')

Cheers

@harshavardhana
Copy link
Contributor

Restic should update to latest minio-go we have done some changes to handle region requirements appropriately.

@juzam
Copy link

juzam commented Jun 21, 2019

Restic should update to latest minio-go we have done some changes to handle region requirements appropriately.

@fd0 is this hard to implement? even if it works via rclone, using the s3 backend directly is more straightforward (and clean if you ask me). thank you for your time :)

@johackim
Copy link

Due to errors, I recently changed my rclone.conf :

# ~/.config/rclone/rclone.conf 

[scaleway]
type = s3
provider = Scaleway
env_auth = false
access_key_id = MY_ACCESS_KEY
secret_access_key = MY_ACCESS_KEY
region = fr-par
endpoint = s3.fr-par.scw.cloud

Inspired of https://habd.as/post/borg-backup-minio-scaleway/ article

@wintamute
Copy link

I had the same issue and added support for Scaleway to minio-go. Then rebuilt restic (and mc) with the updated version and both work fine, no further changes required, just use the s3 backend.
My changes automatically set the correct region based on the endpoint URL.
I submitted a PR to minio-go (minio/minio-go#1188), lets see if they get merged.

@Kaan88
Copy link

Kaan88 commented Nov 22, 2019

It seems it's up to restic developers to add region support. Should this issue be reopened?

@rawtaz
Copy link
Contributor

rawtaz commented Nov 22, 2019

@Kaan88 Does #2484 solve what you just asked about (region support)?

@Kaan88
Copy link

Kaan88 commented Nov 22, 2019

@rawtaz It definitely does. I didn't need to set the environment variable.

@rawtaz
Copy link
Contributor

rawtaz commented Nov 22, 2019

Awesome!

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

9 participants