Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task-Get errors #291

Closed
chevcheli0s opened this issue Jul 19, 2023 · 15 comments · Fixed by #350 · May be fixed by #470
Closed

Task-Get errors #291

chevcheli0s opened this issue Jul 19, 2023 · 15 comments · Fixed by #350 · May be fixed by #470
Labels
bug Something isn't working
Milestone

Comments

@chevcheli0s
Copy link

chevcheli0s commented Jul 19, 2023

What version of Ctrl-Q are you using?

3.11.0

What version of Node.js are you using? Not applicable if you use the standalone version of Ctrl-Q.

No response

What command did you use to start Ctrl-Q?

./ctrl-q task-get --host myhost --auth-user-dir domain --auth-user-id user --log-level silly

What operating system are you using?

Debian 11

What CPU architecture are you using?

x86_64

What Qlik Sense versions are you using?

2023-February sp5

Describe the Bug

Hi!
I have some errors when trying to execute tasks-get
First error with event trigger for telemetry dashboard

2023-07-19T09:24:44.750Z debug: Processing composite event "telemetry-metadata-trigger" for reload task "TelemetryDashboard-2-Reload-Dashboard" (a2e18a30-4d80-450e-aba5-ba30263d9c50)
2023-07-19T09:24:44.751Z error: GET TASK: TypeError: Cannot read properties of null (reading 'id')
    at QlikSenseTasks.getTaskModelFromQseow (/snapshot/src/build/lib/index.js)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async getTask (/snapshot/src/build/lib/index.js)

image
I think that is because trigger set to execution of external program task("TelemetryDashboard-1-Generate-Metadata")
When I delete this event trigger I receive another one error:

2023-07-19T09:17:48.165Z warn: Downstream task in task tree not found. From: node-3feeb6bf-a3c9-40ed-ba3b-1bbc324b8188, to: 95ce6de2-748c-4c15-9d7c-7b3a9190d515 
2023-07-19T09:17:48.529Z error: GET TASK SUBTREE: RangeError: Maximum call stack size exceeded
    at QlikSenseTasks.getTaskSubTree (/snapshot/src/build/lib/index.js)
    at QlikSenseTasks.getTaskSubTree (/snapshot/src/build/lib/index.js)
    at QlikSenseTasks.getTaskSubTree (/snapshot/src/build/lib/index.js)
    at QlikSenseTasks.getTaskSubTree (/snapshot/src/build/lib/index.js)
    at QlikSenseTasks.getTaskSubTree (/snapshot/src/build/lib/index.js)
    at QlikSenseTasks.getTaskSubTree (/snapshot/src/build/lib/index.js)
    at QlikSenseTasks.getTaskSubTree (/snapshot/src/build/lib/index.js)
    at QlikSenseTasks.getTaskSubTree (/snapshot/src/build/lib/index.js)
    at QlikSenseTasks.getTaskSubTree (/snapshot/src/build/lib/index.js)
    at QlikSenseTasks.getTaskSubTree (/snapshot/src/build/lib/index.js)
2023-07-19T09:17:48.587Z warn: Downstream task in task tree not found. From: node-800e4add-dd91-4afe-84eb-ca2b513a0025, to: c05ead75-2b02-4ce5-ab1e-673f6d02c41e 

Expected Behavior

No response

To Reproduce

No response

@ale-novoa
Copy link

I am having the same exact issue. in the same exact scenario (using the standalone)

Tried exporting or displaying, multiple or single tasks, nothing worked, always the same error message:

error: GET TASK: TypeError: Cannot read properties of null (reading 'id')
at QlikSenseTasks.getTaskModelFromQseow (C:\snapshot\src\build\lib\index.js)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async getTask (C:\snapshot\src\build\lib\index.js)

@ale-novoa
Copy link

UPDATE: after deleting the external program task that was created by the Telemetry app (TelemetryDashboard-1-Generate-Metadata) I was able to extract all of the tasks.

That was the only external program task I had in my server, so not sure if it was an issue with this specific task or with any external program task.
But it is working fine now.

@mountaindude
Copy link
Contributor

Planning to look into this during coming days or so.
Most likely related to external program tasks not being properly handled, it seems.

Thanks for good bug reports!

@mountaindude mountaindude added the bug Something isn't working label Sep 25, 2023
@mountaindude
Copy link
Contributor

