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

Bucket not found error #169

Closed
utsavbatra5 opened this issue May 4, 2021 · 6 comments · Fixed by #171
Closed

Bucket not found error #169

utsavbatra5 opened this issue May 4, 2021 · 6 comments · Fixed by #171
Assignees

Comments

@utsavbatra5
Copy link
Contributor

Hi, While posting hook from tr1d1um to argus v0.3.13, we are getting bucket not found error. It works fine on v0.3.11. Can you please advise why it is happening?

@joe94 joe94 self-assigned this May 4, 2021
@joe94
Copy link
Member

joe94 commented May 4, 2021

@utsavbatra5, was this the latest version of Tr1d1um?

@utsavbatra5
Copy link
Contributor Author

@joe94 Its v0.5.5 for Tr1d1um.

@Sachin4403
Copy link
Contributor

Hi @joe94

The issue is only with inmem DB as of now.

Here is the issue

i.lock.RLock()
defer i.lock.RUnlock()
if _, ok := i.data[key.Bucket]; !ok {
err = store.ErrBucketNotFound

Here we are returning an error (Bucket not found) and here it is not handled.

argus/store/endpoint.go

Lines 80 to 89 in d54494d

setItemRequest := request.(*setItemRequest)
itemResponse, err := s.Get(setItemRequest.key)
if err != nil {
if errors.Is(err, ErrItemNotFound) {
err = s.Push(setItemRequest.key, setItemRequest.item)
if err != nil {
return nil, err
}
return &setItemResponse{}, nil

Fix of this issue will be either remove bucket check from inmem DB or code changes in endpooint.go like below.

	if errors.Is(err, ErrItemNotFound) || errors.Is(err, ErrBucketNotFound) 

@joe94
Copy link
Member

joe94 commented May 5, 2021

Ah, good catch 👍 I don't think the ErrBucketNotFound is a very helpful/actionable error TBH.
I'll remove it and keep the ErrItemNotFound only.

@Sachin4403
Copy link
Contributor

Do you want us to fix this in issue in otel PR which is opened today by Utsav or you will be fixing this in another PR?

@joe94
Copy link
Member

joe94 commented May 5, 2021

I'll fix it in its own PR 👍

@joe94 joe94 linked a pull request May 6, 2021 that will close this issue
@joe94 joe94 closed this as completed in #171 May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants