netbird icon indicating copy to clipboard operation
netbird copied to clipboard

Issue with postgres store

Open hurricanehrndz opened this issue 1 year ago • 3 comments

Describe the problem

A clear and concise description of what the problem is.

management/server/http/middleware/auth_middleware.go:88: Error when validating JWT claims: extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters;

Believe this related to a Postgres limit: https://klotzandrew.com/blog/postgres-passing-65535-parameter-limit/

To Reproduce

Unknown

Expected behavior

For 65535 limit not to be reached

Are you using NetBird Cloud?

No

NetBird version

0.27.10

hurricanehrndz avatar Jun 19 '24 02:06 hurricanehrndz

Hello @hurricanehrndz thanks for reporting the issue. To understand better what is causing the system to reach this limit. Can you share the following about your local setup and the issue?

  • is this happening with all users?
  • how many users and groups you have in the system?
  • Do you have JWT groups enabled and how many of them are there for the users with this error?

Happy to discuss the details on slack too.

mlsmaycon avatar Jun 19 '24 10:06 mlsmaycon

Hello @hurricanehrndz thanks for reporting the issue. To understand better what is causing the system to reach this limit. Can you share the following about your local setup and the issue?

  • is this happening with all users?

We only tested with two users

  • how many users and groups you have in the system?

maybe 20 - 50 groups, stress testing with about 2200 dummy accounts

  • Do you have JWT groups enabled and how many of them are there for the users with this error?

yes, each user would have at most 3 groups

Happy to discuss the details on slack too.

We tested this with another instance with less users and this error doesn't occur

hurricanehrndz avatar Jun 19 '24 13:06 hurricanehrndz

Some more logs

2024-06-19T01:56:16Z DEBG management/server/sql_store.go:188: took 273 ms to persist an account to the store
2024-06-19T01:56:16Z ERRO management/server/http/middleware/auth_middleware.go:88: Error when validating JWT claims: extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters; extended protocol limited to 65535 parameters
2024-06-19T01:56:16Z ERRO management/server/http/util/util.go:80: got a handler error: token invalid
2024-06-19T01:56:16Z ERRO management/server/telemetry/http_api_metrics.go:181: HTTP response 2515859429: GET /api/users status 401
2024-06-19T01:56:16Z DEBG management/server/telemetry/http_api_metrics.go:201: request GET /api/users took 520 ms and finished with status 401

hurricanehrndz avatar Jun 19 '24 14:06 hurricanehrndz