Cannot generate lazy proxy for service "aws.s3"
- Dominant language
- PHP
- Stars
- 362
- Forks
- 83
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug
When running any Symfony command, the following error happens:
```
In LazyServiceDumper.php line 138:
Cannot generate lazy proxy for service "aws.s3".
In ProxyHelper.php line 268:
Cannot generate lazy proxy: method "Aws\S3\S3Client::getSignatureProvider()" is final.
```
### Regression Issue
- [x] Select this option if this issue appears to be a regression.
### Expected Behavior
`aws.s3` Symfony service is loaded without any errors.
### Current Behavior
When running any Symfony command, the following error happens:
```
In LazyServiceDumper.php line 138:
Cannot generate lazy proxy for service "aws.s3".
In ProxyHelper.php line 268:
Cannot generate lazy proxy: method "Aws\S3\S3Client::getSignatureProvider()" is final.
```
### Reproduction Steps
Install the following versions inside a Symfony 6.4 project with PHP 8.4:
* aws/aws-sdk-php (3.356.9)
* aws/aws-sdk-php-symfony (2.8.0)
Inject the `@aws.s3` service as argument to any Symfony service.
Run `bin/console debug:container`
### Possible Solution
Make `Aws\S3\S3Client::getSignatureProvider()` ([Code](https://github.com/aws/aws-sdk-php/blob/42e1ac9cbb06b98ead34e32bd565f262161b77ab/src/AwsClient.php#L385)) non-final
### Additional Information/Context
_No response_
### SDK version used
3.356.9
### Environment details (OS name and version, etc.)
Ubuntu 24.04, PHP 8.4, Symfony 6.4
Contributor guide
Research direction
Reproduce the failure in a Symfony 6.4 project with PHP 8.4 using the listed AWS SDK versions, then inspect LazyServiceDumper.php line 138, ProxyHelper.php line 268, and AwsClient.php around line 385. Run bin/console debug:container; done means the aws.s3 service loads without the lazy-proxy error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, php, symfony
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100