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

Server error 500 #54

Closed
jbizzle21 opened this issue Jul 20, 2022 · 10 comments
Closed

Server error 500 #54

jbizzle21 opened this issue Jul 20, 2022 · 10 comments

Comments

@jbizzle21
Copy link

Upon creating and retrieving reports a server error is returned.

nginx_1 | 172.18.0.1 - - [20/Jul/2022:08:32:43 +0000] "GET /report/view/1 HTTP/1.1" 500 145 "https://127.0.0.1/report/list/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:101.0) Gecko/20100101 Firefox/101.0" "-"

New build. Host Os is ubuntu 20.04

@jrcastine
Copy link

New host build, Host OS is Ubuntu 20.04. Same issues. Saving a report generates an error 500, report is saved. Viewing the saved report, error 500.

@saheredelgadom
Copy link

me too the same problem

New host build, Host OS is Ubuntu 20.04. Same issues. Saving a report generates an error 500, report is saved. Viewing the saved report, error 500.

@1modm
Copy link
Owner

1modm commented Aug 30, 2022

Hi all,

Could you enable the debug mode and attach the output?

in petereport_config.py:
'debug': True,

Thanks

@suru71
Copy link

suru71 commented Aug 31, 2022

Even I am getting the same 500 error when I try to view any report or finding. Post enabling debug. It is now showing to reinstall markdown to > 3.0. --- So I have upgraded markdown to 3.3.4. But still I am getting the same error.. Attaching the debug for reference
Debug.txt

@eashck
Copy link

eashck commented Aug 31, 2022

I have faced same issue.
I have solved, in my case I was using Markdown 3.4.1, downgrading Markdown to 3.0.1 version.
My installation is using Docker.
Connect docker, downgrade the Mardown and commit the docker.

docker exec -it container-name /bin/bash
pip3 install Markdown==3.0.1
exit
docker commit container-name
Hopping it helps.

Ed

@suru71
Copy link

suru71 commented Aug 31, 2022

I have faced same issue. I have solved, in my case I was using Markdown 3.4.1, downgrading Markdown to 3.0.1 version. My installation is using Docker. Connect docker, downgrade the Mardown and commit the docker.

docker exec -it container-name /bin/bash pip3 install Markdown==3.0.1 exit docker commit container-name Hopping it helps.

Ed

This resolved the markdown version error. But now it is showing new error of ModuleNotFoundError
Below is debug error -

Internal Server Error: /product/view/2 Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/usr/local/lib/python3.8/dist-packages/django/core/handlers/base.py", line 181, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib/python3.8/dist-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view return view_func(request, *args, **kwargs) File "/opt/petereport/app/preport/views.py", line 359, in product_view return render(request, 'products/product_view.html', {'pk': pk, 'DB_product_query': DB_product_query, 'DB_report_query': DB_report_query, 'count_product_report': count_product_report, 'product_findings': count_product_findings_total, 'count_product_findings_critical_high': count_product_findings_critical_high, 'count_product_findings_medium': count_product_findings_medium}) File "/usr/local/lib/python3.8/dist-packages/django/shortcuts.py", line 19, in render content = loader.render_to_string(template_name, context, request, using=using) File "/usr/local/lib/python3.8/dist-packages/django/template/loader.py", line 62, in render_to_string return template.render(context, request) File "/usr/local/lib/python3.8/dist-packages/django/template/backends/django.py", line 61, in render return self.template.render(context) File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 170, in render return self._render(context) File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 162, in _render return self.nodelist.render(context) File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 905, in render_annotated return self.render(context) File "/usr/local/lib/python3.8/dist-packages/django/template/loader_tags.py", line 150, in render return compiled_parent._render(context) File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 162, in _render return self.nodelist.render(context) File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 905, in render_annotated return self.render(context) File "/usr/local/lib/python3.8/dist-packages/django/template/loader_tags.py", line 62, in render result = block.nodelist.render(context) File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 905, in render_annotated return self.render(context) File "/usr/local/lib/python3.8/dist-packages/django/template/loader_tags.py", line 62, in render result = block.nodelist.render(context) File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 905, in render_annotated return self.render(context) File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 988, in render output = self.filter_expression.resolve(context) File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 698, in resolve new_obj = func(obj, *arg_vals) File "/usr/local/lib/python3.8/dist-packages/martor/templatetags/martortags.py", line 21, in safe_markdown return mark_safe(markdownify(field_name)) File "/usr/local/lib/python3.8/dist-packages/martor/utils.py", line 31, in markdownify return markdown.markdown( File "/usr/local/lib/python3.8/dist-packages/markdown/core.py", line 390, in markdown md = Markdown(**kwargs) File "/usr/local/lib/python3.8/dist-packages/markdown/core.py", line 99, in __init__ self.registerExtensions(extensions=kwargs.get('extensions', []), File "/usr/local/lib/python3.8/dist-packages/markdown/core.py", line 128, in registerExtensions ext._extendMarkdown(self) File "/usr/local/lib/python3.8/dist-packages/markdown/extensions/__init__.py", line 79, in _extendMarkdown self.extendMarkdown(md) File "/usr/local/lib/python3.8/dist-packages/markdown/extensions/extra.py", line 58, in extendMarkdown md.registerExtensions(extensions, self.config) File "/usr/local/lib/python3.8/dist-packages/markdown/core.py", line 126, in registerExtensions ext = self.build_extension(ext, configs.get(ext, {})) File "/usr/local/lib/python3.8/dist-packages/markdown/core.py", line 166, in build_extension module = importlib.import_module(ext_name) File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked ModuleNotFoundError: No module named 'fenced_code'

@1modm
Copy link
Owner

1modm commented Sep 1, 2022

Thank you all, it seems a problem between markdown and martor packages, I have updated the Pipfile and done some changes that should fix this issue, try and let me know:

git pull
docker-compose up --build

@1modm 1modm closed this as completed Sep 1, 2022
@eashck
Copy link

eashck commented Sep 1, 2022

Working fine for me.

BTW, @1modm, thanks to create this cool project.

@suru71
Copy link

suru71 commented Sep 1, 2022

Thanks. It is working for me as well. Appreciate your quick response 👍

@1modm
Copy link
Owner

1modm commented Sep 1, 2022

Thank you for use it 👯

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

6 participants