Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Eval version Javascript Policy debug

Hi
I am facing a strange issue with APIGee evaluation version in GCP.  When I add a Javascript policy in APIProxy the debug /trace function stops working. Can someone help me understand why it does not work or where I can find the logs. 

 

Even the simple javascript statement like the below one work in trial version at https://apigee.google.com/

print("Hello World");
context.setVariable("request.queryparam.a",10);

regards

Solved Solved
0 4 255
1 ACCEPTED SOLUTION

The biggest problem I see in the evaluation version is that the Debug function works once in a while. Is there any restrictions on using that. Many times the Debug just remains empty.

Yes, I feel your pain. It is possible to click the "start debug session" button before the API proxy is completely deployed. If you do that then there will be no debug session started. So you need to wait until the proxy is completely deployed before clicking that button. And you need to wait AFTER clicking the button, before sending requests. The team says you may have to wait 10-30 seconds. The experience you describe - "it works once in a while" - is a major hassle. I am asking the team to improve this.

I think the delay between the click of the button and when the thing is ready - might be the main cause of the behavior you're seeing. The javascript itself is not causing a problem. It's just a bug in the UI for Debug sessions.

To work around that problem, wait a little longer, until the proxy revision is completely deployed, before clicking the "start session" button. Then wait a little while (maybe 10-30 seconds) AFTER clicking the "start session" button, before trying to send in a request.

View solution in original post

4 REPLIES 4