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

AWS SDK version causing fatal error with S3 extension #1153

Open
katmoody opened this issue Dec 27, 2016 · 9 comments
Open

AWS SDK version causing fatal error with S3 extension #1153

katmoody opened this issue Dec 27, 2016 · 9 comments

Comments

@katmoody
Copy link
Contributor

Description of issue

Description by user @BandonRandon in https://github.com/humanmade/backupwordpress-pro-s3/issues/34:

The AWS SDK is out of date which causes a Fatal error when being used with another plugin (such as S3-Upload) using a newer version.

Here's the error I'm getting:

PHP Fatal error: Uncaught TypeError: Argument 1 passed to Aws\Common\Client\AbstractClient::__construct() must be an instance of Aws\Common\Credentials\CredentialsInterface, array given, called in /plugins/s3-uploads/inc/class-s3-uploads.php on line 187 and defined in plugins/backupwordpress-pro-s3/vendor/aws/aws-sdk-php/src/Aws/Common/Client/AbstractClient.php:73

Additional Useful Information

User @brandonrandon identified the primary issue and created the issue noted above, also commenting on this older isser from @pdewouters on why we were using the older version of the SDK still: https://github.com/humanmade/backupwordpress-pro-s3/issues/21#issuecomment-269293360

As this creates a fatal error I think it might be worth updating to the newer SDK at this time and think we should pull this into our next sprint if possible, with feedback from Paul and/or @sambulance or whoever else is able to help out.

@libby-barker
Copy link
Collaborator

@katmoody I pulled this into the sprint backlog and labeled Needs Confirmation for our next sprint planning meeting :)

@katmoody
Copy link
Contributor Author

Okay @libby-barker - It shouldn't be hard to replicate for confirmation - we can use the extension along with our own HIM S3 uploads plugin (that one uses the newer SDK) as that should throw the error.

@pdewouters
Copy link
Contributor

https://wordpress.org/about/stats/

there is still a large proportion of users on version < 5.5, so I don't think we should upgrade the SDK at this point.
The proportion is even higher when checking the data the plugin reports for users who opted in to support.

@katmoody
Copy link
Contributor Author

katmoody commented Jan 2, 2017

Hey @pdewouters - what would you recommend as the protocol for this error occurring in the future, then? If there will be a fatal error when the newer SDK version is used, should they do what this other user did? (she replaced it with the newer version for her site) - if so can I get guidance on putting a writeup together on the right way to do that? I'm sure doing that via a function would be best but I'm not sure if that is a possibility? How hard would that be to do?

@BrookeDot
Copy link

I do want to confirm the issue a bit better. I seem to only have a Fatal error when trying to use both the new and older version of the SKD. In my case S3 Upload and BackUpWordPress S3. S3 Uploads is pulling in the newer SDK. If I just BackUpWordPress without any other plugin calling the SDK things work as expected even on PHP 7.1.

What I think a good route would be is detect the PHP version of the site-owner. Then the plugin could include both the new and the old SDK and use the approprate one. The other options would be to maintain two versions of the plugin (which is painful) or have a guide on how to manually update the SDK.

Semi-related, I am having a small problem now with the newer SDK so I may need to do some more tinkering to get things to work, things are being stuck on "Deleting old backups" like in https://github.com/humanmade/backupwordpress-pro-s3/issues/26 I'll dig a bit and see if I can get it to work with the new SDK.

@katmoody
Copy link
Contributor Author

katmoody commented Jan 3, 2017

Thank you for the update @BandonRandon - I also like the other solution you suggested, perhaps including a function that detects the php version and then assigns the proper SDK as needed. I'd say we could detect incompatible plugins but there's no way to really know them all, even if we know most of them, so the php version is likely the easier of the two to include within a function.

I'm curious if you can outline more information about what is happening as the backups hang -- do all types of backups hang (database, files, and complete)? And is it only being stuck on the 'deleting old backups' or at other points as well?

It might be a good idea to see what might have changed between php 7.0 and 7.1 that could impact deleting files.

One last thing to check, if you are running into any kind of timeout issue there is one other timeout value you can access and change if you have access on your server. It's called the FastCGI FcgidIOTimeout setting and controls timing out of things like loading to external locations (I think). In the Apache configuration for FastCGI there is a setting for FcgidIOTimeout which can often be increased to 120 seconds or more. For more information you can follow this link: http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html#fcgidiotimeout

That has allowed backups to complete that were several GB in size for other users when nothing else worked.

@katmoody katmoody added this to the Future Release milestone Apr 28, 2017
@BrookeDot
Copy link

Looks like ~71% of WordPress users are now on php 5.5+ which is the minimum requirement for the new SDK. And with the new Minimum php Version community project (#). I'd be curious if this can be re-visited.

@katmoody
Copy link
Contributor Author

Let's see what @pdewouters and/or @roborourke thinks on this and maybe reconsider this? I agree with you @BandonRandon that it is worth a look for sure.

@pdewouters
Copy link
Contributor

@katmoody can you run a report on the percentage of users for this addon and the PHP versions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants