4Rundeck 4.1.7 Bugs

119 views
Skip to first unread message

Roger McCarrick

unread,
Oct 2, 2023, 5:34:31 PM10/2/23
to rundeck-discuss
Just updated to 4.1.7

I run this command on the Rundeck command line to see all running jobs:

             for i in $(rd projects list | grep -v ^#); do echo $i;  rd executions list -p $i; done

Today it only half works.
I pull all entries from the Rundeck SQL database where status = scheduled.
It seems that after a scheduled job has started, in 4.1.7, it still says scheduled in the database until it is finished.
And it does not show up in  rd executions list -p <projectname>

I was monitoring scheduled jobs and then my monitor would show when those jobs were running.
Now it shows them as scheduled until they are actually finished running.

Also in the Rundeck GUI itself ... when I look at activity for a job, I see the running jobs (that were originally scheduled) and they have a spinning blue circle to the left and the progress bar says "undefined%".

I looked in the SQL database again and the jobs that are still really in the scheduled state have an outputfilepath of NULL. The running jobs still say scheduled but have an actual outputfilepath. I am curretly using that to distinguish  them but I would like the rd command to be able to find all running jobs no mater if they were run immediately or if they had been scheduled.
                        rd executions list -p <projectname>


thanks

Roger

rac...@rundeck.com

unread,
Oct 3, 2023, 8:53:30 AM10/3/23
to rundeck-discuss

Hi Roger,

Just tested successfully on 4.17 in the following way:

for i in $(rd projects list | grep -E -o '[a-zA-Z0-9_$%*@#]{10,}'); do echo $i; rd executions list -p $i; done

Now, to run this on the Rundeck commands section you need to “escape” the ' character in the following way:

for i in $(rd projects list | grep -E -o '''[a-zA-Z0-9_$%*@#]{10,}'''); do echo $i; rd executions list -p $i; done

Check the result here.

Hope it helps!

Roger McCarrick

unread,
Oct 3, 2023, 1:49:02 PM10/3/23
to rundeck-discuss
Hi, thanks for the reply.
I'm afraid none of these worked for me. Both gave the same result on the Rundeck linux command line.

 for i in $(rd projects list | grep -E -o '[a-zA-Z0-9_$%*@#]{10,}'); do echo $i;  rd executions list -p $i; done
DisasterRecovery
Error: Project does not exist: DisasterRecovery
[code: api.error.project.missing; APIv45]
Could not find resource: 404 Not Found
Implementation
# Running executions: 0 items
Implementation
# Running executions: 0 items
Network_Build
# Running executions: 0 items
Network_Build
# Running executions: 0 items
Onboarding
# Running executions: 0 items
Onboarding
# Running executions: 0 items

So firstly it says " Error: Project does not exist: DisasterRecovery" .... do not know why.

There are 14 projects. Here it just shows 4 projects and it repeats them. The regex in use only gets a subset of my projects, 
" rd projects list | grep -v ^#  " gets all the projects.

However this is all besides the point.
What exactly is "rd executions" doing? My guess is that it is looking in the database at the status field. But with the 4.1.7 update, the database shows those scheduled jobs that are now running, as 'scheduled' in the status field.
I ran a job NOW instead of scheduled, and in the database, the status field changed to "average-duration-exceeded".
Regardless of what this means, it is NOT 'scheduled' and the rd command catches it on the command line.
Jobs that were scheduled and are now running, do not get picked up by the rd command on the command line.

I need to run the rd command on the Linux command line and collect and parse the output. 
It looks like you ran it in the Rundeck GUI ... I haven't tried that yet. It would be interesting if it works but may not be of much use to me.

Also in the GUI when looking at running jobs in activity, the progress bar used to show percentage done. Now it shows "undefined%". Do you know why that is?

rac...@rundeck.com

unread,
Oct 3, 2023, 4:25:59 PM10/3/23
to rundeck-discuss
Hi Roger,

Just to replicate your scenario, what database backend are you using? What version of rundeck were you using before updating?

Regards.

Roger McCarrick

unread,
Oct 3, 2023, 4:39:56 PM10/3/23
to rundeck-discuss
I was on 4.1.0 ...
I am using SQL 2019

I actually have 2 Rundeck servers load balanced behind a Netscaler. Both are 4.1.7 (both were 4.1.0). They share a log directory on a network share.
They share the SQL database. The database server set up is 2 SQL servers in an availability group with failover.
Below is a screen shot of a job running.


undefPercent.png

Roger McCarrick

unread,
Oct 3, 2023, 7:53:13 PM10/3/23
to rundeck-discuss
Forgot to mention the Rundeck servers are RH Linux 9.0

rac...@rundeck.com

unread,
Oct 4, 2023, 10:27:28 AM10/4/23
to rundeck-discuss
Hi Roger,

Did you mean 4.10 > 4.17  or 4.1.0 > 4.17? (4.1.7 does not exist).

Another question, is that instance a Process Automation (formerly Rundeck Enterprise) instance? Rundeck OSS doesn't support clustered environments, Process Automation does.

Regards.

Roger McCarrick

unread,
Oct 4, 2023, 11:54:23 AM10/4/23
to rundeck-discuss
Apologies if I made a typo.
My version is 4.17 .. it was 4.10 something

 yum list rundeck
Updating Subscription Management repositories.
Last metadata expiration check: 0:04:04 ago on Wed 04 Oct 2023 11:46:38 EDT.
Installed Packages
rundeck.noarch                               4.17.0.20230925-1                               @rundeck

This is the community version of Rundeck it is not Enterprise and it is a not a real cluster.
I created a wannabe cluster as best as I could. But it is all Community.

thanks very much.

Roger

rac...@rundeck.com

unread,
Oct 5, 2023, 2:25:01 PM10/5/23
to rundeck-discuss

Hi Roger,

After some research, the “scheduled” status only happens when you schedule a job using the “Run job later” run option. That doesn’t happen when you use the job schedule tab (cron or simple). That’s the default behavior and this isn’t collected by the rd executions -p MyProject command, this command only gets the current executions (scheduled or not).

But drilling down the Rundeck API and playing a bit with the JQ tool, I made a call that prints only the running scheduled jobs based on the “executionType” JSON answer. Feel free to test and modify it:

#!/bin/sh # protocol protocol="http" # basic rundeck info rdeck_host="localhost" rdeck_port="4440" rdeck_api="45" rdeck_token="Uq4V5n9EGFKU0LjNEVwaaYeDvb3sC89y" rdeck_project="ProjectEXAMPLE" curl -s --location --request GET "$protocol://$rdeck_host:$rdeck_port/api/$rdeck_api/project/$rdeck_project/executions/running" --header "Accept: application/json" --header "X-Rundeck-Auth-Token:$rdeck_token" -- header "Content-Type: application json" | jq -r '.executions[] | select(.executionType=="scheduled") | .job | "\(.id) \(.name)"'

This prints the Job ID and Job Name of scheduled jobs running. Of course, this approach is improvable (e.g. you can get a list of all projects in a “for” loop and then apply this to every single project).

Regards.

Reply all
Reply to author
Forward
0 new messages