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

Jira plugin fails to unmarshal errors from Jira API #38231

Closed
nklaassen opened this issue Feb 14, 2024 · 0 comments · Fixed by #39204
Closed

Jira plugin fails to unmarshal errors from Jira API #38231

nklaassen opened this issue Feb 14, 2024 · 0 comments · Fixed by #39204
Labels
access-requests bug teleport-plugin Tickets related to Teleport Plugins https://github.com/gravitational/teleport-plugins

Comments

@nklaassen
Copy link
Contributor

Expected behavior:
When the Jira API returns errors we should log them or return them to the user

Current behavior:
We get a log like this, which isn't helpful when trying to debug the issue:

"caller":"jira/app.go:270","component":"jira","error":"json: cannot unmarshal object into Go struct field ErrorResult.Errors of type []string","level":"error","message":"Failed to process request","plugin_name":"jira","plugin_type":"jira"

here we configure the client to unmarshal errors into an ErrorResult, defined here

type ErrorResult struct {
ErrorMessages []string `url:"errorMessages"`
Errors []string `url:"errors"`
}

ErrorResult.Errors there has type []string, but according to the schema from Jira it will be a JSON object. We should either fix the type of ErrorResult.Errors or just remove it and only use ErrorResult.ErrorMessages

Bug details:

  • Teleport version
    • The hosted Jira plugin has been included in the Teleport repo since 14.0.0 with this incorrect schema, it was probably wrong before that too
  • Recreation steps
    • Try to set up the hosted Jira plugin in a Cloud tenant
    • Make it return an error somehow, possibly by creating the Jira API token with the wrong permissions
  • Debug logs
@nklaassen nklaassen added bug teleport-plugin Tickets related to Teleport Plugins https://github.com/gravitational/teleport-plugins access-requests labels Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
access-requests bug teleport-plugin Tickets related to Teleport Plugins https://github.com/gravitational/teleport-plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant