How do I find out what the error is when I get an html response which includes An error occurred and I get a 404 in the trace UI?

Not applicable

I've been tinkering with the java-cookbook sample code to include a second url (/policies as well as the /forecastrss which is originally in the default.xml). I get a successful deployment via the deploy.sh script:

Environment: sandbox

Revision: 26

BasePath = /

State: deployed

If 'State: deployed', then your API Proxy is ready to be invoked. Run 'invoke.sh'

but when I try to hit the urls using either invoke.sh or just straight curl http://., I get a response of html with the following body:

<body> <h1>An error occurred.</h1> <p>Sorry, the page you are looking for is currently unavailable.<br/> Please try again later.</p>

When I use the UI Trace console I get a 404 and I don't see any more information. How do I determine what the problem is?

1 7 1,509
7 REPLIES 7

Within the Trace page, you can click the "next" and "prev" buttons to move to the next and previous steps in the request processing. This should show you the input & output for each successive logical step.

If your proxy connects to a remote backend (seems like it does), you can navigate to the actual request that gets proxied to that external backend, and you can see the response returned from the backend.

It's quite possible that the request being sent to the backend isn't what you'd hoped. In fact this is the most common kind of problem that I've seen, when receiving a 404 from the backend. A really common case is that the path for the inbound request is appended to the outbound (proxied) request. So that if your target URL is "http://foo.bar/bam" and your input request is "http://api-vhost/basepath/something" (where /basepath represents the base path of the proxy endpoint), then the resulting call sent to the backend will be "http://foo.bar/bam/something" .

This is sometimes surprising to people.

If you don't want this, then... you need to include an AssignMessage policy to set the context variable "target.copy.pathsuffix" to false. like so:

<AssignMessage name='AM-NoCopyPath'>
  <AssignVariable>
    <Name>target.copy.pathsuffix</Name>
    <Value>false</Value>
  </AssignVariable>
</AssignMessage>

But I'm just guessing that this might be the problem. You'll be able to see it better by clicking around in that Trace UI.

I don't see Prev and Next buttons in the Trace console (I'm new to apigee and maybe I just don't see them). I'm thinking that it can't find /forecastrss...? This is what I see, with no further information:

2726-trace-console-404.png

When I deploy any of java-cookbook, javascript-cookbook, or javascript-mashup-cookbook out of the box I get the same result: 404. This is new. Previously I could deploy them out-of-box and use the invoke script and at least get something back. I modified the java-cookbook target from the out-of-box yahoo weather api to some wiki api which is good (responds in curl, and in browser), but still get the 404. How do I deal with this? Is there some problem with the costco sandbox env at costco-sandbox.apigee.net ?

Not applicable

Surprise Surprise...suddenly the costco sandbox deployments are responding. Thanks.

oh! Well I'm glad to hear it's working now. That's unexpected. We expect your sandbox environment to just work.

By the way, Pete, re: the "Previous" and "Next" buttons I described, the correct labels are "Back" and "Next". This 2-minute screencast shows their operation.

Thanks. Once I started getting a 200 response, then the trace UI filled up with stuff and the Back and Next buttons showed up. I didn't do anything, I just re-tried the Trace UI. Seems like the apigee sandbox stuff was in some sort of broken state: I could deploy to it "successfully", and was able to see the deployment in the Overview UI, but only got 404s via either curl or the Trace UI. Someone must've realized it and bounced it or fixed it. It happens.