Skip to content

rgw : fix python script using s3cmd with error code 403 - #49328

Merged
cbodley merged 2 commits into
ceph:mainfrom
BryceCao:wip-fix-python-script-using-s3cmd-with-error-code-403
Mar 22, 2023
Merged

cbodley merged 2 commits into
ceph:mainfrom
BryceCao:wip-fix-python-script-using-s3cmd-with-error-code-403

Conversation

@BryceCao

@BryceCao BryceCao commented Dec 8, 2022

Copy link
Copy Markdown
Contributor

Fixes: https://tracker.ceph.com/issues/54104
Signed-off-by: caolei [email protected]

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

@tchaikov

tchaikov commented Dec 9, 2022

Copy link
Copy Markdown
Contributor

jenkins test make check

@cbodley

cbodley commented Dec 9, 2022

Copy link
Copy Markdown
Contributor

still seeing those SignatureDoesNotMatch failures :(

2022-12-09T06:27:03.235 DEBUG:teuthology.orchestra.run.smithi161:> cat /etc/os-release
2022-12-09T06:27:03.284 INFO:teuthology.orchestra.run.smithi161.stdout:NAME="Ubuntu"
2022-12-09T06:27:03.348 INFO:teuthology.orchestra.run.smithi161.stdout:VERSION="20.04.5 LTS (Focal Fossa)"
...
2022-12-09T06:39:42.641 INFO:tasks.workunit.client.0.smithi161.stderr:INFO:root:s3cmd config written
2022-12-09T06:39:42.641 INFO:tasks.workunit.client.0.smithi161.stderr:DEBUG:root:exec_cmd(s3cmd --access_key=NX5QOQKC6BH2IDN8HC7A --secret_key=LnEsqNNqZIpkzauboDcLXLcYaWwLQ3Kop0zAnKIn -c /home/ubuntu/cephtest/mnt.0/client.0/tmp/s3cfg --host=http://localhost:80 mb s3://datacachebucket)
2022-12-09T06:39:43.048 INFO:tasks.workunit.client.0.smithi161.stderr:ERROR:root:command failed
2022-12-09T06:39:43.048 INFO:tasks.workunit.client.0.smithi161.stderr:ERROR:root:error: b'ERROR: S3 error: 403 (SignatureDoesNotMatch)\n'
2022-12-09T06:39:43.049 INFO:tasks.workunit.client.0.smithi161.stderr:returncode: 77
2022-12-09T06:39:43.049 INFO:tasks.workunit.client.0.smithi161.stderr:DEBUG:root:exec_cmd(s3cmd --access_key=NX5QOQKC6BH2IDN8HC7A --secret_key=LnEsqNNqZIpkzauboDcLXLcYaWwLQ3Kop0zAnKIn -c /home/ubuntu/cephtest/mnt.0/client.0/tmp/s3cfg --host=http://localhost:80 put /home/ubuntu/cephtest/mnt.0/client.0/tmp/7M.dat s3://datacachebucket)
2022-12-09T06:39:43.874 INFO:tasks.workunit.client.0.smithi161.stderr:ERROR:root:command failed
2022-12-09T06:39:43.874 INFO:tasks.workunit.client.0.smithi161.stderr:ERROR:root:error: b'ERROR: S3 error: 403 (SignatureDoesNotMatch)\n'
2022-12-09T06:39:43.874 INFO:tasks.workunit.client.0.smithi161.stderr:returncode: 77
2022-12-09T06:39:43.875 INFO:tasks.workunit.client.0.smithi161.stderr:DEBUG:root:exec_cmd(s3cmd --access_key=NX5QOQKC6BH2IDN8HC7A --secret_key=LnEsqNNqZIpkzauboDcLXLcYaWwLQ3Kop0zAnKIn -c /home/ubuntu/cephtest/mnt.0/client.0/tmp/s3cfg --host=http://localhost:80 get s3://datacachebucket/7M.dat /home/ubuntu/cephtest/mnt.0/client.0/tmp/7M-get.dat --force)
2022-12-09T06:39:44.071 INFO:tasks.workunit.client.0.smithi161.stderr:ERROR:root:command failed
2022-12-09T06:39:44.071 INFO:tasks.workunit.client.0.smithi161.stderr:ERROR:root:error: b'ERROR: S3 error: 403 (SignatureDoesNotMatch)\n'
2022-12-09T06:39:44.071 INFO:tasks.workunit.client.0.smithi161.stderr:returncode: 77

http://qa-proxy.ceph.com/teuthology/cbodley-2022-12-08_15:33:58-rgw:verify-wip-cbodley-testing-distro-default-smithi/7108357/teuthology.log

@BryceCao
BryceCao force-pushed the wip-fix-python-script-using-s3cmd-with-error-code-403 branch from 7a29489 to a10badd Compare December 12, 2022 01:50
@BryceCao

Copy link
Copy Markdown
Contributor Author

still seeing those SignatureDoesNotMatch failures :(

2022-12-09T06:27:03.235 DEBUG:teuthology.orchestra.run.smithi161:> cat /etc/os-release
2022-12-09T06:27:03.284 INFO:teuthology.orchestra.run.smithi161.stdout:NAME="Ubuntu"
2022-12-09T06:27:03.348 INFO:teuthology.orchestra.run.smithi161.stdout:VERSION="20.04.5 LTS (Focal Fossa)"
...
2022-12-09T06:39:42.641 INFO:tasks.workunit.client.0.smithi161.stderr:INFO:root:s3cmd config written
2022-12-09T06:39:42.641 INFO:tasks.workunit.client.0.smithi161.stderr:DEBUG:root:exec_cmd(s3cmd --access_key=NX5QOQKC6BH2IDN8HC7A --secret_key=LnEsqNNqZIpkzauboDcLXLcYaWwLQ3Kop0zAnKIn -c /home/ubuntu/cephtest/mnt.0/client.0/tmp/s3cfg --host=http://localhost:80 mb s3://datacachebucket)
2022-12-09T06:39:43.048 INFO:tasks.workunit.client.0.smithi161.stderr:ERROR:root:command failed
2022-12-09T06:39:43.048 INFO:tasks.workunit.client.0.smithi161.stderr:ERROR:root:error: b'ERROR: S3 error: 403 (SignatureDoesNotMatch)\n'
2022-12-09T06:39:43.049 INFO:tasks.workunit.client.0.smithi161.stderr:returncode: 77
2022-12-09T06:39:43.049 INFO:tasks.workunit.client.0.smithi161.stderr:DEBUG:root:exec_cmd(s3cmd --access_key=NX5QOQKC6BH2IDN8HC7A --secret_key=LnEsqNNqZIpkzauboDcLXLcYaWwLQ3Kop0zAnKIn -c /home/ubuntu/cephtest/mnt.0/client.0/tmp/s3cfg --host=http://localhost:80 put /home/ubuntu/cephtest/mnt.0/client.0/tmp/7M.dat s3://datacachebucket)
2022-12-09T06:39:43.874 INFO:tasks.workunit.client.0.smithi161.stderr:ERROR:root:command failed
2022-12-09T06:39:43.874 INFO:tasks.workunit.client.0.smithi161.stderr:ERROR:root:error: b'ERROR: S3 error: 403 (SignatureDoesNotMatch)\n'
2022-12-09T06:39:43.874 INFO:tasks.workunit.client.0.smithi161.stderr:returncode: 77
2022-12-09T06:39:43.875 INFO:tasks.workunit.client.0.smithi161.stderr:DEBUG:root:exec_cmd(s3cmd --access_key=NX5QOQKC6BH2IDN8HC7A --secret_key=LnEsqNNqZIpkzauboDcLXLcYaWwLQ3Kop0zAnKIn -c /home/ubuntu/cephtest/mnt.0/client.0/tmp/s3cfg --host=http://localhost:80 get s3://datacachebucket/7M.dat /home/ubuntu/cephtest/mnt.0/client.0/tmp/7M-get.dat --force)
2022-12-09T06:39:44.071 INFO:tasks.workunit.client.0.smithi161.stderr:ERROR:root:command failed
2022-12-09T06:39:44.071 INFO:tasks.workunit.client.0.smithi161.stderr:ERROR:root:error: b'ERROR: S3 error: 403 (SignatureDoesNotMatch)\n'
2022-12-09T06:39:44.071 INFO:tasks.workunit.client.0.smithi161.stderr:returncode: 77

http://qa-proxy.ceph.com/teuthology/cbodley-2022-12-08_15:33:58-rgw:verify-wip-cbodley-testing-distro-default-smithi/7108357/teuthology.log

code has been updated, replacing localhost with 127.0.0.1 can solve this problem. PTAL

@cbodley

cbodley commented Dec 12, 2022

Copy link
Copy Markdown
Contributor

@cbodley

cbodley commented Dec 12, 2022

Copy link
Copy Markdown
Contributor
2022-12-12T15:31:23.783 INFO:tasks.workunit.client.0.smithi092.stderr:DEBUG:root:exec_cmd(s3cmd --access_key=NX5QOQKC6BH2IDN8HC7A --secret_key=LnEsqNNqZIpkzauboDcLXLcYaWwLQ3Kop0zAnKIn --config=/home/ubuntu/cephtest/mnt.0/client.0/tmp/s3cfg --host=http://127.0.0.1:80 mb s3://datacachebucket)
2022-12-12T15:31:24.178 INFO:tasks.workunit.client.0.smithi092.stderr:ERROR:root:command failed
2022-12-12T15:31:24.178 INFO:tasks.workunit.client.0.smithi092.stderr:ERROR:root:error: b'ERROR: S3 error: 403 (SignatureDoesNotMatch)\n'
2022-12-12T15:31:24.178 INFO:tasks.workunit.client.0.smithi092.stderr:returncode: 77

@mkogan1
mkogan1 requested a review from a team as a code owner March 21, 2023 16:32
@mkogan1
mkogan1 requested a review from cbodley March 21, 2023 16:32
@mkogan1

mkogan1 commented Mar 21, 2023

Copy link
Copy Markdown
Contributor

@cbodley https requests required additional handling

@mkogan1

mkogan1 commented Mar 21, 2023

Copy link
Copy Markdown
Contributor

with the additional commit 2cb9441

passing the flow in teuthology with --host=httpS://... that previously failed with 403 :
http://qa-proxy.ceph.com/teuthology/mkogan-2023-03-21_14:16:48-rgw:verify-wip-ubu-SigDoesNotMatch-i01-distro-default-smithi/7215321/teuthology.log

│2023-03-21T14:55:28.633 INFO:tasks.workunit.client.0.smithi149.stderr:DEBUG:root:exec_cmd(s3cmd --access_key=NX5QOQKC6BH2IDN8HC7A --secret_key=LnEsqNNqZIpkzauboDcLXLcYaWwLQ3Kop0zAnKIn --config=/home/ubuntu/cephtest/mnt.0/client.0/tmp/s3cfg --no-check-hostname --host=https://127.0.0.1:443 mb s3://datacachebucket)                             │
│2023-03-21T14:55:28.856 INFO:tasks.workunit.client.0.smithi149.stderr:INFO:root:command succeeded                                                                                                                                                                                                                                                     │
│2023-03-21T14:55:28.856 INFO:tasks.workunit.client.0.smithi149.stderr:INFO:root:b"Bucket 's3://datacachebucket/' created\n"                                                                                                                                                                                                                           │
│2023-03-21T14:55:28.857 INFO:tasks.workunit.client.0.smithi149.stderr:DEBUG:root:exec_cmd(s3cmd --access_key=NX5QOQKC6BH2IDN8HC7A --secret_key=LnEsqNNqZIpkzauboDcLXLcYaWwLQ3Kop0zAnKIn --config=/home/ubuntu/cephtest/mnt.0/client.0/tmp/s3cfg --no-check-hostname --host=https://127.0.0.1:443 put /home/ubuntu/cephtest/mnt.0/client.0/tmp/7M.dat s│
│2023-03-21T14:55:29.250 INFO:tasks.workunit.client.0.smithi149.stderr:INFO:root:command succeeded                                                                                                                                                                                                                                                     │
│2023-03-21T14:55:29.250 INFO:tasks.workunit.client.0.smithi149.stderr:INFO:root:b"upload: '/home/ubuntu/cephtest/mnt.0/client.0/tmp/7M.dat' -> 's3://datacachebucket/7M.dat' (7340032 bytes in 0.2 seconds, 36.38 MB/s) [1 of 1]\n"                                                                                                                   │
│2023-03-21T14:55:29.250 INFO:tasks.workunit.client.0.smithi149.stderr:DEBUG:root:exec_cmd(s3cmd --access_key=NX5QOQKC6BH2IDN8HC7A --secret_key=LnEsqNNqZIpkzauboDcLXLcYaWwLQ3Kop0zAnKIn --config=/home/ubuntu/cephtest/mnt.0/client.0/tmp/s3cfg --no-check-hostname --host=https://127.0.0.1:443 get s3://datacachebucket/7M.dat /home/ubuntu/cephtest│
│2023-03-21T14:55:29.489 INFO:tasks.workunit.client.0.smithi149.stderr:INFO:root:command succeeded                                                                                                                                                                                                                                                     │
│2023-03-21T14:55:29.489 INFO:tasks.workunit.client.0.smithi149.stderr:INFO:root:b"download: 's3://datacachebucket/7M.dat' -> '/home/ubuntu/cephtest/mnt.0/client.0/tmp/7M-get.dat' (7340032 bytes in 0.1 seconds, 132.53 MB/s)\n"    

@mkogan1

mkogan1 commented Mar 22, 2023

Copy link
Copy Markdown
Contributor

jenkins test docs

@mkogan1

mkogan1 commented Mar 22, 2023

Copy link
Copy Markdown
Contributor

jenkins render docs

@mkogan1

mkogan1 commented Mar 22, 2023

Copy link
Copy Markdown
Contributor

jenkins test make check

@mkogan1

mkogan1 commented Mar 22, 2023

Copy link
Copy Markdown
Contributor

jenkins render docs

@cbodley
cbodley merged commit 504ff07 into ceph:main Mar 22, 2023
@cbodley

cbodley commented Mar 22, 2023

Copy link
Copy Markdown
Contributor

thanks @BryceCao @mkogan1!

@cbodley

cbodley commented Mar 31, 2023

Copy link
Copy Markdown
Contributor

@mkogan1 i still saw these signature mismatch errors against ubuntu 20.04 in http://qa-proxy.ceph.com/teuthology/cbodley-2023-03-30_18:07:30-rgw:verify-main-distro-default-smithi/7226781/teuthology.log

that was using the suite-branch https://github.com/cbodley/ceph/commits/wip-qa-rgw-distros, which does contain your fixes

2023-03-30T18:48:19.654 INFO:tasks.workunit.client.0.smithi031.stderr:INFO:root:Creating s3cmd config...
2023-03-30T18:48:19.654 INFO:tasks.workunit.client.0.smithi031.stderr:INFO:root:proto for s3cmd config is https
2023-03-30T18:48:19.654 INFO:tasks.workunit.client.0.smithi031.stderr:INFO:root:s3cmd config written
2023-03-30T18:48:19.655 INFO:tasks.workunit.client.0.smithi031.stderr:DEBUG:root:exec_cmd(s3cmd --access_key=NX5QOQKC6BH2IDN8HC7A --secret_key=LnEsqNNqZIpkzauboDcLXLcYaWwLQ3Kop0zAnKIn --config=/home/ubuntu/cephtest/mnt.0/client.0/tmp/s3cfg --no-check-hostname --host=https://127.0.0.1:443 mb s3://datacachebucket)
2023-03-30T18:48:19.848 INFO:tasks.workunit.client.0.smithi031.stderr:ERROR:root:command failed
2023-03-30T18:48:19.848 INFO:tasks.workunit.client.0.smithi031.stderr:ERROR:root:error: b'ERROR: S3 error: 403 (SignatureDoesNotMatch)\n'
2023-03-30T18:48:19.848 INFO:tasks.workunit.client.0.smithi031.stderr:returncode: 77

is it possible that focal doesn't understand that --no-check-hostname option?

@cbodley

cbodley commented Mar 31, 2023

Copy link
Copy Markdown
Contributor

is it possible that focal doesn't understand that --no-check-hostname option?

in a focal vm, s3cmd version 2.0.2, i do see that option listed. the teuthology log shows the same version: Unpacking s3cmd (2.0.2-1ubuntu1)

@mkogan1

mkogan1 commented Mar 31, 2023

Copy link
Copy Markdown
Contributor

@cbodley will check and update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants