Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For the "manager" code sample, the S3 bucket is not created in minio container #212

Open
GeoffMontee opened this issue Jan 23, 2024 · 1 comment
Assignees

Comments

@GeoffMontee
Copy link

When the "manager" code sample is used, the Docker configuration does not create the S3 bucket in the minio container. This causes errors to be seen when the backup command is run.

Steps to reproduce

Follow the instructions on the Monitoring and Manager Lab in Scylla University.

  1. Clone the repo:
git clone https://github.com/scylladb/scylla-code-samples.git
  1. Change to the "manager" directory in the repo:
cd scylla-code-samples/manager
  1. Build the containers:
docker-compose build
docker-compose up -d
  1. Create the cluster in ScyllaDB Manager:
docker-compose exec scylla-manager sctool cluster add --name test_university --host=scylla-node1 --auth-token=token
  1. Attempt to run a backup:
docker-compose exec scylla-manager sctool backup -c test_university --location s3:docker

Actual results

An error is seen, because the bucket does not exist:

Error: create backup target: location is not accessible
 172.18.0.4: agent [HTTP 404] no put permission: s3 upload: 404 Not Found: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchBucket</Code><Message>The specified bucket does not exist</Message><Key>scylla-manager-agent-979845285/test</Key><BucketName>docker</BucketName><Resource>/docker/scylla-manager-agent-979845285/test</Resource><RequestId>17AD0E97586A5447</RequestId><HostId>dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8</HostId></Error> - make sure the location is correct and credentials are set, to debug SSH to 172.18.0.4 and run "scylla-manager-agent check-location -L s3:docker --debug"
 172.18.0.6: agent [HTTP 404] no put permission: s3 upload: 404 Not Found: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchBucket</Code><Message>The specified bucket does not exist</Message><Key>scylla-manager-agent-719114050/test</Key><BucketName>docker</BucketName><Resource>/docker/scylla-manager-agent-719114050/test</Resource><RequestId>17AD0E975866E38A</RequestId><HostId>dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8</HostId></Error> - make sure the location is correct and credentials are set, to debug SSH to 172.18.0.6 and run "scylla-manager-agent check-location -L s3:docker --debug"
 172.18.0.5: agent [HTTP 404] no put permission: s3 upload: 404 Not Found: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchBucket</Code><Message>The specified bucket does not exist</Message><Key>scylla-manager-agent-951999125/test</Key><BucketName>docker</BucketName><Resource>/docker/scylla-manager-agent-951999125/test</Resource><RequestId>17AD0E975872880C</RequestId><HostId>dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8</HostId></Error> - make sure the location is correct and credentials are set, to debug SSH to 172.18.0.5 and run "scylla-manager-agent check-location -L s3:docker --debug"
Trace ID: XXoqT7hsQdyTmHrnSyj7Zw (grep in scylla-manager logs)

Expected results

To get the expected results, the bucket must be created:

  1. Create a bash shell in the container:
sudo docker exec -it manager_minio_1 bash
  1. Run some mc commands in the container:
/usr/bin/mc alias set myminio http://minio:9000/ minio minio123
/usr/bin/mc mb myminio/docker
/usr/bin/mc anonymous set public myminio/docker
  1. Exit the container:
exit
  1. Run the backup command:
docker-compose exec scylla-manager sctool backup -c test_university --location s3:docker

Now it completes successfully:

$ docker-compose exec scylla-manager sctool backup -c test_university --location s3:docker
backup/1fbda45e-70e0-482f-a565-23e7a35b9d04
$ docker-compose exec scylla-manager sctool task list
Cluster: test_university (d9872a62-3cf4-47c7-adfc-92cbf3a2c6a1)
+-------------------------------------------------------------+--------------+-------------------------------+--------+
| Task                                                        | Arguments    | Next run                      | Status |
+-------------------------------------------------------------+--------------+-------------------------------+--------+
| healthcheck/ba279f5d-1b68-45f5-a119-197c732e65cc            |              | 23 Jan 24 19:44:05 UTC (+15s) | DONE   |
| healthcheck_alternator/a4d81068-1eeb-4648-824d-6556315d32e7 |              | 23 Jan 24 19:44:05 UTC (+15s) | DONE   |
| healthcheck_rest/b7e840db-3b01-4318-85cd-1d4d6e37cc58       |              | 23 Jan 24 19:44:35 UTC (+1m)  | DONE   |
| repair/ea793a56-21d6-4335-a4fb-366903fcc771                 |              | 24 Jan 24 00:00:00 UTC (+7d)  | NEW    |
| backup/1fbda45e-70e0-482f-a565-23e7a35b9d04                 | -L s3:docker |                               | DONE   |
+-------------------------------------------------------------+--------------+-------------------------------+--------+

This fix could be improved by changing the Docker configuration to run the mc commands, as described in this Stack Overflow post.

@GeoffMontee
Copy link
Author

CC: @erezvelan, @guy9

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

No branches or pull requests

3 participants