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

[policy] [callout-http] Calls are not reaching when no variable is defined #2383

Closed
GL-Gravitee2 opened this issue Jun 18, 2019 · 12 comments · Fixed by gravitee-io/gravitee-policy-callout-http#10

Comments

@GL-Gravitee2
Copy link

commented Jun 18, 2019

Below is the design i tried to set up.

/hmac/v1/validation call gets triggered, which has HTTP callout. If HTTP call out results in HTTP 200, call need to proceed and hits the endpoint.
HTTP callout is not being called out. ( no API calls)

HTTP callout [HmacValidate_keyManager_API ]

export.zip

/km/v1/validate is a Mock API, which just validates incoming query param and returns the response.
When I call HTTP callout APIs /km/v1/validate like /km/v1/validate?token=1C3BD5KT6DT007111 from browser it works as expected.

Attaching API exports for your reference.

@brasseld

This comment has been minimized.

Copy link
Member

commented Jun 18, 2019

Do you mean that the callout is never run ?

@GL-Gravitee2

This comment has been minimized.

Copy link
Author

commented Jun 18, 2019

Do you mean that the callout is never run ?

Yes , i dnt see HTTP callout being made.

@GL-Gravitee2

This comment has been minimized.

Copy link
Author

commented Jun 19, 2019

Hi David ,

Any suggestions to make this work?

@brasseld

This comment has been minimized.

Copy link
Member

commented Jun 19, 2019

Which version ?

@GL-Gravitee2

This comment has been minimized.

Copy link
Author

commented Jun 19, 2019

1.22.1

@brasseld

This comment has been minimized.

Copy link
Member

commented Jun 20, 2019

So, according to the documentation: https://docs.gravitee.io/apim_policies_callout_http.html

If no variable has been configured the result of the callout will not be available anymore.

This statement is very clear because the callout policy is not run if no variable is defined...

I suppose it makes sense to run the callout policy event if there is no variable defined because you're expecting no response content from the target endpoint?

@brasseld brasseld self-assigned this Jun 20, 2019
@brasseld brasseld changed the title HTTP Callout Policy - Calls are not reaching [policy] [callout-http] Calls are not reaching Jun 20, 2019
@GL-Gravitee2

This comment has been minimized.

Copy link
Author

commented Jun 20, 2019

Yes, am not expecting response body content but looking for HTTP response code.
Am using ,
"errorCondition": "{#calloutResponse.status >= 400 and #calloutResponse.status <= 599}",
isnt the calloutResponse variable here?

@brasseld

This comment has been minimized.

Copy link
Member

commented Jun 20, 2019

It is. But to run the policy you must have to define, at least, one variable.
If you do not, the http callout will not be done.

So, as a workaround, please set a dummy variable.

@brasseld

This comment has been minimized.

Copy link
Member

commented Jun 20, 2019

Is it ok for you with this workaround ?

@GL-Gravitee2

This comment has been minimized.

Copy link
Author

commented Jun 21, 2019

Hi David,

Yes workaround did help. I have one question here though. Where can i see callout related logs ( API request and response )?

@brasseld

This comment has been minimized.

Copy link
Member

commented Jun 24, 2019

Hi @GL-Gravitee2

You can't get callout related logs.

We have a "tracing" topic in the backlog, I'm sure that such logs should have their place in it.

@brasseld

This comment has been minimized.

Copy link
Member

commented Jun 24, 2019

I'm renaming the issue.

@brasseld brasseld changed the title [policy] [callout-http] Calls are not reaching [policy] [callout-http] Calls are not reaching when no variable is defined Jun 24, 2019
brasseld added a commit to gravitee-io/gravitee-policy-callout-http that referenced this issue Jul 18, 2019
@brasseld brasseld added this to the APIM - 1.29.0 milestone Jul 18, 2019
aelamrani added a commit to gravitee-io/gravitee-policy-callout-http that referenced this issue Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
API Management
Awaiting triage
3 participants
You can’t perform that action at this time.