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

sub add fails if the subscription already exists #15

Open
Iain-S opened this issue Apr 2, 2024 · 1 comment
Open

sub add fails if the subscription already exists #15

Iain-S opened this issue Apr 2, 2024 · 1 comment
Labels
good first issue Good for newcomers

Comments

@Iain-S
Copy link
Contributor

Iain-S commented Apr 2, 2024

to recreate

  • make a new subscription on Azure at 59 minutes past the hour
  • run rctab sub add ... 2 minutes later
  • you will get an error message
    Failed with status code: 409. Details: {'message': 'One of the records already exists. Details: Key (subscription_id)=(123-456-789-10112) already exists.'}
    
    

We will probably want to catch the "subscription exists" error here and ignore / log it:

https://github.com/alan-turing-institute/rctab-cli/blob/2062874a1f457d822b334d9259a9c4b02c6c9536/rctab_cli/sub_apps/sub.py#L237C1-L237C38

and then carry on with the persistence and allocation steps.

@joseph-palmer
Copy link
Contributor

When I ran sub add on an existing subscription, I got that error message but the approval was then processed correctly. Perhaps a different error message like 'Sub add failed as one of the records already exists. Continuing with approval and allocation' is warranted?

@Iain-S Iain-S added the good first issue Good for newcomers label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants