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

[DOC] Missing "ListObjects" permission in the S3 configuration doc #2489

Closed
chrisduong opened this issue May 18, 2023 · 18 comments · Fixed by #3164
Closed

[DOC] Missing "ListObjects" permission in the S3 configuration doc #2489

chrisduong opened this issue May 18, 2023 · 18 comments · Fixed by #3164
Assignees
Labels
keepalive Label to exempt Issues / PRs from stale workflow type/docs Improvements or additions to documentation

Comments

@chrisduong
Copy link

Describe the bug

When I deployed the Tempo with this S3 configuration doc https://grafana.com/docs/tempo/latest/configuration/s3/, I faced this error

{"caller": "main.go:105", "err": "failed to init module services error initialising module: usage-report: failed to initialize usage report: unexpected error from ListObjects on tempo-traces-foo: Access Denied","level":"error","msg":"error running Tempo","ts":"2023-05-18T10:09:09.908963824Z"}

Expected behavior

The S3 configuration doc should add s3:ListObjects action into the policy.

Environment:

  • Infrastructure: K8s
  • Deployment tool: Helm
  • Tempo version 2.1.1
@joe-elliott joe-elliott added the type/docs Improvements or additions to documentation label May 18, 2023
@joe-elliott
Copy link
Member

joe-elliott commented May 18, 2023

Thanks for the report!

cc @knylander-grafana

@absolutemikex
Copy link

absolutemikex commented May 19, 2023

I am running into this now - however, I added the ListObjects and ListObjectsV2 and I am using IRSA. Is there anything else I can check?

level=info ts=2023-05-19T18:22:40.23471841Z caller=main.go:215 msg="initialising OpenTracing tracer" level=info ts=2023-05-19T18:22:40.243715669Z caller=main.go:102 msg="Starting Tempo" version="(version=2.1.1, branch=HEAD, revision=4157d7620)" level=error ts=2023-05-19T18:22:40.396802855Z caller=main.go:105 msg="error running Tempo" err="failed to init module services error initialising module: store: failed to create store unexpected error from ListObjects on BUCKET: Access Denied"

@absolutemikex
Copy link

I am dumb - disregard. I remove my SA config accidentally from values. Appreciate all your hard work.

@Eve832
Copy link
Contributor

Eve832 commented May 30, 2023

Hi @knylander-grafana , can you please update the status of this ticket in your view in https://github.com/orgs/grafana/projects/69/

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had any activity in the past 60 days.
The next time this stale check runs, the stale label will be removed if there is new activity. The issue will be closed after 15 days if there is no new activity.
Please apply keepalive label to exempt this Issue.

@github-actions github-actions bot added the stale Used for stale issues / PRs label Jul 30, 2023
@joe-elliott joe-elliott added keepalive Label to exempt Issues / PRs from stale workflow and removed stale Used for stale issues / PRs labels Jul 31, 2023
@r65535
Copy link

r65535 commented Aug 29, 2023

We're seeing this issue using ceph's S3 object store. I've given the Access/Secret key permission to s3:* but still getting the above error: err="failed to init module services error initialising module: store: failed to create store unexpected error from ListObjects on BUCKET: Access Denied"

I've tried setting forcepathstyle: true and signature_v2: true but neither works 😭

@zalegrala
Copy link
Contributor

Double check the credentials @r65535 and perhaps test manually outside of Tempo to confirm.

@datsabk
Copy link

datsabk commented Sep 5, 2023

I am facing this issue as well - I am using S3 object storage, with s3:* permissions on the IAM role

@z0rc
Copy link

z0rc commented Sep 5, 2023

@datsabk if you updated to 2.2.2, most likely it's #2888.

@datsabk
Copy link

datsabk commented Sep 5, 2023

@z0rc Saved my day man! I had started to doubt myself !

Looks like a regression due to AWS SDK version upgrade. There's nothing much happening in the Tempo Code really.

@ekristen
Copy link
Contributor

This is still an issue, #2888 doesn't seem to fix anything.

@knylander-grafana
Copy link
Contributor

knylander-grafana commented Nov 21, 2023

I'm getting ready to update the S3 config docs to address some of this content. Here are some related S3 issues we'll take into consideration for updating the doc:

To update the docs, we're going to:

  • Review the S3 configuration and verify it works
  • Add ListObjects

Draft PR: #3164

@knylander-grafana knylander-grafana moved this from Next to In Progress in Tempo squad Nov 21, 2023
@knylander-grafana knylander-grafana changed the title Missing "ListObjects" permission in the S3 configuration doc [DOC] Missing "ListObjects" permission in the S3 configuration doc Nov 22, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Tempo squad Nov 22, 2023
@bouk
Copy link

bouk commented Nov 29, 2023

s3:ListObjects is not a valid permission, s3:ListBucket is the one needed for listing objects in a bucket

@sunrabbit123
Copy link

sunrabbit123 commented Nov 30, 2023

@joe-elliott

s3:ListObjects is not a valid permission, s3:ListBucket is the one needed for listing objects in a bucket

This issue is not closed, and we ask that you reopen it.

In fact, ListObjects does not exist.

image

aws said.

Actions – For each resource, Amazon S3 supports a set of operations. You identify resource operations that you will allow (or deny) by using action keywords.
For example, the s3:ListBucket permission allows the user to use the Amazon S3 GET Bucket (List Objects) operation. For more information about using Amazon S3 actions, see Amazon S3 actions. For a complete list of Amazon S3 actions, see Actions.


And I'm still getting the error that's attached to the issue.
Even though I gave S3 full permissions.

tempo_values.yaml

storage:
  trace:
    backend: s3
    s3:
      secret_key: secret
      access_key: key
      bucket: <bucket-name>
      endpoint: '<bucket-name>.s3.<region>.amazonaws.com'
      insecure: false
      region: <region>

I just excuted next command helm upgrade --values tempo_values.yaml --install tempo grafana/tempo-distributed -n <namespace>

@joe-elliott
Copy link
Member

joe-elliott commented Nov 30, 2023

Are you sure that s3:ListObjects isn't a valid action?

If I go to the permissions doc here: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html

Then click here:

image

It takes me to this list of s3 actions: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Operations.html

which includes ListObjects.

@bouk
Copy link

bouk commented Nov 30, 2023

Confusingly, the action and permissions have different names. If you look at https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html you'll see:

General purpose bucket permissions - To use this operation, you must have READ access to the bucket. You must have permission to perform the s3:ListBucket action.

@joe-elliott
Copy link
Member

Ah, thank you 🙏.

I'm going to leave this issue closed since it specifically discusses adding "ListObjects" to the docs. If you are having issues getting auth configured to work with S3 please update to 2.3.1 (we've made some fixes) and open an issue if things are still not working.

@stefanandres
Copy link

stefanandres commented May 16, 2024

For what it's worth, I encountered the same error, but it turns out my aws_iam_policy_document was wrong.

The actual error message was from a pod with the same kubernetes serviceAccount:

bash-4.2# aws s3 ls s3://$bucket

An error occurred (AccessDenied) when calling the AssumeRoleWithWebIdentity operation: Not authorized to perform sts:AssumeRoleWithWebIdentity

After fixing the aws_iam_policy_document tempo spawned correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keepalive Label to exempt Issues / PRs from stale workflow type/docs Improvements or additions to documentation
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.