penpot icon indicating copy to clipboard operation
penpot copied to clipboard

bug: Exporter timeout for unknown reason

Open olivierb2 opened this issue 10 months ago • 7 comments

Steps To Reproduce

I deployed penpot manually into a LXC instance and I have only one problem since the beginning, I cannot export my mockups to PDF.

I defined into environment variable exporter the following information: PENPOT_PUBLIC_URI=http://localhost PENPOT_REDIS_URI=redis://localhost/0

Public URI seems reachable from server itself without any problem (Nginx has been configured this way). But exporter return a timeout (without specifying the target which try to be reached).

To reproduce the issue:

  • Open any project available from Projects page.
  • Click on the top left "three dot" menu > File > Export the workspace to PDF.
  • Select at least one item to export and click "Export".
  • An export on going notification appear, but after few seconds, the page returns "Internal error"

Expected behavior

I'm expecting to get a PDF file.

Actual behavior

I getting an "Internal error" due to an unexpected timeout.

Screenshots or video

No response

Desktop (please complete the following information)

  • Browser (client): Firefox ERS 115.8.0esr

Smartphone (please complete the following information)

No response

Environment (please complete the following information)

  • Self hosted and self installed (no Docker)
  • OS: Debian Bookworm
  • NodeJS: 18.17.1
  • Java: openjdk version "21.0.2"
  • Penpot: tag version "2.0.2".

Frontend Stack Trace

Hint:    http error
Prof ID: 314091e9-9328-8055-8002-b5496427b72a
Team ID: 314091e9-9328-8055-8002-b549ac7405d9

Data:
{:type :unexpected-error, :status 404, :data "(...)", :hint "http error"}

Trace:
PENPOT.pi@https://replaced.domain.com/js/shared.380c77a70.js:3469:101
PENPOT.ri@https://replaced.domain.com/js/shared.380c77a70.js:3469:418
PENPOT.qi@https://replaced.domain.com/js/shared.380c77a70.js:3469:371
PENPOT.iwb@https://replaced.domain.com/js/shared.380c77a70.js:4414:180
Pwa/<@https://replaced.domain.com/js/shared.380c77a70.js:4388:245
u@https://replaced.domain.com/js/shared.380c77a70.js:243:276
r@https://replaced.domain.com/js/shared.380c77a70.js:243:218
d@https://replaced.domain.com/js/shared.380c77a70.js:150:99
next@https://replaced.domain.com/js/shared.380c77a70.js:158:429
next@https://replaced.domain.com/js/shared.380c77a70.js:221:222
d@https://replaced.domain.com/js/shared.380c77a70.js:150:99
next@https://replaced.domain.com/js/shared.380c77a70.js:158:429
next@https://replaced.domain.com/js/shared.380c77a70.js:243:350
d@https://replaced.domain.com/js/shared.380c77a70.js:150:99
next@https://replaced.domain.com/js/shared.380c77a70.js:158:429
next@https://replaced.domain.com/js/shared.380c77a70.js:221:222
d@https://replaced.domain.com/js/shared.380c77a70.js:150:99
next@https://replaced.domain.com/js/shared.380c77a70.js:158:429
shadow$provide[1]/q/</<@https://replaced.domain.com/js/shared.380c77a70.js:151:383


Last events:
[":app.main.data.workspace.changes/update-indices"
 ":app.main.data.workspace.transforms/move-shapes-to-frame"
 ":app.main.data.workspace.changes/commit-changes"
 ":app.main.data.workspace.collapse/expand-collapse"
 ":app.main.data.workspace.transforms/move-shapes-to-frame"
 ":app.main.data.workspace.transforms/finish-transform"
 ":app.main.data.workspace.undo/commit-undo-transaction"
 ":app.main.data.workspace.viewport/finish-panning"
 ":app.main.data.workspace.zoom/finish-zooming"
 ":app.main.data.workspace.texts/update-position-data"
 ":app.main.data.workspace.texts/resize-text"
 ":app.main.data.workspace.texts/clean-text-modifier"
 ":app.main.data.workspace.changes/send-update-indices"
 ":app.main.data.workspace.changes/update-shapes"
 ":app.main.data.workspace.texts/commit-position-data"
 ":app.main.data.workspace.undo/start-undo-transaction"
 ":app.main.data.workspace.changes/update-shapes"
 ":layout/update"
 ":app.main.data.workspace.shape-layout/update-layout-positions"
 ":app.main.data.workspace.undo/commit-undo-transaction"
 ":app.main.data.workspace.texts/commit-resize-text"
 ":app.main.data.workspace/workspace-focus-lost"
 ":app.main.data.workspace.thumbnails/request-thumbnail"
 ":app.main.data.workspace.thumbnails/update-thumbnail"
 ":app.main.data.workspace.thumbnails/assoc-thumbnail"
 ":app.main.data.workspace.persistence/persist-changes"
 ":app.main.data.workspace.thumbnails/update"
 ":app.main.data.workspace.thumbnails/clear-thumbnail"
 ":app.main.data.workspace.changes/update-indices"
 ":app.main.data.workspace.persistence/shapes-changes-persisted"
 ":app.main.data.workspace.changes/update-indices"
 ":app.main.data.workspace.persistence/shapes-changes-persisted"
 ":app.main.data.workspace.changes/update-indices"
 ":app.main.data.workspace.persistence/shapes-changes-persisted"
 ":app.main.data.workspace.persistence/shapes-changes-persisted-finished"
 ":app.main.data.workspace.changes/send-update-indices"
 ":app.main.data.workspace.undo/check-open-transactions"
 ":app.main.data.workspace.thumbnails/request-thumbnail"
 ":app.main.data.workspace.thumbnails/update-thumbnail"
 ":app.main.data.workspace.thumbnails/assoc-thumbnail"
 ":app.main.data.workspace.undo/check-open-transactions"
 ":app.main.data.workspace.guides/set-hover-guide"
 ":app.main.data.modal/show-modal"
 ":app.main.data.exports/show-workspace-export-frames-dialog"
 ":app.main.data.modal/hide-modal"
 ":app.main.data.exports/request-multiple-export"
 ":app.main.data.exports/initialize-export-status"
 ":app.main.data.websocket/message"
 ":app.main.data.exports/update-export-status"
 ":app.main.data.websocket/message"
 ":app.main.data.exports/update-export-status"]

Exporter Stack Trace

Apr 22 09:11:20 penpot node[78684]: ERR [app.handlers.export-frames] hint="unexpected error on frames exportation"
Apr 22 09:11:20 penpot node[78684]:   Data:
Apr 22 09:11:20 penpot node[78684]:   {:type :internal, :code :timeout, :hint "ResourceRequest timed out"}
Apr 22 09:11:20 penpot node[78684]:   
Apr 22 09:11:20 penpot node[78684]:   Error: ResourceRequest timed out
Apr 22 09:11:20 penpot node[78684]:       at new cljs.core.ExceptionInfo (/opt/penpot/exporter/target/app.js:26821:14)
Apr 22 09:11:20 penpot node[78684]:       at cljs.core.ex_info.cljs$core$IFn$_invoke$arity$3 (/opt/penpot/exporter/target/app.js:26856:10)
Apr 22 09:11:20 penpot node[78684]:       at app.browser.translate_browser_errors (/opt/penpot/exporter/target/app.js:75696:29)
Apr 22 09:11:20 penpot node[78684]:       at /opt/penpot/exporter/target/app.js:74997:134
Apr 22 09:11:20 penpot node[78684]:       at Object.reject (/opt/penpot/exporter/target/app.js:74512:107)
Apr 22 09:11:20 penpot node[78684]:       at $jscomp$scope$84173391$24$processNextTick (/opt/penpot/exporter/target/app.js:73398:167)
Apr 22 09:11:20 penpot node[78684]:       at $jscomp$scope$84173391$26$transition (/opt/penpot/exporter/target/app.js:73377:110)
Apr 22 09:11:20 penpot node[78684]:       at $jscomp$scope$84173391$13$PromiseImpl.reject (/opt/penpot/exporter/target/app.js:73479:82)
Apr 22 09:11:20 penpot node[78684]:       at Object.complete (/opt/penpot/exporter/target/app.js:73411:28)
Apr 22 09:11:20 penpot node[78684]:       at $jscomp$scope$84173391$25$resolveTask (/opt/penpot/exporter/target/app.js:73380:54)
Apr 22 09:11:20 penpot node[78684]: DBG [app.handlers] hint="process-request", cmd=:get-resource

