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

Unable to generate the PDF #118

Open
rajesh457 opened this issue Dec 3, 2024 · 7 comments
Open

Unable to generate the PDF #118

rajesh457 opened this issue Dec 3, 2024 · 7 comments

Comments

@rajesh457
Copy link

I'm unable to generate the PDF, tried everything at my own, but it keep giving 500 Error
image

@rajesh457
Copy link
Author

This error on Terminal
image

@TMDeal
Copy link
Collaborator

TMDeal commented Dec 3, 2024

If you have yet to do so, i would switch to the github-dev branch, since that is more up to date. This looks like an issue with the selenium server, an issue which I had also encountered in the past. Can you do the following steps and get back to me on the results?

  1. switch to github-dev branch
  2. rebuild the docker image, ensuring that the correct docker image versions are being used
  3. start the server and try to generate a pdf again

Just in case, i recommend making a backup of any existing mysql data before rebuilding, in case of mysql version changes messing things up. After doing that, if it still errors out, can you post an image of the stacktrace?

@rajesh457
Copy link
Author

Hi @TMDeal,
For some reason, Still getting the same error.

I've cloned the github-dev branch using the following cmd on a fresh DO VPS, having 8GB RAM, 2vCPU

git clone --branch github-dev https://github.com/blacklanternsecurity/writehat.git

and getting the same error
image

image

@rajesh457
Copy link
Author

Hi @TMDeal,

Please note that, it gives different error each time to add some random URLs to the ALLOWED_HOSTS

  • image

  • image

After adding the shown hosts, it gives a new host to add in ALLOWED_HOSTS
image

@TMDeal
Copy link
Collaborator

TMDeal commented Dec 11, 2024

Im not too sure how those extra hosts have showed up in the logs. From what i am seeing in there, it looks like a request is being made to the writehat web server for a php file?

image

I am going to see if i can work this issue out on my end and see if there is something I am missing. Also, can you post some more log messages from the chrome container? If not, I understand, I was a bit late in responding to this and you may no longer have the logs around.

@TMDeal
Copy link
Collaborator

TMDeal commented Dec 11, 2024

from my tests, I also got an error when browsing to the generate pdf page, I was able to fix it by downgrading the version of selenium installed to 4.8.2 by pinning it in requirements.txt. Can you try adding that version pin into requirements.txt, rebuilding the containers, and then trying to render the pdf again? It may not have had anything to do with the allowed hosts

@rajesh457
Copy link
Author

Hi @TMDeal,
Thankyou so much

selenium installed to 4.8.2 by pinning it in requirements.txt

Worked like a charm, Thanks for your time :)

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

2 participants