Error generting reports in python

I have tried a few modules that generate reports on both Autopsy 4.16 and 4.17 both they keep giving an error. An example is when I run the report located

The error seems to be when it is joining the basereportdir with the report file. Looking at the logs the error is as follows
File “C:\Users\emeu\AppData\Roaming\autopsy\python_modules\sample report\”, line 98, in generateReport
fileName = os.path.join(baseReportDir, self.getRelativeFilePath())
File “C:\Program Files\Autopsy-4.17.0\autopsy\modules\ext\jython-standalone-2.7.0.jar\Lib\”, line 96, in join
TypeError: object of type ‘’ has no len()

Another error that occurs is when I use Mark McKinnon’s SPAI HTML report module…

File “C:\Users\emeu\AppData\Roaming\autopsy\python_modules\SPAI_Model_Report_Module\”, line 343, in generateReport
UnboundLocalError: local variable ‘report_dir’ referenced before assignment

These errors doesn’t occur in versions 4.15 and earlier…

Any advice would be appreciated

Try this

Uncomment/uncomment the report_dir below when Autopsy 4.16 goes live.


report_dir = os.path.join(baseReportDir.getReportDirectoryPath(), “Report”)

report_dir = os.path.join(baseReportDir, “Report”)
self.log(Level.INFO, “Could not create base report dir”)

That is what I found for the error in the SPAI report. I just have not pushed up the fix to github yet. If you run it under 4.15 then it will work like it use to. If you are planing on switching between versions for some reason there is code you can put in to select code based on version number.

Thanks Mark

That worked perfectly