Additional context

No response

olivierb2 avatar Apr 22 '24 10:04 olivierb2

Hello, this seems to be a configuration problem, specifically related to the exporter module, for which I do not see any log. Could you put the exporter log to see if it sheds some light on the matter? Thank you.

niwinz avatar May 23 '24 08:05 niwinz

Hi @niwinz, thanks for your reply. I edited my issue since the last part is Exporter logs.

olivierb2 avatar May 23 '24 08:05 olivierb2

And that exporter logs has more previous log entries?

niwinz avatar May 23 '24 08:05 niwinz

Exporter has nothing other, just this logs in loop (since I tried to do export several times).

I'm not sure if this will help, but here the startup logs

Apr 11 14:03:20 penpot systemd[1]: Started penpot-exporter.service - Penpot.
Apr 11 14:03:20 penpot node[23576]: INF [app.util.shell] hint="tmptdir setup", path="/tmp/penpot-exporter"
Apr 11 14:03:20 penpot node[23576]: INF [app.core] msg="initializing", public-uri="http://localhost", version="1.19.0"
Apr 11 14:03:20 penpot node[23576]: INF [app.browser] hint="initializing browser pool", opts=#js {:max 5, :min 0, :testOnBorrow true, :evictionRunIntervalMillis 5000, :numTestsPerEvictionRun 5, :acquireTimeoutMillis 10000, :idleTimeoutMillis 10000}
Apr 11 14:03:20 penpot node[23576]: INF [app.http] hint="welcome to penpot", module="exporter", version="1.19.0"
Apr 11 14:03:20 penpot node[23576]: INF [app.http] hint="starting http server", port=6061
Apr 11 14:03:20 penpot node[23576]: INF [app.redis] hint="redis connection established", uri="redis://localhost/0"

olivierb2 avatar May 23 '24 08:05 olivierb2

I'm looking for something similar to: image

The exporter, in its functionality, makes an internal request to the frontend application (the same application that runs in your browser when loading the penpot url) to Render the different boards that you have selected in an internal browser and capture the image and build the PDF. The exception you see is that the exporter is probably not able to load the application and hence the timeout.

niwinz avatar May 23 '24 10:05 niwinz

I have tested to install penpot via docker on an ARM server and the exporter works correctly, while on an INTEL server it does not work.

ovniroto avatar Jun 29 '24 18:06 ovniroto

Hello, I have the same issue on a docker compose instance based on the general documentation. The docker-compose.yml is this one

Docker compose log upon export :

penpot-exporter-1   | TRC [app.browser] hint="exec:handle:end", browser-id=2
penpot-exporter-1   | TRC [app.util.shell] hint="schedule tempfile deletion", path="/tmp/penpot-exporter/penpot.tmp.pdfunite.deaeab41-d182-810a-8004-bd2c9ea59208.34a9e770-395c-80c0-8004-bd67852f226a-0.pdf", scheduled-at="Wed Jul 31 2024 12:29:49 GMT+0000 (Coordinated Universal Time)"
penpot-exporter-1   | TRC [app.util.shell] fn=:run-cmd, cmd="pdfunite /tmp/penpot-exporter/penpot.tmp.render.pdf.34a9e770-395c-80c0-8004-bd677eb5fb21-0.pdf /tmp/penpot-exporter/penpot.tmp.pdfunite.deaeab41-d182-810a-8004-bd2c9ea59208.34a9e770-395c-80c0-8004-bd67852f226a-0.pdf"
penpot-exporter-1   | INF [app.browser] origin="factory", action="destroy", browser-id=2

For now the simpliest solution seems to be using this path and running docker container cp.

So in my case docker container cp penpot-penpot-exporter-1:/tmp/penpot-exporter/penpot.tmp.render.pdf.34a9e770-395c-80c0-8004-bd677eb5fb21-0.pdf .

If you plan to export a lot of PDFs, maybe map a local .tmp folder to the tmp of the exporter.

The opened file is actually the exact PDF of the exported design, so no problem there.

BSD-Yassin avatar Jul 31 '24 11:07 BSD-Yassin