Incorrect status is show for AWSSDK, this is a bit of an issue, because it causes nagios to alarm on the red status even though there is no problem at all.

Error at /admin/reports/status shows:

AWSSDK	1.5.1 [compatibility test]
Your PHP environment does not support the minimum requirements for the AWS SDK for PHP.

Even though, everything is as it should be according to the compatibility test:

Minimum Requirements
Test	Should Be	What You Have
PHP	5.2 or newer	5.3.2-1ubuntu4.11
cURL	7.15.0 or newer, with SSL	7.19.7 (OpenSSL/0.9.8k)
SimpleXML	Enabled	Enabled
SPL	Enabled	Enabled
JSON	Enabled	Enabled
PCRE	Enabled	Enabled
File System Read/Write	Enabled	Enabled
Optional Extensions
Test	Would Like To Be	What You Have
OpenSSL	Enabled	Enabled
Zlib	Enabled	Enabled
APC	Enabled	Disabled
XCache	Enabled	Disabled
Memcache	Enabled	Enabled
Memcached	Enabled	Disabled
PDO	Enabled	Enabled
PDO-SQLite	Enabled	Disabled
SQLite 2	Enabled	Disabled
SQLite 3	Enabled	Enabled
Settings for php.ini
Test	Would Like To Be	What You Have
open_basedir	off	off
safe_mode	off	off
zend.enable_gc	on	on
Other
Test	Would Like To Be	What You Have
Architecture	64-bit	32-bit
Bottom Line: Yes, you can!
Your PHP environment is ready to go! There are a couple of minor features that you won't be able to take advantage of, but nothing that's a show-stopper.
CommentFileSizeAuthor
#10 1429614-compatibility.patch3.91 KBboombatower
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

boombatower’s picture

Status: Active » Postponed (maintainer needs more info)

It works locally. Really not sure without more detail. Is that the output that you get after clicking the link (aka the web version of the test) or the cli? If it's the web version then I'm really not sure, can you debug it further?

boombatower’s picture

Category: bug » support
Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Please reopen with more details.

coderintherye’s picture

Status: Closed (cannot reproduce) » Active

That is the output after clicking the link for the web test. I just ran the command line test, which provides conflicting results, as I'll paste below. I'm going to note that either way, you're relying on what can only be described as a rather terribly brittle way to test for this.

I debugged it further, and the problem is that the command line compatibility check has two if conditions, the first one passes fine and says the "Your environment is compatible..." whereas the second one does a further check to see if the system is 64-bit, if it's not then it displays the failing message.

I'd highly suggest that you include the file and then just check the return value of the success function or some such, rather than doing a strpos() check, but if you are going to do that, then you should check for "Your environment meets the minimum requirements for using the AWS SDK for PHP!" instead of the bottom line message.

I'm pasting below two outputs from the test, the first is with the unmodified file, the second is when I remove the is64_ok check.

/cms/main/sites/all/libraries:$ php ./awssdk/_compatibility_test/sdk_compatibility_test_cli.php
Xdebug requires Zend Engine API version 220060519.
The Zend Engine API version 220090626 which is installed, is newer.
Contact Derick Rethans at http://xdebug.org for a later version of Xdebug.

AWS SDK for PHP
PHP Environment Compatibility Test (CLI)
----------------------------------------

PHP 5.2 or newer............ Yes 5.3.2-1ubuntu4.11
64-bit architecture......... No
cURL with SSL............... Yes 7.19.7 (OpenSSL/0.9.8k)
Standard PHP Library........ Yes
SimpleXML................... Yes
JSON........................ Yes
PCRE........................ Yes
File system read/write...... Yes
OpenSSL extension........... Yes
Zlib........................ Yes
APC......................... No
XCache...................... No
Memcache.................... Yes
Memcached................... No
PDO......................... Yes
SQLite 2.................... No
SQLite 3.................... No
PDO-SQLite driver........... No
open_basedir disabled....... Yes
safe_mode disabled.......... Yes
Garbage Collector enabled... Yes
Valid SSL certificate....... Yes

----------------------------------------

Your environment meets the minimum requirements for using the AWS SDK for PHP!

* The OpenSSL extension is installed. This will allow you to use CloudFront
Private URLs and decrypt Windows instance passwords.

* The Zlib extension is installed. The SDK will automatically leverage the
compression capabilities of Zlib.

* You're running on a 32-bit system. This means that PHP does not correctly
handle files larger than 2GB (this is a well-known PHP issue).

* Storage types available for response caching:
The file system, Memcache

----------------------------------------

Bottom Line: We're sorry...
Your PHP environment does not support the minimum requirements for the
AWS SDK for PHP.

