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

Tutorial not working #25

Closed benjelloun23 closed 8 years ago

benjelloun23 commented 8 years ago

Hello,

I'm testing Diffy, but when i follow the tutorial it's seems Diffy not working.

  1. The server : java.lang.IllegalArgumentException: requirement failed: You must specify host and port
  2. I use Curl to call proxy and nothing happen on Diffy.

This is my configuration:

java -jar ./target/scala-2.11/diffy-server.jar \ -candidate='http://192.168.10.116:50753/tempo/version:9992' \ -master.primary='http://192.168.10.116:50752/tempo/version:9990' \ -master.secondary='http://192.168.10.116:50752/tempo/version:9991' \ -service.protocol='http' \ -serviceName='My-Service' \ -proxy.port=:31900 \ -admin.port=:31159 \ -http.port=:31149 \ -rootUrl='localhost:31149'

Then i call Curl : curl localhost:31900/192.168.10.116:50753/tempo/version curl localhost:31900/192.168.10.116:50752/tempo/version

Can some one help me please? Thank you,

camiloribeiro commented 8 years ago

This seems to be a duplicated issues. @benjelloun23 can you check if it is the same as https://github.com/twitter/diffy/issues/24 and close the issue 24 if so?

Nevertheless, it seems that you are curling wrong. It should be:

  $ curl localhost:31900/whathever/your/service/expects/here

Another thing I noticed in your configuration is the use of two different versions for primary and secondary. You should use the same version for both and the new version as candidate. This is needed to check if there is any noise (different data content between the same version for the same request).

if you want to check and example you can check it here: https://github.com/twitter/diffy/tree/master/example

benjelloun23 commented 8 years ago

Hello camiloribeiro, Thank you for your answer.

  1. for the CURL, the syntaxe that i'm using seems correct, otherwise can you send me a good exemple for curl?.
  2. for primary and secondary have same adresse, it's juste the port number who change "9990 & 9991". I don't know if this is the correct way because i see that on the tutorial bellow :

java -jar diffy-server.jar \ -candidate=localhost:9992 \ -master.primary=localhost:9990 \ -master.secondary=localhost:9991 \ -service.protocol=http \ -serviceName=My-Service \ -proxy.port=:31900 \ -admin.port=:31159 \ -http.port=:31149 \ -rootUrl='localhost:31149'

camiloribeiro commented 8 years ago

Hi,

The url you are using seems to be wrong:

http:// 192.168.10.116 : 50752 /tempo/version:9990' \ protocol service_host service_port path

As you see in the given url, it seems that the :9990 is not the port, but part of the path. If you believe it is the port, please check again. Check out this other example:

  command: java -jar ./target/scala-2.11/diffy-server.jar  
      -candidate='candidate:8080' 
      -master.primary='primary:8080' 
      -master.secondary='secondary:8080'
      -service.protocol='http' 
      -serviceName='Happy Service' 
      -proxy.port=:31900 
      -admin.port=:8881 
      -http.port=:8888 
      -rootUrl='localhost:8888'

As you can see, you should only provide the sever and port in the configuration. do not provide anything after the port (path of the url).

When you curl diffy you should use diffy url and the proxy port, followed by the path that your service uses, for example http://server-ip: 31900/create_user

Good luck with your tests.

benjelloun23 commented 8 years ago

Thank you again but i still bloked : This is my situation i need to see differences between two webservices: 1- 192.168.10.116 : 50752 /tempo/version 2- 192.168.10.116 : 50753 /tempo/version

Now when i run this configuration :

java -jar ./target/scala-2.11/diffy-server.jar \ -candidate='http://192.168.10.116:50753/tempo/version:8080' \ -master.primary='http://192.168.10.116:50752/tempo/version:8080' \ -master.secondary='http://192.168.10.116:50752/tempo/version:8080' \ -service.protocol='http' \ -serviceName='My-Service' \ -proxy.port=:31900 \ -admin.port=:8881 \ -http.port=:8888 \ -rootUrl='localhost:8888'

