s3-actions / s3cmd

expose s3cmd utility
20 stars 13 forks source link

Issue with creating new bucket Space in digitalocean using s3cmd action #12

Open MozeBaltyk opened 4 months ago

MozeBaltyk commented 4 months ago

Get this error when using this action for digitalocean:

name: Stage deployment

on:
  workflow_dispatch:

env:
  DO_PAT: ${{secrets.DIGITALOCEAN_ACCESS_TOKEN}}
  S3_ACCESS_KEY_ID: ${{secrets.DIGITALOCEAN_SPACES_ACCESS_TOKEN}}
  S3_SECRET_ACCESS_KEY: ${{secrets.DIGITALOCEAN_SPACES_SECRET_KEY}}

jobs:
  backend:
    name: Backend
    runs-on: ubuntu-latest

    steps:
      - name: Set up S3cmd cli tool
        uses: s3-actions/s3cmd@main
        with:
          provider: digitalocean
          region: FRA1
          access_key: ${{secrets.DIGITALOCEAN_SPACES_ACCESS_TOKEN}}
          secret_key: ${{secrets.DIGITALOCEAN_SPACES_SECRET_KEY}}

      - name: Interact with object storage
        run: |
          buck="github-action-${{ github.run_id }}"
          mkdir example
          s3cmd mb s3://$buck
          echo 'foo' >> example/bar
          s3cmd put example/bar s3://$buck
          mkdir -p example/baz/bar
          echo 'fizz' >> example/baz/bar/faz
          sleep 10
          s3cmd sync --recursive --acl-public example s3://$buck
          #sleep 10
          #s3cmd rm -r --force s3://$buck
          #sleep 10
          #s3cmd rb s3://$buck
ERROR: S3 error: 400 (XAmzContentSHA256Mismatch)
Error: Process completed with exit code 11.

I also manage to reproduce the error manually : https://www.digitalocean.com/community/questions/s3cmd-signaturedoesnotmatch

also one more interesting point is that if the bucket already exist, then I can interact with it. It´s only the creation which is problematic.

MozeBaltyk commented 4 months ago

Solution by adding to the s3cfg file: signature_v2 = True

But action here does not allow for further configuration.

bluebrown commented 2 months ago

@MozeBaltyk , sorry for the late reply. You could open a pr or change this in your workflow via flag other manipulating the file by other means.