Giter Site home page Giter Site logo

PDFKit hangs rails server about pdfkit HOT 5 CLOSED

pdfkit avatar pdfkit commented on May 3, 2024
PDFKit hangs rails server

from pdfkit.

Comments (5)

jdpace avatar jdpace commented on May 3, 2024

I'm not sure how wkhtmltopdf determines when a page is done rendering in order to convert it to a PDF but Datatable may be causing an issue there.

from pdfkit.

mitfik avatar mitfik commented on May 3, 2024

Hi

I have figure out what is the problem...

The problem is that in middleware pdfkit wait for ending job by wkhtmltopdf but wkhtmltopdf try to connect to server to get some request ... I don't have idea what kind of request it is, because all css/images file are accessible for wkhtmltopdf. But any way server can't answer for this request because he wait for finish job and so on .. so we have loop here.
This is happen only on views with jquery DataTable so probaly there is some extra http link what wkhtmltopdf wants to check ... I tried to check which one but I didn't find anything.

Workaround:
You must run 2 or more instances of servers and tell wkhtmltopdf that can use only one (of course You can not use this server to run wkhtmltopdf)

If someone has idea how to solve this problem I will be really appreciate.

from pdfkit.

cimm avatar cimm commented on May 3, 2024

Are there any solutions for this or is the workaround @mitfik proposes still the best solution?

from pdfkit.

vanboom avatar vanboom commented on May 3, 2024

I am having this same issue and having trouble debugging. Seems the server is stuck waiting for the wkhtmltopdf process to finish...but I cannot figure out why it is not finishing. Nothing but simple HTML views here...

I'm using the 0.10 rc2 of wkhtmltopdf, Ubuntu 10.04, Rails 2.3.8.

It looks like the server spawns off two wkhtmltopdf tasks - but hangs waiting. If I run wkhtmltopdf from the command line - it works fine.

Any help is greatly appreciated. PDFKit works beautifully on my development Ubuntu server, but I'm having trouble getting it up on my Internet box.

thanks

from pdfkit.

vanboom avatar vanboom commented on May 3, 2024

See here - the problem is with pdfkit and thin...

https://thin.lighthouseapp.com/projects/7212/tickets/140-thin-and-pdfkit

Adding the --threaded option to thin solved the issue!

from pdfkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.