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

How to debug a 409 from the TRE CLI? #4080

Open
TonyWildish-BH opened this issue Aug 29, 2024 · 10 comments
Open

How to debug a 409 from the TRE CLI? #4080

TonyWildish-BH opened this issue Aug 29, 2024 · 10 comments
Labels
bug Something isn't working feature

Comments

@TonyWildish-BH
Copy link
Contributor

I'm trying to automate creating some shared services etc with the CLI, and getting a 409 return code with no error message. How can I debug this and find out what the problem is?

Steps to reproduce

My specific example is a certificate service for Nexus. I have a JSON file, as follows:

{
  "templateName": "tre-shared-service-certs",
  "properties": {
    "display_name": "nexus-ssl certificate service",
    "description": "automated deployment",
    "cert_name": "nexus-ssl",
    "domain_prefix": "nexus"
  }
}

I run the CLI:

tre shared-services new --definition-file my-definition.json

and I get this response:

Creating shared_service...
{
  "status_code": 409,
  "body": ""
}

what can I do to debug this?

This is using the latest version of the CLI, installed just a few minutes ago.

N.B. Other commands work fine, creating workspaces etc, so my basic installation is good and I'm logged in to the TRE.

@TonyWildish-BH TonyWildish-BH added the bug Something isn't working label Aug 29, 2024
@tim-p-allen
Copy link
Collaborator

Hey @TonyWildish-BH a 409 error for that command is version exists

raise HTTPException(status_code=status.HTTP_409_CONFLICT, detail=strings.SHARED_SERVICE_TEMPLATE_VERSION_EXISTS)

Agreed logging could be better.
Also doesnt look like you have enough fields in your json file

@TonyWildish-BH
Copy link
Contributor Author

hi @tim-allen-ck. I'm not trying to register a shared service, I'm trying to deploy one from an existing template.

Can you tell me what fields are missing? I'm trawling the code to find out what should be in there.

@tim-p-allen
Copy link
Collaborator

My mistake. This line then:

logger.exception("Shared service already exists")
raise HTTPException(status_code=status.HTTP_409_CONFLICT, detail=str(e))

template_schema.json

{
  "$schema": "http://json-schema.org/draft-07/schema",
  "$id": "./templates/shared_services/service_name/template_schema.json",
  "type": "object",
  "title": "New Shared Service",
  "description": "A shared service",
  "properties": {},
  "required": []
}

@TonyWildish-BH
Copy link
Contributor Author

For the cert service I see

  "required": [
    "domain_prefix",
    "cert_name"
  ],

and I have both those, so that should be OK. Any idea what else could be causing my 409?

@marrobi
Copy link
Member

marrobi commented Sep 2, 2024

Are you trying to deploy multiple instances of the same shared service? Shared services are limited to one instance.

See #3997 and #2820 as a potential resolution.

@TonyWildish-BH
Copy link
Contributor Author

No, I'm deploying into an empty TRE, there's no other CERT service anywhere.

@marrobi
Copy link
Member

marrobi commented Sep 2, 2024

Definitely nothing in the Cosmos DB? You will have to look at the API logs to get more details https://microsoft.github.io/AzureTRE/v0.19.0/troubleshooting-faq/app-insights-logs/

@TonyWildish-BH
Copy link
Contributor Author

this was with a virgin TRE, I deployed from scratch (with a new TRE_ID) explicitly to have a clean environment.

@marrobi
Copy link
Member

marrobi commented Sep 2, 2024

Can you see anything in the logs?

@TonyWildish-BH
Copy link
Contributor Author

no, nothing in the logs...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature
Projects
None yet
Development

No branches or pull requests

3 participants