Our state of the art Gantt chart


Post by MauriceLapre »

Hi,

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!

Post by Maxim Gorkovsky »

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.
node src/server.js --verbose

Post by MauriceLapre »

Reproduced with verbose option. Log is attached.
Attachments
export-server-2020-03-04.log
(15.08 KiB) Downloaded 182 times

Post by Maxim Gorkovsky »

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?

Post by MauriceLapre »

Hi Maxim,

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?
Attachments
export-server-2020-03-05.log
(7.42 KiB) Downloaded 170 times
export-sps.pdf
(54.28 KiB) Downloaded 172 times

Post by Maxim Gorkovsky »

We've been troubleshooting, installed other (non-documented) dependencies, and that error has now been resolved.
Can you name those dependencies? We could probably include them into readme if those are relevant.
But the output pdf is not how it's supposed to look like
Problem is likely styles not being loaded on the page. Here is a list of resources which could be helpful:
1. https://www.bryntum.com/docs/scheduler/#Scheduler/feature/export/PdfExport#config-translateURLsToAbsolute
2. https://www.bryntum.com/docs/scheduler/#Scheduler/feature/export/PdfExport#config-clientURL
3. Two sections of server/README.md: Resources and Exported PDF/PNG doesn't look correct

Do you configure resources for export server?

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.

Post by MauriceLapre »

It was indeed the styles/resources that were not being loaded. After configuring translateURLsToAbsolute, it's working!

Thank you!

Post by MauriceLapre »

Ran some tests and two things remaining:

1) Some symbols are still not rendered correctly:
Bryntum Gantt - export 004.png
Bryntum Gantt - export 004.png (7.47 KiB) Viewed 3744 times
This is the filterbar with some filter operators (calendar, arrows) and a dropdown/combo symbol.

2) The fileName config doesn't seem to work:
pdfExport : {
[...]
            fileName: 'sps-export.pdf',     
            headerTpl,
            footerTpl
        },
File still gets exported with the name of the first task as the filename.

Post by Maxim Gorkovsky »

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.

Post by MauriceLapre »

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
Bryntum Gantt - export 005.png (16.39 KiB) Viewed 3326 times

Post Reply