PhilippHeuer / wordpress-heroku

This project is a template for installing and running WordPress 5.x on Heroku.
MIT License
273 stars 316 forks source link

The uploaded file could not be moved to uploads #21

Closed sebbean closed 6 years ago

sebbean commented 6 years ago

Description of your issue

Unable to get S3 uploads to work properly

Steps to Reproduce

  1. Deploy app to heroku (used auto-deploy button)
  2. Add "bucketeer" as resource
  3. Upload media file in admin
  4. Get "The uploaded file could not be moved to uploads" error

Other Information

Git Commit/Version: Referenced in this issue: https://github.com/humanmade/S3-Uploads/issues/205

Followed steps mentioned by @considine with no luck.

Also getting this error: https://github.com/humanmade/S3-Uploads/issues/166 when attempting to create isam role.

-sb

ElNinjaGaiden commented 6 years ago

Hello. I'm having exactly the same issue. Any ideas? By the way, I'm a newbie on WP.

considine commented 6 years ago

Haven't used the heroku app but will take a look today or tomorrow and let you know

sebbean commented 6 years ago

Uploads work fine in the moment without any BUCKETEER env vars set. Even shows the image/thubmail in the admin and on public post views, but only until next deploy, then they break.

Once you add the BITBUCKETEER resource ( https://github.com/PhilippHeuer/wordpress-heroku/blob/master/config/plugins/heroku/heroku-bucketeer.php) add on it seems to trigger the aws-sdk code which either breaks because of lacking region var (in other branches I have been trying on) or shows this error.

If you send an email to my username at gmail dot com i’d be more than happy to add you to a few heroku test projects i’ve been playing around with.

They're just vanilla deploys from the heroku deploy button with different configurations. Some with a manuall download of the S3-Uploads plugin commited and deployed.

Would love to help figure this out. I’m more of a ruby / rails guy myself, just can’t seem to stay away from WP and this seems like a pretty nice way to get a modern deployment flow on the WP platform.

-sb

On Mon, Jan 15, 2018 at 6:17 PM considine notifications@github.com wrote:

Haven't used the heroku app but will take a look today or tomorrow and let you know

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PhilippHeuer/wordpress-heroku/issues/21#issuecomment-357834311, or mute the thread https://github.com/notifications/unsubscribe-auth/AAZ4PU1Y5-iccw6VNkm83HabvG2gDnOvks5tLAaxgaJpZM4RfJu0 .

sebbean commented 6 years ago

See followup here: https://github.com/humanmade/S3-Uploads/issues/205#issuecomment-357832532

Seems to be an issue with this: https://github.com/PhilippHeuer/wordpress-heroku/blob/master/config/plugins/heroku/heroku-bucketeer.php file

Notice $env['user'] in there... seems wrong.

-sb

ElNinjaGaiden commented 6 years ago

Jmmm in my case I'm not using Bucketeer and it fails to. I'm going to try to add Bucketeer.

PhilippHeuer commented 6 years ago

You'r right, $env['user'] is wrong there, seems like a leftover.

And there was another issue with the bucketeer env vars. The heroku extension does not set a env var with the region - so it can't take the region from between s3-{region}.amazonaws.com in the url since it was just s3.amazonaws.com.

For Bucketeer to work you now need to provide a BUCKETEER_REGION manually in the heroku dashboard secrets so that the right URL can be generated.

Both fixes are in the develop branch for now - feel free to try it out.

ElNinjaGaiden commented 6 years ago

Just for the record, I got it working. My main problem was I was using the wrong AWS S3 ACCESS_KEY and ACCESS_SECRET.

My bad.

sebbean commented 6 years ago

@PhilippHeuer Bucketeer has a region env

screen shot 2018-01-16 at 2 28 32 pm
PhilippHeuer commented 6 years ago

I set it up according to https://devcenter.heroku.com/articles/bucketeer but didn't test it myself since there was no free plan. The docs don't mention the BUCKETEER_AWS_REGION but propose to hardcode it - which won't work anymore since they support more regions.

I will change the part in the bucketeer config, so it will use the BUCKETEER_AWS_REGION set by the extension.

Thanks for the info @sebbean

PhilippHeuer commented 6 years ago

It's fixed now - i also updated to the latest wp 4.9.2 since i was working on it anyway.

abdurrahman commented 4 years ago

Hi Philipp,

Is there any solution for this error ? I am getting the same error when i am try to upload media. I have AWS bucket and made configuration for s3-uploads plugin but maybe my policy or configuration might wrong. I set _AWS_S3URL but it didnt work for me. Should i open new issue ?

PhilippHeuer commented 4 years ago

Yeah, please create a new issue - i don't think its the same as this one and a bit more information about your error would be good.