I have this error on server : 'java.lang.IllegalArgumentException: requirement failed: You must specify host and port' same error as last configuration.

For Curl is this correct : curl http://192.168.10.116:50752/tempo/version:31900 ?

camiloribeiro commented 8 years ago

Try: java -jar ./target/scala-2.11/diffy-server.jar \ -candidate='http://192.168.10.116:50753 -master.primary='http://192.168.10.116:50752 -master.secondary='http://192.168.10.116:50752 -service.protocol='http' \ -serviceName='My-Service' \ -proxy.port=:31900 \ -admin.port=:8881 \ -http.port=:8888 \ -rootUrl='localhost:8888'

And curl curl http://localhost:31900/tempo/version

camiloribeiro commented 8 years ago

@benjelloun23 is it solved? Any more support?

benjelloun23 commented 8 years ago

Hello camiloribeiro, it's not resolved yet. I was testing configuration but I have this error on server : 'java.lang.IllegalArgumentException: requirement failed: You must specify host and port'

And for curl error : Empty reply from server

camiloribeiro commented 8 years ago

sorry, just realize now that you are adding http also (not a problem, but better don't) and that I missed to add the quotes at the end.

Try again: java -jar ./target/scala-2.11/diffy-server.jar \ -candidate='192.168.10.116:50753' -master.primary='192.168.10.116:50752' -master.secondary='192.168.10.116:50752' -service.protocol='http' \ -serviceName='My-Service' \ -proxy.port=:31900 \ -admin.port=:8881 \ -http.port=:8888 \ -rootUrl='localhost:8888'

And curl curl http://localhost:31900/tempo/version

"Empty reply from server" is fine.

benjelloun23 commented 8 years ago

I already test it with quotes dont worry about that but still not working. When i copy the url : 192.168.10.116:50753/tempo/version on my browser i have some xml text. same as this url 192.168.10.116:50752/tempo/version. and if i do url : 192.168.10.116:50752 or 192.168.10.116/tempo/version i have error 404 on browser. so the urls working are : 1- 192.168.10.116:50753/tempo/version 2- 192.168.10.116:50752/tempo/version

benjelloun23 commented 8 years ago

Hello again, It's still not working. Is this have relation with Cygwin (Unix Emulator) ?

camiloribeiro commented 8 years ago

I have no idea if it has anything to do with the windows linux emulator, but I would use a proper linux installation or virtual machine to try it out.

I would also try using a different app. I am 100% sure there is no problems with the current version, since I ran it recently in linux and mac and we also have provided a docker image that runs it as well. If you want to run it from your windows you can also try the docker under the example folder.

I am sorry, but I am running out of ideas for your problem. Maybe someone from the diffy team could help you better: @puneetkhanduri ? Ideas?

benjelloun23 commented 8 years ago

It's not working with docker terminal either.

sukalpomitra commented 8 years ago

Hi I may be late and you may have already resolved it but I guess the example given by @camiloribeiro missed the trailing slashes

java -jar ./target/scala-2.11/diffy-server.jar \ -candidate='192.168.10.116:50753' \ -master.primary='192.168.10.116:50752' \ -master.secondary='192.168.10.116:50752' \ -service.protocol='http' \ -serviceName='My-Service' \ -proxy.port=:31900 \ -admin.port=:8881 \ -http.port=:8888 \ -rootUrl='localhost:8888'

Also as suggested by @camiloribeiro the empty response is as expected. You should look the repsonse from diffy at localhost:8888

Hope this helps

camiloribeiro commented 8 years ago

@benjelloun23 Can we close this issue? Thanks.

benjelloun23 commented 8 years ago

Yeh we can Le 28 juin 2016 20:06, "Camilo Ribeiro" notifications@github.com a écrit :

@benjelloun23 https://github.com/benjelloun23 Can we close this issue? Thanks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/twitter/diffy/issues/25#issuecomment-229132520, or mute the thread https://github.com/notifications/unsubscribe/AHGJTC6TtICliBu0Yzef_pM1NhjOcF60ks5qQWKZgaJpZM4GNGUJ .