odota / parser

Replay parse server generating JSON log events from Dota 2 replay files
MIT License
119 stars 52 forks source link

IOException: given stream does not seem to contain a valid replay #32

Closed dropnz closed 4 years ago

dropnz commented 4 years ago

i have error while trying to parse ANY replay:

java.io.IOException: given stream does not seem to contain a valid replay
    at skadistats.clarity.source.Source.readEngineType(Source.java:165)
    at skadistats.clarity.processor.runner.SimpleRunner.<init>(SimpleRunner.java:31)
    at opendota.Parse.<init>(Parse.java:177)
    at opendota.Main$MyHandler.handle(Main.java:27)
    at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
    at jdk.httpserver/sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:82)
    at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80)
    at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:692)
    at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
    at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:664)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:835)

steps to reproduce:

[dropnz@home]$ wget http://replay138.valve.net/570/5135152728_2083094372.dem.bz2
[dropnz@home]$ bunzip2 5135152728_2083094372.dem.bz2
[dropnz@home]$ curl localhost:5600 --data-binary 5135152728_2083094372.dem
howardchung commented 4 years ago

What version of Java are you running?

howardchung commented 4 years ago

Also if you can check the first 7 bytes of the file that would also be useful

dropnz commented 4 years ago

@howardchung

[dropnz@home]$ java --version
openjdk 12.0.2 2019-07-16
OpenJDK Runtime Environment (build 12.0.2+10)
OpenJDK 64-Bit Server VM (build 12.0.2+10, mixed mode)

[dropnz@home]$ hexdump -C 5135152728_2083094372.dem | head
00000000  50 42 44 45 4d 53 32 00  e9 7d b8 01 7e 7d b8 01  |PBDEMS2..}..~}..|
00000010  01 ff ff ff ff 0f 79 0a  08 50 42 44 45 4d 53 32  |......y..PBDEMS2|
00000020  00 10 2f 1a 2c 56 61 6c  76 65 20 44 6f 74 61 20  |../.,Valve Dota |
00000030  32 20 45 75 72 6f 70 65  20 53 65 72 76 65 72 20  |2 Europe Server |
00000040  28 73 72 63 64 73 31 31  36 2e 31 33 38 2e 32 32  |(srcds116.138.22|
00000050  29 22 0d 53 6f 75 72 63  65 54 56 20 44 65 6d 6f  |)".SourceTV Demo|
00000060  2a 05 73 74 61 72 74 32  1f 2f 6f 70 74 2f 73 72  |*.start2./opt/sr|
00000070  63 64 73 2f 64 6f 74 61  2f 64 6f 74 61 5f 76 33  |cds/dota/dota_v3|
00000080  38 36 38 2f 64 6f 74 61  38 02 40 01 48 01 52 00  |868/dota8.@.H.R.|
00000090  08 ff ff ff ff 0f 0f 1a  0d c4 02 82 b5 01 08 00  |................|
howardchung commented 4 years ago

I believe clarity only works with Java 8. Can you try with that JVM?

dropnz commented 4 years ago

@howardchung :(

[dropnz@home]$ /usr/lib/jvm/java-8-openjdk/bin/java -jar target/stats-0.1.0.jar
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.
java.io.IOException: given stream does not seem to contain a valid replay
    at skadistats.clarity.source.Source.readEngineType(Source.java:165)
    at skadistats.clarity.processor.runner.SimpleRunner.<init>(SimpleRunner.java:31)
    at opendota.Parse.<init>(Parse.java:177)
    at opendota.Main$MyHandler.handle(Main.java:27)
    at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)
    at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83)
    at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82)
    at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:675)
    at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)
    at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:647)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
howardchung commented 4 years ago

If you have docker set up, can you test with the docker image?

I'm not entirely sure what's going on here.

howardchung commented 4 years ago

Oh I might have seen this before, curl might expect some weird syntax when using a file path: curl localhost:5600 --data-binary "@C:\Program Files (x86)\Steam\steamapps\common\dota 2 beta\game\dota\replays\3495473381_1.dem"