Post by thomi_ch »

Hello

Also getting into this initial issue:
Error: Load failed
at Project.onCrudRequestFailure (webpack:///./node_modules/@bryntum/gantt/gantt.module.js?:1065:555190)

Tested around with limit setting (cpu, memory,...) and also workers.
We found out that:
if workers > 0
. loading a project with tons of tasks, above error happend
. loading a project with just some tasks, no error
if workers = 0
. loading projects with few or tons of tasks > no error...

On customers server, there is nodejs v10.x cause it's based on Ubuntu 20.04.
On our local dev system i have nodejs v12.x... Ubuntu 22.04...

So.. can nodejs version be a problem combined with workers?

Thanks for reply and regards
thomi


Post by tomb »

Hi Thomi

While you see "node_modules" being referenced in the error the Bryntum Gantt module does not interact with the nodejs installation on the customer server; it's just that "chunkVendors.js" contains some JS modules that were downloaded via NPM and then bundled into one big JS file. So that's why you see "node_modules" but everything happens on the client side in the browser, not on the customer server.

What I think is happening instead is that the load of the JSON structure that contains projects and tasks, from the backend, is taking too much memory, and therefore getting killed by Odoo. This would only happen in workers>0 mode, because in that case each worker process is limited in memory. With workers=0, there is only one process with no memory limit so the process will still continue.

Maybe you can try workers > 0 and increasing the soft and hard memory limits and also monitor the memory being used by the worker. Also you can check out in the Odoo logfile if the worker process is being killed. If indeed memory is the problem, we might also try and do a memory optimization on our side in the code, but that might take a while to be released.


Post by thomi_ch »

Hey Tomb

trying and testing around with different memory and other limit settings.. currently with this:
limit_memory_hard = 9663676416
limit_memory_soft = 1415577600
limit_request = 8192
limit_time_cpu = 1200
limit_time_real = 1600
workers = 2

Still get the same issue if it has to load a project with a lot of tasks (>500).

Is there any way to limit the task count? Means eg. only show tasks which are not finished (not 100% or type not finished)?
In res.settings there is bryntum_gantt_config, but can't find any documentation about it...

Strange is.. on my local dev env i set this limits to check.. and never get the reported JS issue:
limit_memory_hard = 1342177280 (1.3GB)
limit_memory_soft = 1073741824 (1.07GB)
limit_request = 8192
limit_time_cpu = 1200
limit_time_real = 1600
workers = 2

many thanks
thomi


Post by tomb »

Hi Thomi,

the first version of the docs was just released, which will tell you more about how to use the Gantt Configuration object:

https://odoo-gantt-docs.bryntum.com/

But I think that won't help you in the case of trying to limit the amount of tasks being loaded, I think it always loads all of them at the moment and you can only filter them later on the JS side.

Did you find out more information about what's causing the problem on the production server? Does the logfile show a MemoryError, or is the worker being killed because of a CPU timeout?


Post by thomi_ch »

Hey tomb

thanks for doc url... as you said, limiting amount of tasks to list is not possible over Gantt Config Object.
There should be a global setting for this.. eg. filter by stage or similar..

On server side nothing is happening, no MemoryError, nothing killed, all as usual... just that JS error...

We have special env. for our instances, have to get into it deeper.. maybe something causes that error.

Thing is.. eg. the chunk-vendors.js is a big one.. 5.5MB.. anything maybe will cause to not load it 100%...
Not easy to debug, if we not have the source of all the merged vendor js files.

thomi


Post by tomb »

Hi Thomi, yes, unfortunately implementing a setting to filter the tasks is not quick for us to do.

What you could do, if you have access to a programmer, is to edit the module yourself: in the controllers.py file there's the function that will return the project + tasks to the frontend, and you can apply a filtering domain there. This as a workaround until we can implement it properly in the module.

I'm pretty sure that it's not due to chunkVendors.js not being completely loaded, it seems like that would lead to a different error.

You might be able to get more information if you open the production instance in Chrome/Chromium or even Firefox, and open the Developer Tools, "Network" tab. Then, you can see exactly which server call failed - it will show up as red. Maybe you can then share a screenshot of that here, and we can take it from there.


Post by thomi_ch »

hey tomb

you mean something like this:
file: bryntum_gantt/controllers/controllers.py
line: 96

task_objs = project.tasks.filtered(lambda r: r.stage_id.is_closed != True)

Why not make a easy configuration option for this?
"Show tasks in active stages"

thomi


Post by thomi_ch »

hey all

fixed it on my side.. it was a other module/js which causes that error..

for me still one issue remaining also in 14.0.2.1.13.
If normal project user want change duration of a task, we get:

Data synchronization failed!
Server response: You are not allowed to modify 'Project' (project.project) records. This operation is allowed for the following groups: - Project/Administrator Contact your administrator to request access if necessary.

Have submitted that already, but sorry.. can't remember where i submitted this :}

Only workaround or even fix is:
file: bryntum_gantt/controllers/controllers.py
line: 326 and 331
See attachment

If we should create new thread for this, let me know..

regards
thomi

Attachments
bryntum_gantt_fix_task_write_as_project_user.png
bryntum_gantt_fix_task_write_as_project_user.png (35.11 KiB) Viewed 20 times

Post by thomi_ch »

Ha.. found the other topic ;)

14.0.2.1.12 issue to save task as normal project user
viewtopic.php?t=30359

thomi


Post by nivl »

Hi Thomi,

Glad to hear you solved the model/js error, great news.

For the other error, I'll respond on that thread :).

Niels


Post Reply