mountaindude commented Sep 26, 2023

@ale-novoa and @chevcheli0s

Please give 3.13.0 3.13.1 a try, it works for me here.
I could reproduce your errors, btw.

Also, note that the --task-type parameter has two possible values reload and ext-program that can be combined, depending on what tasks you want to include.
You probably want to include both, to get both reload tasks and external program tasks.

...and I just now found a bug when using --task-type ext-program.
I.e. only including external program tasks. Duh... will fix. Shouldn't be a problem for you I think/hope.

@chevcheli0s
Copy link
Author

chevcheli0s commented Sep 29, 2023

@mountaindude I tested it
log.zip

@mountaindude
Copy link
Contributor

mountaindude commented Oct 1, 2023

@chevcheli0s
Ok, so your task chain differs from the one I tested on somehow.

Can you share what it looks like? I am particularly interested in if tasks are reload tasks/ext program tasks and how the tasks are triggered.

Edit: For example, is the task chain longer than the (very good and clear!) example you already showed up above?
I would like to be able to reproduce the bug you are seeing.

@chevcheli0s
Copy link
Author

chevcheli0s commented Oct 2, 2023

@mountaindude
There are some examples
image
image
image

@mountaindude
Copy link
Contributor

@chevcheli0s
I cannot reproduce the "Maximum call stack size exceeded" error.
How long is your reload chain (approximately)?

@chevcheli0s
Copy link
Author

chevcheli0s commented Oct 9, 2023

@mountaindude Maybe this can help

2023-10-09T10:13:12.092Z debug: Processing composite event "reports_view_order_full" for reload task "05. ***" (56baa838-2d94-47e4-9389-72cfdcfb3a9d)
2023-10-09T10:13:12.092Z debug: Current composite event triggers a reload task. Processing composite event "reports_view_order_full" for reload task "05. ***" (56baa838-2d94-47e4-9389-72cfdcfb3a9d)
2023-10-09T10:13:12.092Z verbose: Composite event "reports_view_order_full" is triggerer by 3 upstream tasks.
2023-10-09T10:13:12.092Z debug: Composite event "reports_view_order_full" is triggered by reload task with ID=c0cf4571-7d77-4e83-986a-d1b55fa26cbb.
2023-10-09T10:13:12.092Z debug: Composite event "reports_view_order_full" is triggered by reload task with ID=862d87b5-9a15-4382-b4e3-1f6901c7b6e3.
2023-10-09T10:13:12.092Z debug: Composite event "reports_view_order_full" is triggered by reload task with ID=2eb6aa9a-434e-495b-bc42-d6bffd2ef9ca.
2023-10-09T10:13:12.092Z debug: Added edge from composite event meta node "node-c4078faa-52da-4880-9fc8-741a4f63134f" to reload task ID=56baa838-2d94-47e4-9389-72cfdcfb3a9d.
2023-10-09T10:13:12.189Z warn: Downstream task in task tree not found. From: node-5f62e677-63dd-41c9-b9c4-043a84e72832, to: 95ce6de2-748c-4c15-9d7c-7b3a9190d515 
2023-10-09T10:13:12.614Z error: GET TASK SUBTREE: RangeError: Maximum call stack size exceeded
    at prepareStackTrace (node:internal/errors:116:5)
    at eb.getTaskSubTree (/snapshot/ctrl-q/build.cjs:283:18113)
    at eb.getTaskSubTree (/snapshot/ctrl-q/build.cjs:283:13850)
    at eb.getTaskSubTree (/snapshot/ctrl-q/build.cjs:283:13850)
    at eb.getTaskSubTree (/snapshot/ctrl-q/build.cjs:283:13850)
    at eb.getTaskSubTree (/snapshot/ctrl-q/build.cjs:283:13850)
    at eb.getTaskSubTree (/snapshot/ctrl-q/build.cjs:283:13850)
    at eb.getTaskSubTree (/snapshot/ctrl-q/build.cjs:283:13850)
    at eb.getTaskSubTree (/snapshot/ctrl-q/build.cjs:283:13850)
    at eb.getTaskSubTree (/snapshot/ctrl-q/build.cjs:283:13850)
2023-10-09T10:13:12.699Z warn: Downstream task in task tree not found. From: node-470d008b-d17e-4087-9afd-3b4d5d9794b1, to: c05ead75-2b02-4ce5-ab1e-673f6d02c41e 

