Aws::S3::Errors::AccessDenied: Access Denied - Carrierwave





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1















I am using the carrierwave-aws gem to handle user avatars. I have created an s3 account and bucket and created an IAM user. I granted the IAM user AmazonS3FullAccess policy. I also copied the same policy to the s3 bucket (making it public). My keys are stored in my enviornemnt and I have triple-checked that they are correct. Below is my configuration:



CarrierWave.configure do |config|
config.storage = :aws
config.aws_bucket = ENV["AWS_BUCKET"]
config.aws_acl = 'public-read'

config.aws_credentials = {
access_key_id: ENV["AWS_ACCESS_KEY"],
secret_access_key: ENV["AWS_SECRET_KEY"],
region: 'us-east-1',
stub_responses: Rails.env.test?
}
end


With that, I am receiving the following error: Aws::S3::Errors::AccessDenied: Access Denied when trying to upload a user avatar. Any thoughts on what I could be missing? I've spent hours trying many different things and I'm stumped!










share|improve this question























  • Check for CORS origin config in s3 bucket setting

    – Harsh Manvar
    Jan 3 at 4:01








  • 1





    My CORS config allows all origins and get, post and put methods

    – Noura
    Jan 3 at 4:08











  • and policy also set ?

    – Harsh Manvar
    Jan 3 at 4:08






  • 1





    Yes policy is set. I got it to work by unchecking all the options under "public access settings". I feel that there should be a better solution, however.

    – Noura
    Jan 3 at 4:16






  • 1





    yes it's working after the public access settings were changed. Looking into a better/more secure solution however.

    – Noura
    Jan 3 at 19:23


















1















I am using the carrierwave-aws gem to handle user avatars. I have created an s3 account and bucket and created an IAM user. I granted the IAM user AmazonS3FullAccess policy. I also copied the same policy to the s3 bucket (making it public). My keys are stored in my enviornemnt and I have triple-checked that they are correct. Below is my configuration:



CarrierWave.configure do |config|
config.storage = :aws
config.aws_bucket = ENV["AWS_BUCKET"]
config.aws_acl = 'public-read'

config.aws_credentials = {
access_key_id: ENV["AWS_ACCESS_KEY"],
secret_access_key: ENV["AWS_SECRET_KEY"],
region: 'us-east-1',
stub_responses: Rails.env.test?
}
end


With that, I am receiving the following error: Aws::S3::Errors::AccessDenied: Access Denied when trying to upload a user avatar. Any thoughts on what I could be missing? I've spent hours trying many different things and I'm stumped!










share|improve this question























  • Check for CORS origin config in s3 bucket setting

    – Harsh Manvar
    Jan 3 at 4:01








  • 1





    My CORS config allows all origins and get, post and put methods

    – Noura
    Jan 3 at 4:08











  • and policy also set ?

    – Harsh Manvar
    Jan 3 at 4:08






  • 1





    Yes policy is set. I got it to work by unchecking all the options under "public access settings". I feel that there should be a better solution, however.

    – Noura
    Jan 3 at 4:16






  • 1





    yes it's working after the public access settings were changed. Looking into a better/more secure solution however.

    – Noura
    Jan 3 at 19:23














1












1








1








I am using the carrierwave-aws gem to handle user avatars. I have created an s3 account and bucket and created an IAM user. I granted the IAM user AmazonS3FullAccess policy. I also copied the same policy to the s3 bucket (making it public). My keys are stored in my enviornemnt and I have triple-checked that they are correct. Below is my configuration:



CarrierWave.configure do |config|
config.storage = :aws
config.aws_bucket = ENV["AWS_BUCKET"]
config.aws_acl = 'public-read'

config.aws_credentials = {
access_key_id: ENV["AWS_ACCESS_KEY"],
secret_access_key: ENV["AWS_SECRET_KEY"],
region: 'us-east-1',
stub_responses: Rails.env.test?
}
end


With that, I am receiving the following error: Aws::S3::Errors::AccessDenied: Access Denied when trying to upload a user avatar. Any thoughts on what I could be missing? I've spent hours trying many different things and I'm stumped!










share|improve this question














I am using the carrierwave-aws gem to handle user avatars. I have created an s3 account and bucket and created an IAM user. I granted the IAM user AmazonS3FullAccess policy. I also copied the same policy to the s3 bucket (making it public). My keys are stored in my enviornemnt and I have triple-checked that they are correct. Below is my configuration:



CarrierWave.configure do |config|
config.storage = :aws
config.aws_bucket = ENV["AWS_BUCKET"]
config.aws_acl = 'public-read'

config.aws_credentials = {
access_key_id: ENV["AWS_ACCESS_KEY"],
secret_access_key: ENV["AWS_SECRET_KEY"],
region: 'us-east-1',
stub_responses: Rails.env.test?
}
end


With that, I am receiving the following error: Aws::S3::Errors::AccessDenied: Access Denied when trying to upload a user avatar. Any thoughts on what I could be missing? I've spent hours trying many different things and I'm stumped!







amazon-s3 ruby-on-rails-5 carrierwave






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 3 at 3:48









NouraNoura

62




62













  • Check for CORS origin config in s3 bucket setting

    – Harsh Manvar
    Jan 3 at 4:01








  • 1





    My CORS config allows all origins and get, post and put methods

    – Noura
    Jan 3 at 4:08











  • and policy also set ?

    – Harsh Manvar
    Jan 3 at 4:08






  • 1





    Yes policy is set. I got it to work by unchecking all the options under "public access settings". I feel that there should be a better solution, however.

    – Noura
    Jan 3 at 4:16






  • 1





    yes it's working after the public access settings were changed. Looking into a better/more secure solution however.

    – Noura
    Jan 3 at 19:23



















  • Check for CORS origin config in s3 bucket setting

    – Harsh Manvar
    Jan 3 at 4:01








  • 1





    My CORS config allows all origins and get, post and put methods

    – Noura
    Jan 3 at 4:08











  • and policy also set ?

    – Harsh Manvar
    Jan 3 at 4:08






  • 1





    Yes policy is set. I got it to work by unchecking all the options under "public access settings". I feel that there should be a better solution, however.

    – Noura
    Jan 3 at 4:16






  • 1





    yes it's working after the public access settings were changed. Looking into a better/more secure solution however.

    – Noura
    Jan 3 at 19:23

















Check for CORS origin config in s3 bucket setting

– Harsh Manvar
Jan 3 at 4:01







Check for CORS origin config in s3 bucket setting

– Harsh Manvar
Jan 3 at 4:01






1




1





My CORS config allows all origins and get, post and put methods

– Noura
Jan 3 at 4:08





My CORS config allows all origins and get, post and put methods

– Noura
Jan 3 at 4:08













and policy also set ?

– Harsh Manvar
Jan 3 at 4:08





and policy also set ?

– Harsh Manvar
Jan 3 at 4:08




1




1





Yes policy is set. I got it to work by unchecking all the options under "public access settings". I feel that there should be a better solution, however.

– Noura
Jan 3 at 4:16





Yes policy is set. I got it to work by unchecking all the options under "public access settings". I feel that there should be a better solution, however.

– Noura
Jan 3 at 4:16




1




1





yes it's working after the public access settings were changed. Looking into a better/more secure solution however.

– Noura
Jan 3 at 19:23





yes it's working after the public access settings were changed. Looking into a better/more secure solution however.

– Noura
Jan 3 at 19:23












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54016100%2fawss3errorsaccessdenied-access-denied-carrierwave%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54016100%2fawss3errorsaccessdenied-access-denied-carrierwave%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

How to fix TextFormField cause rebuild widget in Flutter

in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith