cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Having trouble accessing previous task records

rseibert1
Contributor
The below is giving a parse error, though it seems to be pulling a list of Id's that seems to be formatted wrong?
Trying to pull the list of Id's from the task.
 
{% for record in result("unhealthy_workers_table")["records"] %}
Id : {{ record.Id }}
{% endfor %}
 
 
[ERROR] 400: PARSE_ERROR. exceptionType: "DQL-ERROR-PARSING". syntaxErrorPosition: {"start":{"column":5,"index":4,"line":1},"end":{"column":5,"index":4,"line":1}}. errorType: "PARSE_ERROR". errorMessage: "`:` isn't allowed here. Please check the autocomplete suggestions before the error for alternative options.". arguments: ["`:`"]. queryString: "\tId : Workers-22\n\tId : Workers-23\n\tId : Workers-465\n\tId : Workers-349\n\tId : Workers-781\n\tId : Workers-621\n\tId : Workers-721\n\tId : Workers-722\n\tId : Workers-502\n\tId : Workers-501\n\tId : Workers-245\n\tId : Workers-84\n\tId : Workers-85\n\tId : Workers-86\n\tId : Workers-87\n\tId : Workers-143\n\tId : Workers-121\n\tId : Workers-62\n\tId : Workers-141\n\tId : Workers-142\n\tId : Workers-181\n\tId : Workers-182\n\tId : Workers-161\n\tId : Workers-162\n\tId : Workers-201\n\tId : Workers-202\n\tId : Workers-351\n\tId : Workers-352\n\tId : Workers-353\n\tId : Workers-354\n\tId : Workers-341\n\tId : Workers-342\n\tId : Workers-343\n\tId : Workers-344\n\tId : Workers-532\n\tId : Workers-321\n\tId  ---output truncated------------------------------------------------------
Workers-304\n". errorMessageFormatSpecifierTypes: ["INPUT_QUERY_PART"]. errorMessageFormat: "%1$s isn't allowed here. Please check the autocomplete suggestions before the error for alternative options.". queryId: "ddc63a6a-cf66-4e8a-98fb-1f795023b5fd"
 
Here is a sample from the unhealthy_workers_table:
 

[
{
"Id": "Workers-22",
"SpaceId": "Spaces-1",
"timestamp": "2024-12-04T11:39:52.487000000Z",
"HealthStatus": "HasWarnings",
"StatusSummary": "This machine is running an old version of Tentacle (6.1.1403).",
"WorkerPoolIds": [
"WorkerPools-42"
],
"OperatingSystem": "Microsoft Windows Server 2019 Standard 10.0.17763.0",
"HasLatestCalamari": true
},

5 REPLIES 5

christian_kreuz
Dynatrace Advisor
Dynatrace Advisor

Hi,

from an Automation/Workflow perspective, this seems to be working as expected.

I believe you have an error in a DQL statement of a preceeding task - could you verify that the share this DQL statement is working as expected, e.g., via a Notebook?

Feel free to share the DQL Workflow Task with us, if you need further help.

rseibert1
Contributor

Here is the DQL task I am trying to access:

fetch logs
| filter contains(log.tag, "octopus_workers")
| parse content, "JSON:json"
| fieldsFlatten json
| expand json.content
| fieldsFlatten json.content
| expand json.content.alertText
| fieldsFlatten json.content.alertText
| fields timestamp, Id=json.content.alertText.Id, SpaceId=json.content.alertText.SpaceId, WorkerPoolIds=json.content.alertText.WorkerPoolIds, HealthStatus=json.content.alertText.HealthStatus, HasLatestCalamari=json.content.alertText.HasLatestCalamari,StatusSummary=json.content.alertText.StatusSummary, OperatingSystem=json.content.alertText.OperatingSystem

 

Here is a sample of the logs ingested before that DQL is run:

 

{
"alertText": [
{
"Id": "Workers-22",
"SpaceId": "Spaces-1",
"WorkerPoolIds": [
"WorkerPools-42"
],
"HealthStatus": "HasWarnings",
"HasLatestCalamari": true,
"StatusSummary": "This machine is running an old version of Tentacle (6.1.1403).",
"OperatingSystem": "Microsoft Windows Server 2019 Standard 10.0.17763.0"
},
{
"Id": "Workers-23",
"SpaceId": "Spaces-1",
"WorkerPoolIds": [
"WorkerPools-42"
],
"HealthStatus": "HasWarnings",
"HasLatestCalamari": false,
"StatusSummary": "This machine is running an old version of Tentacle (6.1.1403).",
"OperatingSystem": "Microsoft Windows Server 2019 Standard 10.0.17763.0"
},

 

Here is what that DQL looks like when run from a notebook:

rseibert1_0-1733481023505.png

 

 

From what I can see, everything looks fine for the Workflow.

I tried to reproduce your error, and I am able to do that by providing an Invalid DQL Statement in the DQL task:

christian_kreuz_0-1733483854517.png

Could you check the actual input of the DQL task? Are you using an expression somewhere in that task?

Hi Christian, 

I shared this above, but here is the input from the task that fails trying to access records from previous task:

{% for record in result("unhealthy_workers_table")["records"] %}
Id : {{ record.Id }}
{% endfor %}
 
rseibert1_0-1733741024083.png

 

 

In this case, you're trying to Preview something using the result of the task unhealthy_workers_table. That's a separate topic. Could you share a screenshot of a recent failing execution, showing which task failed and with what error message? Feel free to remove / gray out classified information on the screenshot.

I still believe there is something wrong with the DQL statement in that task, and a screenshot would help.

Featured Posts