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

An unknown operation doesn't give a helpful error message #36

Open
kennethmorton opened this issue May 11, 2022 · 4 comments
Open

An unknown operation doesn't give a helpful error message #36

kennethmorton opened this issue May 11, 2022 · 4 comments
Assignees

Comments

@kennethmorton
Copy link
Collaborator

Attempting to use a valid operation that has no valid operation provider currently results in a 500. We should check that all operations are valid and that we have operation providers for that operation.

@kennethmorton kennethmorton changed the title An unknown operations doesn't give a helpful error message An unknown operation doesn't give a helpful error message May 11, 2022
@cbizon
Copy link
Collaborator

cbizon commented May 11, 2022

I think that this is supposed to raise a 422 (at least that's what aragorn does)

@uhbrar
Copy link
Collaborator

uhbrar commented May 24, 2022

Just to clarify, is this for an unknown operation, or an operation without any operation providers? An invalid or unknown operation already raises a 422. The error is caused when we have no operation providers for a given operation, but the operation itself is valid.

@cbizon
Copy link
Collaborator

cbizon commented May 24, 2022

Does the workflow runner have an operations element in its openapi saying which operations it implements?

Assuming it does, then any incoming operation that's not in the list (valid or not) should return something in the 400 range b/c the user should know better than to send invalid or unimplemented ops.

@uhbrar
Copy link
Collaborator

uhbrar commented May 24, 2022

The workflow runner maintains a list of valid operations (as dictated by the operations schema from the operations and workflow repo and exposed at standards.ncats.io), but it doesn't report any operations in its openapi spec, at least not that I can see.

Even if it did, I don't think it would make sense to to even report something like "operations which have at least one valid service provider" reported in openapi since the /refresh endpoint can be used to reload all operations and operation providers, which would then necessitate a refresh of the openapi spec.

We do throw a 422 for an invalid operation, but since the workflow runner doesn't actually implement any operations and only acts a messenger to contact services that do provide services, I think it's reasonable that it isn't exposed at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants