Skip to content

Conversation

@allisonschiang
Copy link
Contributor

@allisonschiang allisonschiang commented Nov 7, 2025

Adding instructions on how to troubleshoot "request limit exceeded" err because lots of people ask for help w/ it

app/RDK logger:

before:
2025-11-12T15:59:14.028Z WARN rdk web/request_counter.go:146 Request limit exceeded for resource {"method":"/viam.robot.v1.RobotService/GetMachineStatus","resource":"viam.robot.v1.RobotService"}

after
2025-11-11T22:24:20.813Z WARN rdk web/request_counter.go:147 Request limit exceeded for method /viam.component.camera.v1.CameraService/GetImages on resource cam.viam.component.camera.v1.CameraService. See https://docs.viam.com/dev/tools/common-errors/#req-limit-exceeded for troubleshooting steps

SDK/CLI:

before:
2025-11-12T15:56:23.797Z ERROR client gosdk/gosdk.go:50 rpc error: code = ResourceExhausted desc = exceeded request limit 1 on resource base-1.viam.component.base.v1.BaseService

after:
2025-11-12T15:48:37.111Z ERROR client gosdk/gosdk.go:50 rpc error: code = ResourceExhausted desc = exceeded request limit 1 on resource base-1.viam.component.base.v1.BaseService, see https://docs.viam.com/dev/tools/common-errors/#req-limit-exceeded for troubleshooting steps

@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Nov 7, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Nov 11, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Nov 12, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Nov 12, 2025
@allisonschiang allisonschiang requested a review from a team November 12, 2025 21:44
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Nov 13, 2025
"go.viam.com/rdk/utils/ssync"
)

const reqLimitExceededURL = "https://docs.viam.com/dev/tools/common-errors/#req-limit-exceeded"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const reqLimitExceededURL = "https://docs.viam.com/dev/tools/common-errors/#req-limit-exceeded"
const reqLimitExceededURL = "https://docs.viam.com/dev/tools/common-errors/#exceeded-request-limit-on-resource"

That link's anchor seems off.

Copy link
Contributor Author

@allisonschiang allisonschiang Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a pr in the docs to shorten it with a custom id! Wanted to wait till the rdk's log is changed until I make it live

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah gotcha! Seems fine then.

test.That(t, status.Convert(err).Code(), test.ShouldEqual, codes.ResourceExhausted)
test.That(t, err.Error(), test.ShouldEndWith,
fmt.Sprintf("exceeded request limit 1 on resource %v", keyPrefix))
fmt.Sprintf("exceeded request limit 1 on resource %v, see https://docs.viam.com/dev/tools/common-errors/#req-limit-exceeded "+
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] Can use the variable here, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it was better practice to leave tests as a string? but can def change if you think its better to use a variable

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better practice to leave tests as a string?

As in, it's better practice to not use string-interpolation/formatting-directives in tests? I hadn't heard that before.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, will update, maybe hallucinated that!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another option is to use test.ShouldBeError and assert that the error is a RequestLimitExceededError

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Nov 14, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test This pull request is marked safe to test from a trusted zone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants