Open VasTShadowZz opened 6 years ago
I am having the same issue:
2018-01-11 22:41:57.930 INFO 9876 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http) 2018-01-11 22:41:57.935 INFO 9876 --- [ main] i.g.unterstein.BinanceBotApplication : Started BinanceBotApplication in 4.983 seconds (JVM running for 8.174) 2018-01-11 22:41:58.609 ERROR 9876 --- [pool-1-thread-1] io.github.unterstein.BinanceTrader : Unable to perform ticker
com.binance.api.client.exception.BinanceApiException: Timestamp for this request was 1000ms ahead of the server's time. at com.binance.api.client.impl.BinanceApiServiceGenerator.executeSync(BinanceApiServiceGenerator.java:57) ~[binance-api-client-1.0.0.jar:na] at com.binance.api.client.impl.BinanceApiRestClientImpl.getAccount(BinanceApiRestClientImpl.java:145) ~[binance-api-client-1.0.0.jar:na] at com.binance.api.client.impl.BinanceApiRestClientImpl.getAccount(BinanceApiRestClientImpl.java:150) ~[binance-api-client-1.0.0.jar:na] at io.github.unterstein.TradingClient.getTradingBalance(TradingClient.java:48) ~[classes/:na] at io.github.unterstein.BinanceTrader.tick(BinanceTrader.java:42) ~[classes/:na] at io.github.unterstein.BinanceBotApplication.schedule(BinanceBotApplication.java:57) [classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_151] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151] at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65) [spring-context-4.3.5.RELEASE.jar:4.3.5.RELEASE] at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-4.3.5.RELEASE.jar:4.3.5.RELEASE] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_151] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_151] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_151] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_151] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_151] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_151] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151]
Wow okay, figured it out. My computer's clock must have been slightly out of sync. I made it sync to global time and that fixed it right up.
Any fix for docker?
2018-01-11 12:19:03.155 INFO 16 --- [pool-1-thread-1] io.github.unterstein.BinanceTrader : Buy detected
2018-01-11 12:19:03.155 INFO 16 --- [pool-1-thread-1] io.github.unterstein.TradingClient : Buying 60 for 0.02026001
2018-01-11 12:19:03.533 ERROR 16 --- [pool-1-thread-1] io.github.unterstein.BinanceTrader : Unable to perform ticker
com.binance.api.client.exception.BinanceApiException: Timestamp for this request was 1000ms ahead of the server's time.
at com.binance.api.client.impl.BinanceApiServiceGenerator.executeSync(BinanceApiServiceGenerator.java:57) ~[binance-api-client-1.0.0.jar!/:na]
at com.binance.api.client.impl.BinanceApiRestClientImpl.newOrder(BinanceApiRestClientImpl.java:103) ~[binance-api-client-1.0.0.jar!/:na]
at io.github.unterstein.TradingClient.buy(TradingClient.java:66) ~[classes!/:0.0.1-SNAPSHOT]
Fix your computer's clock. Make sure it is synced to a time server properly.
To anyone having this issue...
Control Panel Time & Date Internet Time Change Settings Check Synchronize with an Internet time server Type pool.ntp.org into the server Update Now Your Welcome c:
For anyone who are getting these errors even after the windows / Linux time is synced with internet time, the fix is available. The problem is in binance-java-api and not in binance-trader
Looks like master is not yet synced, but the fix is available in the PR - https://github.com/binance-exchange/binance-java-api/pull/11
I had same problem and it went away after syncing the files as in that PR. Good luck changing it locally - or wait for the fix to be merged to master!
` :: Spring Boot :: (v1.4.3.RELEASE)
2018-01-10 22:41:31.198 INFO 8112 --- [ main] i.g.unterstein.BinanceBotApplication : Starting BinanceBotApplication on ShadowZ-PC with PID 8112 (C:\Windows\System32\binance-trader\target\classes started by theep in C:\Windows\System32\binance-trader) 2018-01-10 22:41:31.201 INFO 8112 --- [ main] i.g.unterstein.BinanceBotApplication : No active profile set, falling back to default profiles: default 2018-01-10 22:41:31.248 INFO 8112 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@76817f45: startup date [Wed Jan 10 22:41:31 GMT-05:00 2018]; root of context hierarchy 2018-01-10 22:41:32.332 INFO 8112 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http) 2018-01-10 22:41:32.346 INFO 8112 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat 2018-01-10 22:41:32.349 INFO 8112 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.6 2018-01-10 22:41:32.427 INFO 8112 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2018-01-10 22:41:32.427 INFO 8112 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1183 ms 2018-01-10 22:41:32.523 INFO 8112 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/] 2018-01-10 22:41:32.526 INFO 8112 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/] 2018-01-10 22:41:32.526 INFO 8112 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/] 2018-01-10 22:41:32.527 INFO 8112 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/] 2018-01-10 22:41:32.527 INFO 8112 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/] 2018-01-10 22:41:32.557 INFO 8112 --- [ main] i.g.unterstein.BinanceBotApplication : Starting app with diff=0.00000001, profit=1.30000000 amount=150 base=ETH trade=XVG 2018-01-10 22:41:34.207 INFO 8112 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@76817f45: startup date [Wed Jan 10 22:41:31 GMT-05:00 2018]; root of context hierarchy 2018-01-10 22:41:34.266 INFO 8112 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/]}" onto public java.util.List io.github.unterstein.BinanceBotApplication.getBalances()
2018-01-10 22:41:34.269 INFO 8112 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-01-10 22:41:34.270 INFO 8112 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-01-10 22:41:34.288 INFO 8112 --- [ main] o.s.w.s.h.BeanNameUrlHandlerMapping : Root mapping to handler '/'
2018-01-10 22:41:34.297 INFO 8112 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-01-10 22:41:34.301 INFO 8112 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-01-10 22:41:34.335 INFO 8112 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-01-10 22:41:34.447 INFO 8112 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-01-10 22:41:34.459 INFO 8112 --- [ main] s.a.ScheduledAnnotationBeanPostProcessor : No TaskScheduler/ScheduledExecutorService bean found for scheduled processing
2018-01-10 22:41:34.508 INFO 8112 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2018-01-10 22:41:34.514 INFO 8112 --- [ main] i.g.unterstein.BinanceBotApplication : Started BinanceBotApplication in 3.631 seconds (JVM running for 5.788)
2018-01-10 22:41:35.301 ERROR 8112 --- [pool-1-thread-1] io.github.unterstein.BinanceTrader : Unable to perform ticker
com.binance.api.client.exception.BinanceApiException: Timestamp for this request was 1000ms ahead of the server's time. at com.binance.api.client.impl.BinanceApiServiceGenerator.executeSync(BinanceApiServiceGenerator.java:57) ~[binance-api-client-1.0.0.jar:na] at com.binance.api.client.impl.BinanceApiRestClientImpl.getAccount(BinanceApiRestClientImpl.java:145) ~[binance-api-client-1.0.0.jar:na] at com.binance.api.client.impl.BinanceApiRestClientImpl.getAccount(BinanceApiRestClientImpl.java:150) ~[binance-api-client-1.0.0.jar:na] at io.github.unterstein.TradingClient.getTradingBalance(TradingClient.java:48) ~[classes/:na] at io.github.unterstein.BinanceTrader.tick(BinanceTrader.java:42) ~[classes/:na] at io.github.unterstein.BinanceBotApplication.schedule(BinanceBotApplication.java:57) [classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_151] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151] at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65) [spring-context-4.3.5.RELEASE.jar:4.3.5.RELEASE] at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-4.3.5.RELEASE.jar:4.3.5.RELEASE] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_151] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_151] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_151] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_151] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_151] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_151] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151]`