/cms/main/sites/all/libraries:$ php ./awssdk/_compatibility_test/sdk_compatibility_test_cli.php

AWS SDK for PHP
PHP Environment Compatibility Test (CLI)
----------------------------------------

PHP 5.2 or newer............ Yes 5.3.2-1ubuntu4.11
64-bit architecture......... No
cURL with SSL............... Yes 7.19.7 (OpenSSL/0.9.8k)
Standard PHP Library........ Yes
SimpleXML................... Yes
JSON........................ Yes
PCRE........................ Yes
File system read/write...... Yes
OpenSSL extension........... Yes
Zlib........................ Yes
APC......................... No
XCache...................... No
Memcache.................... Yes
Memcached................... No
PDO......................... Yes
SQLite 2.................... No
SQLite 3.................... No
PDO-SQLite driver........... No
open_basedir disabled....... Yes
safe_mode disabled.......... Yes
Garbage Collector enabled... Yes
Valid SSL certificate....... Yes

----------------------------------------

Your environment meets the minimum requirements for using the AWS SDK for PHP!

* The OpenSSL extension is installed. This will allow you to use CloudFront
Private URLs and decrypt Windows instance passwords.

* The Zlib extension is installed. The SDK will automatically leverage the
compression capabilities of Zlib.

* You're running on a 32-bit system. This means that PHP does not correctly
handle files larger than 2GB (this is a well-known PHP issue).

* Storage types available for response caching:
The file system, Memcache

----------------------------------------

Bottom Line: Yes, you can!

Your PHP environment is ready to go, and can take advantage of all possible features!

Recommended settings for config.inc.php

CFCredentials::set(array(
'@default' => array(
'key' => 'aws-key',
'secret' => 'aws-secret',
'default_cache_config' => '/path/to/cache/folder' ,
'certificate_authority' => false
)
));

dmeigs’s picture

I ran across this same issue. The problem is that sdk_compatibility_test.php uses

elseif ($php_ok && $curl_ok && $simplexml_ok && $dom_ok && $spl_ok && $json_ok && $pcre_ok && $file_ok)

to indicate a pass, but sdk_compatibility_test_cli.php uses

elseif ($php_ok && $curl_ok && $simplexml_ok && $dom_ok && $spl_ok && $json_ok && $pcre_ok && ($apc_ok || $xcache_ok || $sqlite_ok))

as a passing score.

I'm not sure which is the correct set of tests.

boombatower’s picture

The success() function:

function success($s = 'Yes')
{
	return is_windows() ? $s : "\033[1;37m\033[42m " . $s . " \033[0m";
}

tells us nothing about if the system is compatible. It is used to print out a success message. When I first looked at these scripts I was sad there was no programmatic way I could extra a pass/fail or somesuch short of strpos(). Perhaps such would be a good patch again upstream.

I also wonder why the two scripts differ as that seems inconsistent and I do not remember that being the case when I looked at them originally. I will file a report upstream and see what we can figure out.

boombatower’s picture

I submitted a pull request against the upstream SDK, https://github.com/amazonwebservices/aws-sdk-for-php/pull/23.

@nowarninglabel: Just to be sure would you go ahead and try the file from my github repo? You can download the raw file directly from https://raw.github.com/boombatower/aws-sdk-for-php/compatibility/_compat... or you can checkout the compatibility branch https://github.com/boombatower/aws-sdk-for-php/tree/compatibility.

Thanks for the detailed report.

boombatower’s picture

Assigned: Unassigned » boombatower
Status: Active » Needs review
coderintherye’s picture

Status: Needs review » Reviewed & tested by the community

I can confirm I now get both successful results, both green. This works, thanks.

I guess it's not exactly a patch, but marking RTBC, hopefully it gets pulled in upstream.

boombatower’s picture

Thanks for confirming that is fixes the issue.

If they accept the large overhaul changes then we can update awssdk module to be able to programmatic check a variable instead of doing string search.

boombatower’s picture

Title: Status Report is showing error of not having min. requirements, even though it does have them » Rewrite compatibility checking to take advantage of refactored SDK compatibility tests
Category: support » task
FileSize
3.91 KB

Amazon committed our changes upstream! I've updated the compatibility checking to take advantage of the changes.

boombatower’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Please reopen if the fix does not work.

Jorrit’s picture

Seems to work fine over here, thanks for the quick responses. It is good to hear that the Amazon folks implement improvements from the community.

Khumbu’s picture

i also can confirm that it works....thx

boombatower’s picture

Thanks for the feedback, just made 5.3 release (http://drupal.org/node/1556722).

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.