Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ERROR] PDF Report Generation Error #208

Closed
TokenDev18 opened this issue Aug 4, 2016 · 26 comments
Closed

[ERROR] PDF Report Generation Error #208

TokenDev18 opened this issue Aug 4, 2016 · 26 comments

Comments

@TokenDev18
Copy link

I am receiving the following error when I try to download the pdf version of the report.

PDF Error:
[ERROR] PDF Report Generation Error (/MobSF/Mobile-Security-Framework-MobSF-0.9.2/StaticAnalyzer/views.py, LINE 148 "pdf = pisa.pisaDocument(StringIO( "{0}".format(html.encode('utf-8'))), result, encoding='utf-8')"): global name 'pisa' is not defined

Please assist me in fixing this error.

Thanks in advance for your help!

@ajinabraham
Copy link
Member

pip install -r requirements.txt && pip install html5lib==1.0b8should fix it

@aaoconno
Copy link

I confirm, ajinabraham commented on Aug 4, pip install html5lib==1.0b8, fixed the problem for me.

@VijaySokkala
Copy link

hi abraham,
Could you pls help me to come out from below issue
i.e I got error when i click on Download report link

"

Don't Play Around. An Error just popped in!

Inappropriate argument type.

init() got an unexpected keyword argument 'status_code'
"
above thing is an error

Thanks in advance

@ajinabraham
Copy link
Member

Use the latest master

@VijaySokkala
Copy link

{"pdf_error": "Cannot Generate PDF", "err_details": "wkhtmltopdf exited with non-zero code 127. error:\n/usr/bin/wkhtmltopdf: error while loading shared libraries: libQt5WebKitWidgets.so.5: cannot open shared object file: No such file or directory\n"}

I got thiserror after clone the updated code and clcik on the Download report link

@VijaySokkala
Copy link

I have download the wkhtmltopdf.tar.xz and extracted
extracted file consist 4 directories
wt is the next step

@VijaySokkala
Copy link

ie bin, include, lib and share

here there is no python files for install

Thanks in advance

Thanks
Vijay S

@ajinabraham
Copy link
Member

Read the installation instruction of wkhtmltopdf

@VijaySokkala
Copy link

Thank you abraham
An issue is resolved

@VijaySokkala
Copy link

I have copied bin folder files into /usr/bin/ folder of the system. Then ran the application and successfully generate the pdf report for the respective apk

1 similar comment
@VijaySokkala
Copy link

I have copied bin folder files into /usr/bin/ folder of the system. Then ran the application and successfully generate the pdf report for the respective apk

@pjadon-mn
Copy link

I am getting 'bool' object has no attribute 'dumps' exception when I click on Download Report in Mob SF Static Analyzer

The below is shown on console
[INFO] Fetching data from DB for PDF Report Generation (Android)

[INFO] Analysis is already Done. Fetching data from the DB...
INFO: Could not find files for the given pattern(s).
←[1m←[91m[ERROR] 'bool' object has no attribute 'dumps'←[0m
Internal Server Error: /PDF/

@ajinabraham
Copy link
Member

Please provide logs

@niklasgadau
Copy link

niklasgadau commented Nov 30, 2018

I have the same issue:
Here are my logs:

./logs/MobSF.log says: [2018-11-30 15:44:19] [ERROR] 'bool' object has no attribute 'dumps'

runserver log says:
OS: Linux Platform: Linux-4.15.0-29-generic-x86_64-with-Ubuntu-18.04-bionic Dist: ('Ubuntu', '18.04', 'bionic') [WARNING] Could not find VirtualBox path. [INFO] MobSF Basic Environment Check [INFO] Checking for Update. [INFO] No updates available. System check identified no issues (0 silenced).

complete log: https://pastebin.com/eZnRd3FS

@ajinabraham
Copy link
Member

Have you installed wkhtmltopdf?

@niklasgadau
Copy link

Yes, i did!
(venv) nga@nga:~/Documents/Mobile-Security-Framework-MobSF$ sudo apt-get install wkhtmltopdf
[sudo] password for nga:
Reading package lists... Done
Building dependency tree
Reading state information... Done
wkhtmltopdf is already the newest version (0.12.4-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

@niklasgadau
Copy link

Any other ideas to resolve this issue?

@ajinabraham
Copy link
Member

This error comes when wkhtmltopdf is not installed properly/available to MobSF.
Can you try this from terminal and see if it's working?

wkhtmltopdf http://google.com google.pdf

@pjadon-mn
Copy link

I tried this command from terminal, Below is the output:

C:\MobSF\Mobile-Security-Framework-MobSF-master\Mobile-Security-Framework-MobSF-master>wkhtmltopdf http://google.com google.pdf
Loading pages (1/6)
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done

@ajinabraham
Copy link
Member

Looks like wkhtmltopdf is working fine. Can you share the APK over email to investigate this further.

@pjadon-mn
Copy link

@ajinabraham, Now I am able to download report in Mob SF Static Analyzer, not sure how this got resolved.
But I have another issue now on Dynamic Analysis. I see the below exception

[INFO] VM Starting
[04/Dec/2018 12:40:23] "POST /DynamicAnalyzer/ HTTP/1.1" 200 32414
[04/Dec/2018 12:40:23] "GET /download/screen/screen.png HTTP/1.1" 302 0
[04/Dec/2018 12:40:24] "GET /error/ HTTP/1.1" 200 4750

[INFO] Setting up Dynamic Analysis Environment

[2018-12-04 13:49:47]
[ERROR] Setting up Dynamic Analysis Environment (C:\MobSF\Mobile-Security-Framework-MobSF-master\Mobile-Security-Framework-MobSF-master\DynamicAnalyzer\views\android\dynamic.py, LINE 155 "start_proxy(settings.PORT, package)"): [WinError 2] The system cannot find the file specified
[04/Dec/2018 13:49:47] "POST /GetEnv/ HTTP/1.1" 302 0
[04/Dec/2018 13:49:47] "GET /error/ HTTP/1.1" 200 4750

@ajinabraham
Copy link
Member

Do you have capfuzz in your venv?

@pjadon-mn
Copy link

pjadon-mn commented Dec 4, 2018

@ajinabraham

import subprocess
import capfuzz
subprocess.Popen(["capfuzz", "-m", "capture", "-p", "1337", "-n", "foo"])
Traceback (most recent call last):
File "", line 1, in
File "C:\Python36\lib\subprocess.py", line 707, in init
restore_signals, start_new_session)
File "C:\Python36\lib\subprocess.py", line 990, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

I did install capfuzz
pip install git+https://github.com/MobSF/CapFuzz.git

@bloodzer0
Copy link

I am getting 'bool' object has no attribute 'dumps' exception when I click on Download Report in Mob SF Static Analyzer

The below is shown on console
[INFO] Fetching data from DB for PDF Report Generation (Android)

[INFO] Analysis is already Done. Fetching data from the DB...
INFO: Could not find files for the given pattern(s).
←[1m←[91m[ERROR] 'bool' object has no attribute 'dumps'←[0m
Internal Server Error: /PDF/

I have encountered the same problem, I would like to ask how you solved it.

@ajinabraham
Copy link
Member

If you have wkhtmltopdf installed and still seeing this. Please share the APK for further debugging.

@Joyoe
Copy link

Joyoe commented Mar 13, 2019

wkhtmltopdf

Thanks a lot, by reinstalling wkhtmltopdf, my issue has gone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants