mitre-attack / tram

Threat Report ATT&CK™ Mapping (TRAM) is a tool to aid analyst in mapping finished reports to ATT&CK.
Apache License 2.0
346 stars 66 forks source link

tram not loading to needs review - stuck in queue #77

Closed piewacket closed 3 years ago

piewacket commented 3 years ago

After entering a URL and title and clicking submit nothing else happens. All jobs remain in the queue.

PS C:\tram> py.exe .\tram.py C:\tram\tram.py:22: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead async def background_tasks(taxii_local='online', build=False, json_file=None): C:\tram\tram.py:46: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead async def init(host, port): INFO:root:Welcome to TRAM DEBUG:asyncio:Using proactor: IocpProactor INFO:root:[] Found punkt INFO:root:[] Found stopwords INFO:root:server starting: 0.0.0.0:9999 INFO:aiohttp.access:127.0.0.1 [07/Apr/2021:06:44:08 +0000] "GET / HTTP/1.1" 200 12053 "http://localhost:9999/?" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36" INFO:aiohttp.access:127.0.0.1 [07/Apr/2021:06:44:09 +0000] "GET /theme/images/favicon-blue-m.ico HTTP/1.1" 200 215 "http://localhost:9999/?" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36"

jecarr commented 3 years ago

As an update on this, I debugged the code to see what's happening. I experienced errors in the ML service class that weren't appearing in the console logs (I would only get them when I debugged in an IDE: I put a breakpoint on a line, when the breakpoint was hit I ran the line as a watch-expression and then saw the errors). The missing printed errors here are most likely an asyncio/background tasks thing.

I haven't fixed it for me yet but I came across positional-argument errors, missing 'awaits', KeyErrors and IndexErrors in ml_svc.py (the ML service class). It started with pickle.load(<models-pickle-file>) raising a ModuleNotFoundError where an sklearn module was missing: it must be me having different dependency versions. My fixes so far is that in rest_svc.py, I'm able to finish this line which I was initially unable to do. I'm going to continue debugging the rest of the process in which an article moves out of the queue.

It sounds like from #67, @timoliciouz got to analyse a few reports. This adds to my theory it's an environment thing where versions of dependencies need to be specific ones.

jecarr commented 3 years ago

*I haven't tested it but it looks like #52 is a fix :) My changes are in #61 if it helps too Edit - my fixes moved articles along out of the queue so either PR above tackles this issue (just in different ways)

MarkDavidson commented 3 years ago

Hello @piewacket and thank you for the bug report. TRAM has moved to https://github.com/center-for-threat-informed-defense/tram and this issue is no longer present in that repository so I am closing this issue. Thank you!