unkey icon indicating copy to clipboard operation
unkey copied to clipboard

Transaction in use error when creating role

Open Flo4604 opened this issue 1 year ago â€ĸ 11 comments

Preliminary Checks

  • [X] I have reviewed the documentation: https://unkey.com/docs

  • [X] I have searched for existing issues: https://github.com/unkeyed/unkey/issues

  • [X] This issue is not a question, general help request, or anything other than a bug report directly related to Unkey. Please ask questions in our Discord community: https://unkey.com/discord.

Reproduction / Replay Link (Optional)

No response

Issue Summary

I randomly got this error when creating a role

{"error":{"code":"INTERNAL_SERVER_ERROR","docs":"https://unkey.dev/docs/api-reference/errors/code/INTERNAL_SERVER_ERROR","message":"target: unkey.-.primary: vttablet: rpc error: code = Aborted desc = transaction 1727848515790095014: in use: for query (CallerID: kzr01kdt6cz27x485f8p)","requestId":"req_2xEK1qBBAYjecN8sMJr7fHbKuajZ"}

Steps to Reproduce

  1. Try to create a role via API Example code of what I did when creating the role:
roles := []string{"admin", "account"}
for _, role := range roles {
    _, err := s.unkey.Permissions.CreateRole(ctx, operations.CreateRoleRequestBody{
    	Name: role,
    })
    
    if err != nil {
    	log.Printf("Error creating role %s", err)
    }
}

Expected behavior

To not get an error

Other information

No response

Screenshots

No response

Version info

-

Flo4604 avatar Oct 05 '24 09:10 Flo4604

This is flaky, right? Not consistently reproducible?

chronark avatar Oct 05 '24 10:10 chronark

/award 150 points

chronark avatar Oct 05 '24 10:10 chronark

Awarding Flo4604: 150 points đŸ•šī¸ Well done! Check out your new contribution on oss.gg/Flo4604

oss-gg[bot] avatar Oct 05 '24 10:10 oss-gg[bot]

/assign

RajuGangitla avatar Oct 05 '24 10:10 RajuGangitla

Assigned to @RajuGangitla! Please open a draft PR linking this issue within 48h âš ī¸ If we can't detect a PR from you linking this issue in 48h, you'll be unassigned automatically đŸ•šī¸ Excited to have you ship this 🚀

oss-gg[bot] avatar Oct 05 '24 10:10 oss-gg[bot]

This is flaky, right? Not consistently reproducible?

yup, its randomly happening, ill try to find something how its 100% repro

Flo4604 avatar Oct 05 '24 11:10 Flo4604

That'd be great, we can award more points if you can reliably reproduce it, or at least get us closer to the root cause

chronark avatar Oct 05 '24 11:10 chronark

/assign

zacharyftw avatar Oct 06 '24 22:10 zacharyftw

Assigned to @KekmaTime! Please open a draft PR linking this issue within 48h âš ī¸ If we can't detect a PR from you linking this issue in 48h, you'll be unassigned automatically đŸ•šī¸ Excited to have you ship this 🚀

oss-gg[bot] avatar Oct 06 '24 22:10 oss-gg[bot]

@RajuGangitla, Just a little reminder: Please open a draft PR linking this issue within 12 hours. If we can't detect a PR in 12h, you will be unassigned automatically.

oss-gg[bot] avatar Oct 06 '24 22:10 oss-gg[bot]

/assign

Flo4604 avatar Oct 07 '24 20:10 Flo4604

This issue is already assigned to another person. Please find more issues here.

oss-gg[bot] avatar Oct 07 '24 20:10 oss-gg[bot]

/assign

Flo4604 avatar Oct 07 '24 20:10 Flo4604

Assigned to @Flo4604! Please open a draft PR linking this issue within 48h âš ī¸ If we can't detect a PR from you linking this issue in 48h, you'll be unassigned automatically đŸ•šī¸ Excited to have you ship this 🚀

oss-gg[bot] avatar Oct 07 '24 20:10 oss-gg[bot]

@KekmaTime, Just a little reminder: Please open a draft PR linking this issue within 12 hours. If we can't detect a PR in 12h, you will be unassigned automatically.

oss-gg[bot] avatar Oct 08 '24 10:10 oss-gg[bot]

@RajuGangitla, Just a little reminder: Please open a draft PR linking this issue within 12 hours. If we can't detect a PR in 12h, you will be unassigned automatically.

oss-gg[bot] avatar Oct 08 '24 22:10 oss-gg[bot]

@KekmaTime, Just a little reminder: Please open a draft PR linking this issue within 12 hours. If we can't detect a PR in 12h, you will be unassigned automatically.

oss-gg[bot] avatar Oct 10 '24 10:10 oss-gg[bot]

/assign

HimanshuGarg5480 avatar Oct 10 '24 12:10 HimanshuGarg5480

This issue is already assigned to another person. Please find more issues here.

oss-gg[bot] avatar Oct 10 '24 12:10 oss-gg[bot]

/assign

there is already a pr open for this

Flo4604 avatar Oct 10 '24 15:10 Flo4604