Don
2024 年 11 月 7 日午前 8:13
1
こんにちは
以下の問題で再構築できません。
I, [2024-11-07T08:00:56.758061 #1] INFO -- : cd /var/www/discourse & sudo -E -u discourse bundle exec rake s3:upload_assets
rake aborted!
ArgumentError: カスタムエンドポイントと組み合わせてデュアルスタックを設定することはできません。(ArgumentError)
raise ArgumentError, "Cannot set dual-stack in combination with a custom endpoint."
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse & sudo -E -u discourse bundle exec rake s3:upload_assets はリターンコード #<Process::Status: pid 3349 exit 1> で失敗しました
失敗場所: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec はパラメータ {"cd"=>"$home", "cmd"=>["sudo -E -u discourse bundle exec rake s3:upload_assets", "sudo -E -u discourse bundle exec rake s3:expire_missing_assets"]} で失敗しました
ブートストラップは終了コード 1 で失敗しました
**ブートストラップ失敗** 上記にスクロールして、以前のエラーメッセージを探してください。複数ある場合があります。
./discourse-doctor は問題の診断に役立つ場合があります。
567dc9e1f9a4e662de6024b8504915d8b6ef1ee2d9b4303af75323ba478679e4
関連する可能性のあるコミット: FIX: Use dualstack S3 endpoint for direct uploads (#29611) · discourse/discourse@0568d36 · GitHub
S3 オブジェクトストレージ を使用して DO Spaces にアップロードしています。問題はおそらくこれに関連しています。
Discourse:
設定
Discourse の静的アセットをオブジェクトストレージに保存するには、hooks セクションの app.yml にこの設定を追加してください。
after_assets_precompile:
- exec:
cd: $home
cmd:
- sudo -E -u discourse bundle exec rake s3:upload_assets
- sudo -E -u discourse bundle exec rake s3:expire_missing_assets
よろしくお願いします
「いいね!」 1
Don
2024 年 11 月 7 日午前 9:35
2
これらの行をコメントアウトしたところ、再構築は正常に実行されましたが、アセットをロードできないためか、サイトがスプラッシュ画面でスタックしています。 セーフモードも同じです…
after_assets_precompile:
- exec:
cd: $home
cmd:
- sudo -E -u discourse bundle exec rake s3:upload_assets
- sudo -E -u discourse bundle exec rake s3:expire_missing_assets
何かアイデアはありますか?悪いタイミングなのはわかっています…
「いいね!」 1
nat
(Natalie T)
2024 年 11 月 7 日午前 9:44
3
ドニーさん、確認します。ご報告ありがとうございます。
「いいね!」 1
Don
2024 年 11 月 7 日午前 10:33
5
「いいね!」 2
pfaffman
(Jay Pfaffman)
2024 年 11 月 7 日午後 7:24
6
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
bug
### 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、ごめん。
「いいね!」 1
pfaffman
(Jay Pfaffman)
2024 年 11 月 7 日午後 7:40
8
奇妙なことに、これにより次のエラーが発生します。
Gem::LoadError: can't activate webrick-1.9.0, already activated webrick-1.8.2 (Gem::LoadError)
これは、インポートを実行するために使用していたインスタンスでちょうど見られたもので、「修正」するためにアップグレードしました。
このサーバーは今アップグレードできないようです。
Don
2024 年 11 月 7 日午後 7:48
9
確信はありませんが、試す価値はあるかもしれません。以前はこれを実行する前に再構築に成功しました。
I commented out these lines which makes the rebuild run successfully but the site stuck on splash I think because cannot load assets. Safe mode same…
after_assets_precompile:
- exec:
cd: $home
cmd:
- sudo -E -u discourse bundle exec rake s3:upload_assets
- sudo -E -u discourse bundle exec rake s3:expire_missing_assets
Any idea? I know it’s a bad timing…
そして、この直後にコミットを選択して再構築を試しました。2回目は正常に再構築されました。
「いいね!」 1
Falco
(Falco)
2024 年 11 月 7 日午後 8:14
10
@martin 通常、ここで行うことは、互換性のない S3 クローンを実行しているユーザーがオプトインして動作するようにするためのグローバル設定を提供することです。
IMO、現在の動作はデフォルトのままにし、互換性を高めるためのトグルを提供する必要があります。
DISCOURSE_S3_HTTP_CONTINUE_TIMEOUT、DISCOURSE_S3_INSTALL_CORS_RULE などの先行事例を参照してください。
「いいね!」 3
martin
(Martin Brennan)
2024 年 11 月 8 日午前 12:13
11
申し訳ありません、私のミスです。これらのS3クローンはいつも忘れてしまいます。昨日、Minioでこのカスタムエンドポイントの問題を修正する必要がありました。DISCOURSE_S3_ENDPOINTが設定されている場合、dualstackは互換性がないため、絶対に使用しないようにすれば、ここで修正できると思います。皆さんがそれを使用しているようです。
「いいね!」 3
pfaffman
(Jay Pfaffman)
2024 年 11 月 8 日午後 4:03
14
Martin Brennan:
これを修正しました
迅速な修正ありがとうございます!これで元通り作業できます。
Falco:
先行事例を参照してください
明快なご説明ありがとうございます、ラファエル!
覚えるべきことがたくさんあるからです!そして、仕様テストは、私が書くのが嫌いだと知っている、あの厄介な stub_request を必要とするのではないでしょうか。
参考までに、それは正しいように思えます。そして、stub_request を必要としないテストを書くことができるでしょう。
「いいね!」 1
nat
(Natalie T)
このトピックを分割しました:
2024 年 11 月 13 日午前 5:49
16
merefield
(Robert)
2024 年 11 月 13 日午前 11:29
17
これは fixed としてマークされるべきではないと思います。
この変更により、複数のインスタンスでバックアップが破損した 可能性が非常に高いです(他のインスタンスでは、まだバックアップされていないことに気づいていないと思われます)。
これは、仕様がすべての実際のユースケースを十分に捉えきれておらず、通過すべきではない変更が通過していることを示唆しているのではないでしょうか?
「いいね!」 4
pfaffman
(Jay Pfaffman)
2024 年 11 月 14 日午後 5:01
18
use_s3 がオンになっているサイトのみ修正され、S3 をバックアップ専用に使用しているサイトは修正されていないように思われます。
再構築は可能ですが、S3 バックアップが壊れているだけです。
「いいね!」 3
martin
(Martin Brennan)
2024 年 11 月 15 日午前 4:41
19
「いいね!」 3
j.jaffeux
(Joffrey Jaffeux)
クローズされました:
2024 年 11 月 18 日午前 4:42
20
このトピックは、最後の返信から3日後に自動的にクローズされました。新しい返信は許可されていません。