Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

The proxy server received an invalid response from an upstream server

chandrashekha12
Level 1
Level 1

Hi ,

I have a service deployed in AEM 6.1 which takes two params. i) fromDate ii) toDate. This services queries repository to find assets modified between fromDate & toDate , do some processing on data  and returns xml DOM object as response . I  have a JSP page where I am rendering response from this service in data table. If service response data (e.g 50 -200 assets ) then it works fine without any issue. However , if I have more no of data (>1000 assets)  and if takes more time to process that data  then I am getting 504 Error with following message  

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET <Request URL>

Reason: Error reading from remote server

 

 

I am not using any proxy server / Web Server .  I am hitting request directly to AEM host. 

Did anybody faced it before ? any pointers/help would be appreciated? 

1 Accepted Solution
Jörg_Hoh
Correct answer by
Employee
Employee

You definitly need to fix your code, so it can deal with 1000's of assets (at least). First you should check that your query uses an index at all. If that's still to slow, you should maybe create a dedicated index for that type of query.

Jörg

View solution in original post

3 Replies
kautuk_sahni
Community Manager
Community Manager

Hi

It really depends on how much data is returning....

Possible solutions, none of which are likely to make you happy:

    Increase timeout value of the proxy (Jitty Time out)
    Make your request to a different server (if there's another server with the same data)
    Make your request differently (if possible) such that you are requesting less data at a time
    Try again once the server is not having issues

~kautuk

Jitendra_S_Toma
Level 9
Level 9

Hi Chandrashekhar,

The java application takes too long to respond(maybe due start-up/jvm being cold) thus you get the proxy error. I could suggest to increase OSGI config jetty service connection timeout.

Also improve your code part. none of the request should take more than 1 min to complete it.

Regards,

Jitendra

Jörg_Hoh
Correct answer by
Employee
Employee

You definitly need to fix your code, so it can deal with 1000's of assets (at least). First you should check that your query uses an index at all. If that's still to slow, you should maybe create a dedicated index for that type of query.

Jörg

View solution in original post