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

Incompatible declaration when using AWS SDK in deploy.php #3807

Open
seb-enovate opened this issue Apr 10, 2024 · 6 comments
Open

Incompatible declaration when using AWS SDK in deploy.php #3807

seb-enovate opened this issue Apr 10, 2024 · 6 comments

Comments

@seb-enovate
Copy link

  • Deployer version: 7.3.3

We are using the AWS SDK within our deploy.php file to fetch some data that we need for our deployments. However, since upgrading to more recent versions of the AWS SDK (version 3.303.4 in our case) we have been getting the following error when doing deploys (truncated for brevity):

PHP Fatal error:  Declaration of RingCentral\Psr7\Request::getRequestTarget() must be compatible with Psr\Http\Message\RequestInterface::getRequestTarget(): string in phar:///root/.composer/vendor/deployer/deployer/dep/vendor/ringcentral/psr7/src/Request.php on line 63
PHP Stack trace:
PHP   1. {main}() /root/.composer/vendor/bin/dep:0
PHP   2. include() /root/.composer/vendor/bin/dep:119
PHP   3. require() /root/.composer/vendor/deployer/deployer/dep:4
PHP   4. Deployer\Deployer::run($version = '7.3.3', $deployFile = '/builds/clients/target-zero-booking-system/deploy.php') phar:///root/.composer/vendor/deployer/deployer/dep/bin/dep:96
...

I believe the issue is that the AWS SDK changed their version constraint of the psr/http-message package to allow either 1.x or 2.x in this commit.

Now Deployer's version constraint for the same package is ^1, and I think this is allowing the package to jump to 2.x somehow.

Running the following command in my project that uses Deployer fixes the issue:

composer require "psr/http-message" "^1.1"

I also note that in the output of that composer command it says the following:

  - Downgrading psr/http-message (2.0 => 1.1)

So I think that the psr/http-message version constraint in Deployer's composer.json needs to be updated to be more restrictive and prevent that package jumping to 2.x.

@antonmedv
Copy link
Member

Do you ise Deployer at master?

@seb-enovate
Copy link
Author

Hi Anton,

We are using version 7.3.3, if that is what you are asking?

Thanks

Seb

@antonmedv
Copy link
Member

This is strange b/c deployed tagged version comes bunddled. No dependencies.

@seb-enovate
Copy link
Author

Not sure if this is helpful but we are installing Deployer like this:

composer require "deployer/deployer" "^7.0.1"

And then installing the AWS SDK like this:

composer require "aws/aws-sdk-php"

@mtwalsh
Copy link

mtwalsh commented May 22, 2024

@antonmedv Sorry to chase, but we're still hitting this issue, would it help if we submitted a PR that adds a version constraint for the psr/http-message that resolves the issue?

@antonmedv
Copy link
Member

@mtwalsh I guess you're using master branch. Try to switch a version tag.

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

3 participants