spring-cloud-gateway icon indicating copy to clipboard operation
spring-cloud-gateway copied to clipboard

Not able to access service URL

Open tirtha2u opened this issue 1 year ago • 2 comments

Describe the bug We are using spring cloud mvc 4.1.5. Its working perfectly fine while accessing an external URL. But its returning 500 when accessing service URL

Sample Below is the spring cloud mvc configuration:

spring.cloud.gateway.mvc.routesMap.fcc-xyz.predicates=Path=/api/fcc/xyz/** spring.cloud.gateway.mvc.routesMap.fcc-xyz.uri=${fcc.xyz.application.url} spring.cloud.gateway.mvc.routesMap.fcc-xyz.filters[0].name=RewritePath spring.cloud.gateway.mvc.routesMap.fcc-xyz.filters[0].args[regexp]=/api/fcc/xyz/?(?.*) spring.cloud.gateway.mvc.routesMap.fcc-xyz.filters[0].args[replacement]=/api/${segment}

working fine when ${fcc.xyz.application.url} = http://fcc.var.tbe.tbc.tvg.com

but returns 500 when ${fcc.xyz.application.url} = http://fcc.default.svc.cluster.local

tirtha2u avatar Sep 05 '24 15:09 tirtha2u

I don't see how this can have anything to do with gateway specifically. Is there an error or stack trace on the downstream service or gateway?

spencergibb avatar Sep 05 '24 15:09 spencergibb

we are not getting any exception in the log. Below is output from access.log. Could you please help with the steps to print the response body in log.

{"@timestamp":"2024-09-05T14:45:27.521Z","logType":"accessLog","IP":"34.149.131.218","TR":"05/Sep/2024:14:45:27 +0000","RT":"143","TID":"http-nio-8080-exec-1","MT":"GET","URI":"/api/catalog/v2/products","QS":"?siteName=BCOM&filter=PURCHASABLE","HV":"HTTP/1.0","RC":"200","RS":"2942","REF":" https://biz-controls-engine.xyz.com/fcc/products","UA":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36","RID":"-","CID":"DiscoveryIndexer","TCIP":"-","AKIP":"-","X_B3_TRACE_ID":"-","Accept":"application/json, text/plain, /","CT":"application/json","x-macys-device":"-","x-bloomingdales-device":"-"}

tirtha2u avatar Sep 06 '24 08:09 tirtha2u

Set the following properties

spring.cloud.gateway.httpclient.wiretap=true
spring.cloud.gateway.httpserver.wiretap=true
logging.level.reactor.netty=TRACE

spencergibb avatar Jan 24 '25 00:01 spencergibb

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-cloud-issues avatar Jan 31 '25 00:01 spring-cloud-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

spring-cloud-issues avatar Feb 07 '25 00:02 spring-cloud-issues