We're trying to get an export server up and running. Seemed to be running fine, but getting an error after starting the export from the export dialog:
{
"success":false,
"msg":"Failed to export task","stack":"Error: Failed to export task\n at Queue.onJobFailed (/snapshot/server/src/queue.js)\n at Queue.emit (events.js:210:5)\n at /snapshot/server/src/queue.js\n at processTicksAndRejections (internal/process/task_queues.js:93:5)"
}
Could you help me with this, or point me to the direction to have a look at? Thank you!
Hello.
Queue is a server-side class. Try looking into server logs, by default they are located at server/log/export-server-*.log. Can you post log content here?
Does this error happen often? If you can reproduce it consistently, I can recommend to enable verbose log and see output from the server process. That would allow to gather more useful information.
I believe you have already looked into the log and learned that your OS cannot run chrome:
2020-03-04T13:42:27.055Z warn: [Queue@fk7lmjdtt500qaz0zirs2] Error: Failed to launch chrome!
/opt/server/bin/linux/chromium/linux-662092/chrome-linux/chrome: error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory
It doesn't look like problem with server itself, rather puppeteer in general. Have you tried to look up solution?
We've been troubleshooting, installed other (non-documented) dependencies, and that error has now been resolved. But the output pdf is not how it's supposed to look like, there are no errors in the log file though...
Makes no difference whether we choose pdf or png format. What could the cause be?
Long story short: you need to make css and other resources available to export server. If you open network tab in chrome and inspect request to the export server, in the headers section you could find string with HTML which is what server tries to load. You can copy that, paste into a file and try to open in browser as file. When you open that, you will likely see bunch of 404s for css files.
If readme doesn't help you to solve resources loading, please let us know and we will guide you through next steps.
It looks like FontAwesome wasn't loaded, most likely due to CORS. There are few options:
1. Please refer to the readme in export example:
1. Setup the server
Server is located in `examples/_shared/server`
Navigate to `examples/_shared/server/README.md` for instructions. Usually it should be enough
to run
`cd examples/_shared/server/ && npm i && node ./src/server.js -h 8080 -r /path/to/resources`
where `/path/to/resources` is physical path to the resources folder.
It is required to correctly load FontAwesome which is used to show icons.
For example
```
# url : https://localhost/gantt-x.y.z-trial/examples/export
# path : /home/www/gantt-x.y.z-trial/examples/export
# resource path : /home/www/gantt-x.y.z-trial/
node ./src/server.js -h 8080 -r /home/www/
```
2. There's a config which makes server to navigate to page: https://www.bryntum.com/docs/gantt/#Grid/feature/export/PdfExport#config-clientURL
That way, when page content is changed to HTML sent from the client, CORS doesn't prevent loading resources.
3. Configure you web server to add CORS header Access-Control-Allow-Origin to css/fonts/images/etc requests.
Configured the -r option and configured "clientURL" and doublechecked CORS, and we're again one step further now. Most symbols are rendered correctly, but the leaf "dot" symbol isn't though:
Bryntum Gantt - export 005.png (16.39 KiB) Viewed 3326 times