LoginSignup
2
0

More than 3 years have passed since last update.

Codebuildでs3のsyncコマンドを使うときの注意点

Last updated at Posted at 2019-09-30

ステータス失敗

CodeBuildでエラー
s3のsyncコマンドの戻り値が2!

[Container] 2019/09/24 08:16:28 Running command aws s3 sync public/ s3://XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
warning: Skipping file 'layout - \xe3\x82\xb3\xe3\x83\x94\xe3\x83\xbc.css'. There was an error trying to decode the the file 'layout - 
・
・
・
[Container] 2019/09/24 08:16:29 Command did not exit successfully aws s3 sync public/ s3://XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX exit status 2 
[Container] 2019/09/24 08:16:29 Phase complete: BUILD State: FAILED 
[Container] 2019/09/24 08:16:29 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: aws s3 sync public/ s3://XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. Reason: exit status 2 

原因

ファイル名にバックアップで、日本語のファイル名があったことが原因
「layout.css」というファイルをコピーして一旦、「layout - コピー.css」というファイルが存在しました。
そのファイルを削除することでエラーが発生せずに正常終了しました。

終わりに

2バイト文字があるとs3のsyncコマンドの戻り値は0じゃなく2になるんですね。
こういうのはやってみないと分からないですね。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0