Deprecation message php8.1.1 InstanceProfileProvider

Created on 2 June 2022, over 2 years ago
Updated 16 September 2023, about 1 year ago

Hello,

I recently updated my Drupal middleware to PHP 8.1 and I discovered this notice in my debug console

[DEBUG] [php] [2022-06-02T19:12:49] Deprecated function: Implicit conversion from float 1.2 to int loses precision in Aws\Credentials\InstanceProfileProvider->handleRetryableException() (line 262 of /opt/bitnami/drupal/vendor/aws/aws-sdk-php/src/Credentials/InstanceProfileProvider.php) #0 /opt/bitnami/drupal/core/includes/bootstrap.inc(346): _drupal_error_handler_real(8192, 'Implicit conver...', '/opt/bitnami/dr...', 262)
drupal_1   | #1 [internal function]: _drupal_error_handler(8192, 'Implicit conver...', '/opt/bitnami/dr...', 262)
drupal_1   | #2 /opt/bitnami/drupal/vendor/aws/aws-sdk-php/src/Credentials/InstanceProfileProvider.php(262): sleep(1.2)
drupal_1   | #3 /opt/bitnami/drupal/vendor/aws/aws-sdk-php/src/Credentials/InstanceProfileProvider.php(139): Aws\Credentials\InstanceProfileProvider->handleRetryableException(Object(GuzzleHttp\Exception\ConnectException), Array, 'Error retrievin...')

When I look your repository I find you're using aws/aws-sdk-php": "^3.18 and here I found this issues : aws-sdk-php/issues/2367 and aws-sdk-php/pull/2414

The last version of aws-sdk-php is 3.224.x, have you planed to update this dependency? I hope that will fix the implicit conversion from float issue.

Tell me if I can help more ! :)

πŸ› Bug report
Status

Closed: works as designed

Component

Code

Created by

πŸ‡«πŸ‡·France allema_s

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡«πŸ‡·France kumkum29

    Hi cmlara,

    I also get this error on my site since I switched to the php8.1 version. Before and with php 7.4 version I haven't any problem.

    Now I can no longer upload images to my S3 space... :(

    Here is my config :
    - drupal core 9.5.10
    - guzzle 6.5.8
    - s3fs module 3.3.0
    - php 8.1 (or 8.2)
    - aws sdk php 3.240.0

    How use the s3fs module with php version 8? Should I update a library? module ?

    Thanks for your help.

  • πŸ‡ΊπŸ‡ΈUnited States cmlara

    @kumkum29

    Deprecation just mean that code needs to be adjusted before a version is released in the future, in this case, before PHP 9.0 is released. PHP 9 does not even have a development branch open yet so we can assume this is some time out and is not a major concern.

    Deprecation generally do NOT stop code from operating, it is more likely that something has changed in your PHP8.0 config vs your PHP7.4 config causing issues.

    That said at the very least I would suggest updating the aws-sdk-php package to 279.0 or newer (at the moment I type this the latest is 3.281.8) as 3.279.0 is when a large portion of fixes were able to go in for PHP 8 deprecation handeling, before that they the aws-sdk-php maintained compatibility with PHP5.3 preventing a large number of changes.

Production build 0.71.5 2024