pfaffman
(Jay Pfaffman)
11월 7, 2024, 7:24오후
1
Digital Ocean Spaces S3 설정으로 재빌드하던 중 다음과 같은 오류가 발생하기 시작했습니다:
, [2024-11-07T19:09:38.615466 #1] INFO -- : > cd /var/www/discourse && sudo -E -u discourse bundle exec rake s3:upload_assets
rake aborted!
ArgumentError: Cannot set dual-stack in combination with a custom endpoint. (ArgumentError)
raise ArgumentError, "Cannot set dual-stack in combination with a custom endpoint."
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-s3-1.143.0/lib/aws-sdk-s3/endpoint_provider.rb:34:in `resolve_endpoint'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-s3-1.143.0/lib/aws-sdk-s3/plugins/endpoints.rb:37:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/seahorse/client/plugins/endpoint.rb:47:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/plugins/param_validator.rb:26:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-s3-1.143.0/lib/aws-sdk-s3/plugins/sse_cpk.rb:24:in `call'
하지만 whatever로 설정하는 것을 생략하면 빌드가 다음과 같이 실패합니다:
I, [2024-11-07T19:15:31.060936 #1] INFO -- : > cd /var/www/discourse && sudo -E -u discourse bundle exec rake s3:upload_assets
ERROR: Ensure S3 is configured in config/discourse.conf or environment vars
I, [2024-11-07T19:15:36.056204 #1] INFO -- :
다음 내용을 찾았습니다:
opened 06:43AM - 07 Jun 24 UTC
closed 06:22PM - 29 Jun 26 UTC
bug
stale
### Description
The `use_dualstack_endpoint` parameter instructs the AWS SDK en… dpoint resolver to return a dual-stack endpoint. If a custom endpoint is configured for a service, the resolver returns an error.
When a custom endpoint is supplied for a service, the value of `use_dualstack_endpoint` must be ignored.
Test the following combinations:
* Use dual-stack endpoint set on the provider, shared configuration file, or environment variable
* No custom endpoint (returns default dual-stack endpoint), custom endpoint set on the provider, shared configuration file, or environment variable, base endpoint set in shared configuration file or environment variable (#32649 suggests adding base endpoint configuration on the provider)
### References
See #37876 for the equivalent issue with FIPS endpoints
### Would you like to implement a fix?
None
그리고 이것도:
opened 02:01PM - 04 Jan 23 UTC
closed 05:24PM - 05 Jan 23 UTC
guidance
response-requested
### Describe the bug
After the update to version 3.243.0 and I think the start … of using Aws\EndpointV2 it would appear that the option for `use_dual_stack_endpoint` and possibly `use_fips_endpoint` are always true. This prevents multipart uploads which use accelerator and any writes that use accelerator with possible other issues as a result.
When tracing through the updates made in 3.243.0 and subsequent updates I was unable to determine where the options are actually being set to true, or if the default behavior for these options is being assumed as true on the AWS end and explicitly setting them to false is being ignored.
I am using Laravel 9 with league/flysystem-aws-s3-v3 but the issue appears to be isolated with changes starting with aws-sdk-php v3.243.0 and later. Explicitly setting `"aws/aws-sdk-php": "3.242.1"` in composer resolves the issue
### Expected Behavior
Default values for `use_dual_stack_endpoint` and `use_fips_endpoint` is false.
Setting env variables `AWS_USE_DUAL_STACK_ENDPOINT` and `AWS_USE_FIPS_ENDPOINT` to false is respected.
### Current Behavior
Default values for `use_dual_stack_endpoint` and `use_fips_endpoint` appears to be true.
Setting env variables `AWS_USE_DUAL_STACK_ENDPOINT` and `AWS_USE_FIPS_ENDPOINT` to false is ignored.
### Reproduction Steps
Create an S3 client with default Laravel S3 config and create a multipart upload
```
$client = Storage::disk('s3')->getClient();
$result = $client->createMultipartUpload([
'Bucket' => $bucket,
'Key' => $key,
'ContentType' => $type,
'ContentDisposition' => 'inline',
]);
```
Results in error `Host override cannot be combined with Dualstack, FIPS, or S3 Accelerate`
Environment variables used
```
AWS_ACCESS_KEY_ID=*****
AWS_SECRET_ACCESS_KEY=*****
AWS_DEFAULT_REGION=ca-central-1
AWS_BUCKET=my-bucket-name
AWS_URL="https://s3.amazonaws.com"
AWS_POST_END_POINT="https://${AWS_BUCKET}.s3.amazonaws.com/"
AWS_USE_PATH_STYLE_ENDPOINT=false
AWS_USE_ACCELERATE_ENDPOINT=true
AWS_USE_DUAL_STACK_ENDPOINT=false
AWS_USE_FIPS_ENDPOINT=false
```
### Possible Solution
_No response_
### Additional Information/Context
The specific error `Host override cannot be combined with Dualstack, FIPS, or S3 Accelerate` does not appear to be common but has recently been reported with aws cli on stackoverflow indicating it may actually result from a more recent change on AWS/S3 side of things.
### SDK version used
3.243.0
### Environment details (Version of PHP (`php -v`)? OS name and version, etc.)
php 8.0.12, laravel/framerwork ^9.0, league/flysystem-aws-s3-v3 ^3.0, aws/aws-sdk-php ^3.243.0
여기에서 엔드포인트가 설정된 경우 S3_REGION을 비워야 하지 않을까요?
- DISCOURSE_S3_REGION
and either
- DISCOURSE_S3_ACCESS_KEY_ID
- DISCOURSE_S3_SECRET_ACCESS_KEY
or
- DISCOURSE_S3_USE_IAM_PROFILE
TEXT
end
opts = { region: ENV["DISCOURSE_S3_REGION"] }
opts[:endpoint] = ENV["DISCOURSE_S3_ENDPOINT"] if ENV["DISCOURSE_S3_ENDPOINT"].present?
if ENV["DISCOURSE_S3_USE_IAM_PROFILE"].blank?
opts[:access_key_id] = ENV["DISCOURSE_S3_ACCESS_KEY_ID"]
opts[:secret_access_key] = ENV["DISCOURSE_S3_SECRET_ACCESS_KEY"]
end
{ client_options: opts, bucket: ENV["DISCOURSE_S3_BUCKET"] }
end
def migrate
@Falco 이 문제는 당신의 전문 분야인 것 같습니다.
pfaffman
(Jay Pfaffman)
이 글을 에 분리
11월 7, 2024, 7:30오후
2