ryancraigdavis / WCL_DK_Analyzer

Cataclysm Classic version of the WCL Analyzer for Death Knights
MIT License
0 stars 0 forks source link

Assertion error #5

Closed Gapearz closed 16 hours ago

Gapearz commented 1 month ago

Weird insertion error that happens on the following log, only on the player Jurlez Log link

Backend server output:

ERROR:root:
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.10/site-packages/anyio/streams/memory.py", line 94, in receive
    return self.receive_nowait()
  File "/home/user/.local/lib/python3.10/site-packages/anyio/streams/memory.py", line 89, in receive_nowait
    raise WouldBlock
anyio.WouldBlock

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/base.py", line 77, in call_next
    message = await recv_stream.receive()
  File "/home/user/.local/lib/python3.10/site-packages/anyio/streams/memory.py", line 114, in receive
    raise EndOfStream
anyio.EndOfStream

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/mnt/c/Users/user/Documents/WCL_DK_Analyzer/backend/src/api.py", line 28, in catch_exceptions_middleware
    return await call_next(request)
  File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/base.py", line 80, in call_next
    raise app_exc
  File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/base.py", line 69, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/home/user/.local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/home/user/.local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/home/user/.local/lib/python3.10/site-packages/starlette/routing.py", line 706, in __call__
    await route.handle(scope, receive, send)
  File "/home/user/.local/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/home/user/.local/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/home/user/.local/lib/python3.10/site-packages/fastapi/routing.py", line 235, in app
    raw_response = await run_endpoint_function(
  File "/home/user/.local/lib/python3.10/site-packages/fastapi/routing.py", line 161, in run_endpoint_function
    return await dependant.call(**values)
  File "/mnt/c/Users/user/Documents/WCL_DK_Analyzer/backend/src/api.py", line 68, in analyze_fight
    events = analyze(report, fight_id)
  File "/mnt/c/Users/user/Documents/WCL_DK_Analyzer/backend/src/analysis/analyze.py", line 290, in analyze
    return analyzer.analyze()
  File "/mnt/c/Users/user/Documents/WCL_DK_Analyzer/backend/src/analysis/analyze.py", line 268, in analyze
    analysis.update(**analyzer.report())
  File "/mnt/c/Users/user/Documents/WCL_DK_Analyzer/backend/src/analysis/unholy_analysis.py", line 536, in report
    "score": self.score(),
  File "/mnt/c/Users/user/Documents/WCL_DK_Analyzer/backend/src/analysis/unholy_analysis.py", line 526, in score
    window_score = sum(window.score() for window in self.windows)
  File "/mnt/c/Users/user/Documents/WCL_DK_Analyzer/backend/src/analysis/unholy_analysis.py", line 526, in <genexpr>
    window_score = sum(window.score() for window in self.windows)
  File "/mnt/c/Users/user/Documents/WCL_DK_Analyzer/backend/src/analysis/unholy_analysis.py", line 477, in score
    ScoreWeight(self.num_casts / 18, 4),
  File "/mnt/c/Users/user/Documents/WCL_DK_Analyzer/backend/src/analysis/base.py", line 38, in __init__
    assert 0 <= score <= 1
AssertionError
INFO:     127.0.0.1:49348 - "GET /analyze_fight?source_id=9&fight_id=16&report_id=3xz4cfQnYvBTJGXA HTTP/1.1" 500 Internal Server Error
ryancraigdavis commented 1 month ago

I identified what the error is, there's an assertion that fails if Garg casts are above 18 (as that is supposed to be the maximum. Apparently something is wrong with the event logging, I'll take a look at it. See here: Screenshot_20240615_173352 Screenshot_20240615_173421

ryancraigdavis commented 16 hours ago

Fixed in a recent commit