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

Not uploading files via dashboard (CLI works fine) #119

Open
intelligence opened this issue Aug 29, 2016 · 9 comments
Open

Not uploading files via dashboard (CLI works fine) #119

intelligence opened this issue Aug 29, 2016 · 9 comments

Comments

@intelligence
Copy link

Hey!

Just installed this little gem.
Got it setup on my dev environment for now.

I was able to successfully setup a S3 Bucket and use wp s3-uploads upload-directory uploads to get my stuff uploaded to said bucket.

Afterwards I ran wp s3-uploads enable but all files are still pointed towards my local files rather than the bucket. I figured it might be because all files are uploaded to ACF Fields (does this plugin support ACF?) so I tried uploading a regular featured image, but the file did not even end up on my bucket. If I re run wp s3-uploads upload-directory uploads it'll get there though.

Also updated permalinks if that would help prune the old ones. But no luck.
No errors throw in the dashboard. Any log I should look in?

What am I doing wrong?

Running on a Roots Bedrock stack with PHP 7.

@joehoyle
Copy link
Member

Hmm that's odd, sounds like it not actually enabling it somehow. Uploading a new file should certianly have sent it to the bucket. I presume you have the S3 Constants in your wp-config.php?

@intelligence
Copy link
Author

intelligence commented Aug 30, 2016

Acually, since Bedrock is a bit special I've got them setup in my functions.php, fetching the actual values from an .env file. Think that could cause it? Since it does upload via CLI it feels like it shouldn't be a problem..

@joehoyle
Copy link
Member

Hmm yeah that should be fine - as long as the constants get defined somehow. if you run wp s3-uploads verify what is the output?

@intelligence
Copy link
Author

intelligence commented Aug 30, 2016

Attempting to upload file /srv/www/xxx.dev/current/web/app/uploads/1453009861.jpg
File uploaded to S3 successfully.
Attempting to delete file. /srv/www/xxx.dev/current/web/app/uploads/1453009861.jpg
File deleted from S3 successfully.
Success: Looks like your configuration is correct.

Seems to be working!

@joehoyle
Copy link
Member

Hmm in this case I think you're going to have to get stuck into the code to debug, as I can't suggest much else from a distance, are you a developer with the skills necessary to debug the code?

@intelligence
Copy link
Author

Sure I'd be able to debug. Would be great if you could suggest an entry point though :)

@rmccue
Copy link
Member

rmccue commented Oct 16, 2016

I've got them setup in my functions.php, fetching the actual values from an .env file

I just want to check: do you mean your theme's functions.php? This might not be loaded in time to use S3 properly.

@leogopal
Copy link

I and getting the same error when trying to work with this:

I run wp s3-uploads upload-directory uploads

and get the following error:

/srv/www/wp-cli/php/WP_CLI/Runner.p in /vagrant/www/mysite/htdocs/wp-includes/functions.php on line 3996
Fatal error: Class 'Aws\S3\Sync\UploadSyncBuilder' not found in /vagrant/www/mysite/htdocs/wp-content/plugins/S3-Uploads/inc/class-s3-uploads-uploadsyncbuilder.php on line 3

I have all the variables set correctly in my wp-config.php file.
And migrate-attachments works fine:

/srv/www/wp-cli/php/WP_CLI/Runner.p in /vagrant/www/mysite/htdocs/wp-includes/functions.php on line 3996
Attempting to upload file s3://mysitebucket-wp/uploads/220719095.jpg
File uploaded to S3 successfully.
Attempting to delete file. s3://mysitebucket-wp/uploads/220719095.jpg
File deleted from S3 successfully.
Success: Looks like your configuration is correct.

using the latest master branch.

@leogopal
Copy link

I have removed the line as recommended here on #100 comment:
extends Aws\S3\Sync\UploadSyncBuilder

and this seems to allow the tranfer to continue.

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

4 participants