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

Files not uploading to S3 #152

Open
seunex opened this issue Mar 2, 2017 · 8 comments
Open

Files not uploading to S3 #152

seunex opened this issue Mar 2, 2017 · 8 comments

Comments

@seunex
Copy link

seunex commented Mar 2, 2017

Hi,
I downloaded version 1.1.0 and installed.
The installation was successful, I configure the Constants as specified.
I have been trying to upload image with media or upload new plugins, None of these files gets Uploaded to S3.

instead of showing thumbnail on Media Upload, I get this error :

The uploaded file could not be moved to uploads. "path/name_of_file/"

Thanks in advance.

@rmccue
Copy link
Member

rmccue commented Mar 3, 2017

This error means that move_uploaded_file() failed when it was called inside _wp_handle_upload() in WP core.

What are your constants set to? Is S3 Uploads actually active?

@seunex
Copy link
Author

seunex commented Mar 3, 2017

Hello ,
Thanks for your response.

S3 Uploads is active Because when i deactivated it, the image upload to the wordpress uploads folder.

Also by constant, I'm sure you are referring to this.

define( 'S3_UPLOADS_BUCKET', 'myBucketName' );
define( 'S3_UPLOADS_KEY', '' ); //SET TO i am user key
define( 'S3_UPLOADS_SECRET', '' ); //set to i am user SECRET
define( 'S3_UPLOADS_REGION', ' ); //same as the location used in my bucket name.

What could be wrong please.

Thanks in advance.

@peterjanes
Copy link

peterjanes commented Mar 10, 2018

I'm seeing similar behaviour, although not the error message. It looks like the wp_handle_sideload_prefilter action is never being called.

@rmccue There's no call to move_uploaded_file in 1.1.0, only in the 2.x betas.

@rmccue
Copy link
Member

rmccue commented Mar 11, 2018

@peterjanes Not sure what you mean by that; the call to move_uploaded_file is inside WordPress core's _wp_handle_upload(), not in S3 Uploads.

You should check that S3 Uploads is actually functionally active; there are a number of checks that will cause it to fail.

@peterjanes
Copy link

Understood. I thought your earlier comment was saying there was a call to the method in the plugin.

I added error_log statements around all of the checks I could find, and they all passed. I couldn't get the sideload action to be triggered at all, including in the beta from last year, so I've decided to use another plugin.

@theasteve
Copy link

@rmccue where is this 'S3_UPLOADS_USE_INSTANCE_PROFILE' being generated? is not specifid in the docs

@rmccue
Copy link
Member

rmccue commented May 22, 2019

@theasteve You're right, it's not documented, apologies.

tl;dr: rather than defining S3_UPLOADS_KEY and S3_UPLOADS_SECRET, you can define S3_UPLOADS_USE_INSTANCE_PROFILE. This will tell the AWS SDK to use the default credentials which are:

  1. Load credentials from environment variables.
  2. Load credentials from a credentials .ini file.
  3. Load credentials from an IAM role.

@ThianBrodie
Copy link

Hi, I tried all variations, S3_UPLOADS_KEY, S3_UPLOADS_SECRET and S3_UPLOADS_USE_INSTANCE_PROFILE on a fresh install of wordpress V5.2.1 php7.3, site keeps crashing with following error.

The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.

In the email sent;
Since WordPress 5.2 there is a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.

In this case, WordPress caught an error with one of your plugins, S3 Uploads.

Not sure what to try next

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

5 participants