twitter-archive / diffy

Find potential bugs in your services with Diffy
https://twitter.com/diffyproject
Apache License 2.0
3.83k stars 368 forks source link

proxy does not react to curl request #63

Closed ruudgrosmann closed 6 years ago

ruudgrosmann commented 6 years ago

I have installed diffy and succesfully ran the example in the example directory. Now I try to run it manually, but the diffy proxy does not forward a request to the candidate, primary and secondairy servers.

I have started three services, listening on localhost, ports 2345, 2346 and 2347. When I start the services by running curl, I get the expected json back from them. Then I start the diffy jar, when it is running, I do a curl request to the configured proxy port, but there is no output from the diffy jar run. It seems the requests are not noticed.

script: java -jar ./target/scala-2.11/diffy-server.jar \ -candidate=localhost:2347 \ -master.primary=localhost:2345 \ -master.secondary=localhost:2346 \ -service.protocol=http \ -serviceName=genereer \ -proxy.port=:31900 \ -admin.port=:8881 \ -http.port=:8888 \ -rootUrl='localhost:8888'

output from script: ruud@stretchSZ sh diff2.sh
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. I 1113 13:49:05.087 THREAD1: HttpMuxer[/admin/metrics.json] = com.twitter.finagle.stats.MetricsExporter() I 1113 13:49:05.126 THREAD1: HttpMuxer[/admin/per_host_metrics.json] = com.twitter.finagle.stats.HostMetricsExporter() I 1113 13:49:05.178 THREAD1: /admin => com.twitter.server.handler.SummaryHandler I 1113 13:49:05.179 THREAD1: /admin/server_info => com.twitter.finagle.Filter$$anon$2 I 1113 13:49:05.179 THREAD1: /admin/contention => com.twitter.finagle.Filter$$anon$2 I 1113 13:49:05.180 THREAD1: /admin/threads => com.twitter.server.handler.ThreadsHandler I 1113 13:49:05.181 THREAD1: /admin/threads.json => com.twitter.server.handler.ThreadsHandler I 1113 13:49:05.182 THREAD1: /admin/announcer => com.twitter.finagle.Filter$$anon$2 I 1113 13:49:05.183 THREAD1: /admin/dtab => com.twitter.finagle.Filter$$anon$2 I 1113 13:49:05.183 THREAD1: /admin/pprof/heap => com.twitter.server.handler.HeapResourceHandler I 1113 13:49:05.184 THREAD1: /admin/pprof/profile => com.twitter.server.handler.ProfileResourceHandler I 1113 13:49:05.184 THREAD1: /admin/pprof/contention => com.twitter.server.handler.ProfileResourceHandler I 1113 13:49:05.185 THREAD1: /admin/ping => com.twitter.server.handler.ReplyHandler I 1113 13:49:05.185 THREAD1: /admin/shutdown => com.twitter.server.handler.ShutdownHandler I 1113 13:49:05.185 THREAD1: /admin/tracing => com.twitter.server.handler.TracingHandler I 1113 13:49:05.186 THREAD1: /admin/events => com.twitter.server.handler.EventsHandler I 1113 13:49:05.186 THREAD1: /admin/logging => com.twitter.server.handler.LoggingHandler I 1113 13:49:05.187 THREAD1: /admin/metrics => com.twitter.server.handler.MetricQueryHandler I 1113 13:49:05.187 THREAD1: /admin/clients/ => com.twitter.server.handler.ClientRegistryHandler I 1113 13:49:05.187 THREAD1: /admin/servers/ => com.twitter.server.handler.ServerRegistryHandler I 1113 13:49:05.188 THREAD1: /admin/files/ => com.twitter.server.handler.ResourceHandler I 1113 13:49:05.188 THREAD1: /admin/registry.json => com.twitter.server.handler.RegistryHandler I 1113 13:49:05.189 THREAD1: Serving admin http on 0.0.0.0/0.0.0.0:8881 I 1113 13:49:05.212 THREAD1: Finagle version 6.28.0 (rev=de123b8f9d074c4e345ebd67e1a0e870bb921544) built at 20150827-162434 I 1113 13:49:05.890 THREAD1: networkaddress.cache.ttl is not set, DNS cache refresh turned off I 1113 13:49:06.209 THREAD1: Tracer: com.twitter.finagle.zipkin.thrift.SamplingTracer I 1113 13:49:06.515 THREAD1: zipkin-tracer resolved to Addr.Bound, current size=1 I 1113 13:49:06.516 THREAD1: candidate resolved to Addr.Bound, current size=2 I 1113 13:49:06.517 THREAD1: primary resolved to Addr.Bound, current size=2 I 1113 13:49:06.517 THREAD1: secondary resolved to Addr.Bound, current size=2 I 1113 13:49:06.625 THREAD1: Scheduling com.twitter.diffy.workflow.FunctionalReport at 2017-11-13 13:49:06 +0000

Commands: ruud@stretchSZ curl localhost:2347/generate
{"action":"genereer","counter":20,"timestamp":"2017-11-13 15:07:01 +0100"}% ruud@stretchSZ curl localhost:2346/generate
{"action":"generate","counter":9,"timestamp":"2017-11-13 15:07:08 +0100"}% ruud@stretchSZ curl localhost:2345/generate
{"action":"generate","counter":10,"timestamp":"2017-11-13 15:07:12 +0100"}% ruud@stretchSZ curl localhost:8880/generate
curl: (7) Failed to connect to localhost port 8880: Connection refused [1] 14586 exit 7 curl localhost:8880/generate ruud@stretchSZ curl localhost:31900/generate

I get no output from the last command and there is no output from the java command in diff2.sh.

What am I doing wrong?

thanks in advance, RUud

ruudgrosmann commented 6 years ago

it appears that the proxy DOES forward the request and the request is visible on port 8888. I expected the same kind of output from running the java command as the output from the docker-compose command in the example directory. I jumped a bit too early to conclusions.