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

403 when trying to write to S3 #632

Closed
dsilvasc opened this issue Dec 27, 2019 · 5 comments
Closed

403 when trying to write to S3 #632

dsilvasc opened this issue Dec 27, 2019 · 5 comments

Comments

@dsilvasc
Copy link

Hi, I've created a private S3 bucket and verified that I can write to it:

export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
export BUCKET=...
echo hi > hello.txt
aws s3 cp hello.txt s3://$BUCKET/test.txt
aws s3 cp s3://$BUCKET/test.txt /dev/stdout

It prints hi as expected.

With the same environment variables, I start an sccache server:

export SCCACHE_BUCKET=$BUCKET
SCCACHE_START_SERVER=1 SCCACHE_NO_DAEMON=1 RUST_LOG=sccache=trace sccache

Now when I try a cargo build somewhere, I get lots of failures like this:

 WARN 2019-12-27T23:25:54Z: sccache::cache::s3: Got AWS error: Error(BadHTTPStatus(403), State { next_error: None, backtrace: InternalBacktrace })
...
TRACE 2019-12-27T23:25:54Z: sccache::simples3::s3: PUT failed with HTTP status: 403 Forbidden
DEBUG 2019-12-27T23:25:54Z: sccache::compiler::compiler: [arrayvec]: Cache write error: Error(Msg("failed to put cache entry in s3"), State { next_error: Some(Error(BadHTTPStatus(403), State { next_error: None, backtrace: InternalBacktrace })), backtrace: InternalBacktrace })
DEBUG 2019-12-27T23:25:54Z: sccache::server: Error executing cache write: failed to put cache entry in s3
ERROR 2019-12-27T23:25:54Z: sccache::server: SccacheTransport::poll failed: io error.
ERROR 2019-12-27T23:25:54Z: sccache::server: io error.
...

Does sccache need anything other than AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to write to s3?

@chin33z
Copy link

chin33z commented Apr 10, 2020

I had exactly the same issue with you but can't figure it out. What is your s3 bucket region? My ap-southeast-1 is fine but ap-east-1 is not.

@nickpascucci
Copy link

I'm having the same issue as well. It would be great if the sccache documentation would list exactly what permissions are needed for S3 bucket cache stores, as I don't think this is actually documented anywhere — I certainly have not been able to find it.

@pcorliss
Copy link

@chin33z Just ran into the same issue. It looks like new buckets created as of April no longer support signature v2. Some regions like us-east-2 don't appear to offer backwards compatibility either.

https://www.drupal.org/project/backup_migrate_s3/issues/2653612

Looks like there's a PR to handle this but it has gone stale #522

@lackhoa
Copy link

lackhoa commented Apr 29, 2021

Hi, does somebody know the status of this issue? I'm using 0.2.15.
Is it simply not possible to use S3 backend?

Edit: 5m after writing this, it worked! I don't even know what I did but I guess it IS possible to use S3 backend after all.

@Xuanwo
Copy link
Collaborator

Xuanwo commented Feb 17, 2023

Should be fixed by #1404

@Xuanwo Xuanwo closed this as completed Feb 17, 2023
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

Successfully merging a pull request may close this issue.

6 participants