image
image
image

The last three tasks S* with daily triggers at 09:30

95ce6de2-748c-4c15-9d7c-7b3a9190d515 - this external program task(telemetry dash)
c05ead75-2b02-4ce5-ab1e-673f6d02c41e - this one too ext program

Maybe you can add task counter to debug level?
Or increase stack size

(Get-QlikReloadTask).Count
1796

@mountaindude
Copy link
Contributor

Yeah... that whole part of the tool needs a bit of restructuring, it seems.

Recursive code (as used here) can be convenient but also pose a risk.
I've started the refactoring but it will be some time until it's ready, I am afraid.

@mountaindude mountaindude added this to the 3.14.0 milestone Oct 24, 2023
@mountaindude
Copy link
Contributor

Version 3.14 was just released (download here), it contains (among other things) changes related to this ticket.

@chevcheli0s
Copy link
Author

Error still persist

2023-11-20T08:13:21.287Z .[32minfo.[39m: -----------------------------------------------------------
2023-11-20T08:13:21.288Z .[32minfo.[39m: | Ctrl-Q
2023-11-20T08:13:21.288Z .[32minfo.[39m: |
2023-11-20T08:13:21.288Z .[32minfo.[39m: | Version : 3.14.0
2023-11-20T08:13:21.289Z .[32minfo.[39m: | Log level : info
2023-11-20T08:13:21.289Z .[32minfo.[39m: |
2023-11-20T08:13:21.289Z .[32minfo.[39m: | Command : task-get
2023-11-20T08:13:21.289Z .[32minfo.[39m: | : get info about one or more tasks
2023-11-20T08:13:21.289Z .[32minfo.[39m: |
2023-11-20T08:13:21.290Z .[32minfo.[39m: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2023-11-20T08:13:21.290Z .[32minfo.[39m: |
2023-11-20T08:13:21.290Z .[32minfo.[39m: | https://github.com/ptarmiganlabs/ctrl-q
2023-11-20T08:13:21.290Z .[32minfo.[39m: ----------------------------------------------------------
2023-11-20T08:13:21.291Z .[32minfo.[39m:
2023-11-20T08:13:21.416Z .[32minfo.[39m: Successfully retrieved 246 tags from QSEoW
2023-11-20T08:14:37.470Z .[31merror.[39m: GET TASK SUBTREE (tree): RangeError: Maximum call stack size exceeded
at prepareStackTrace (node:internal/errors:116:5)
at uw.getTaskSubTree (/snapshot/ctrl-q/build.cjs:284:16260)
at uw.getTaskSubTree (/snapshot/ctrl-q/build.cjs:284:11990)
at uw.getTaskSubTree (/snapshot/ctrl-q/build.cjs:284:11990)
at uw.getTaskSubTree (/snapshot/ctrl-q/build.cjs:284:11990)
at uw.getTaskSubTree (/snapshot/ctrl-q/build.cjs:284:11990)
at uw.getTaskSubTree (/snapshot/ctrl-q/build.cjs:284:11990)
at uw.getTaskSubTree (/snapshot/ctrl-q/build.cjs:284:11990)
at uw.getTaskSubTree (/snapshot/ctrl-q/build.cjs:284:11990)
at uw.getTaskSubTree (/snapshot/ctrl-q/build.cjs:284:11990)

@mountaindude
Copy link
Contributor

Noooo....... Darn.

Will have to loop back to you on this one.
I am not able to reproduce the error here, so I need to understand what's causing it.

@mountaindude mountaindude reopened this Nov 20, 2023
@mountaindude
Copy link
Contributor

@chevcheli0s
I found the likely cause of this: Circular task dependencies.
As of right now Ctrl-Q does not handle these nicely, coming in next (or next-next) version.

Getting tasks as a table (CSV or Excel or on-screen) still works, from what I can tell.

@mountaindude
Copy link
Contributor

Regarding circular task trees.

Let's say we have task relations like this:

image

Then the next Ctrl-Q version will create this task tree:

image

Circular task trees are perfectly fine from a Qlik Sense point of view, and when visualising them in a network diagram or flowchart it's possible to route an arrow back to a previous task.

The challenge is rather the nature of the tree format.
There we have to identify those circular relationships and break them, ideally while also clearly stating where the break occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants