rundeck / rundeck

Enable Self-Service Operations: Give specific users access to your existing tools, services, and scripts
http://rundeck.org
Apache License 2.0
5.57k stars 925 forks source link

Updating a JOB Crontab Schedule doesn't save new value #6304

Closed ruiplcorreia closed 4 years ago

ruiplcorreia commented 4 years ago

Description: Cannot update schedule on the Jobs/deployments, editing an existing job after the update and changing only the year on the crontab doesn't keep the new time.

Rundeck Details:

To Reproduce Steps to reproduce the behavior:

  1. Go to Jobs -> Deployments
  2. Click on the Job to edit and pick the Schedule tab
  3. Change the Crontab value (in this case just the year) and save
  4. New value is only kept the first time, if you edit a second time it does not keep the value.

Expected behavior The new schedule should be always kept on the crontab field.

Screenshots If applicable, add screenshots to help explain your problem. image

Desktop (please complete the following information):

1kUHuiswkvj7spRO commented 4 years ago

Can confirm, the time remaining icon also reflects previous values set Screenshot_2020-07-23_08-50-24

This job was originally set to run every 24 hours. I have changed it to run every 15 minutes, which through the job history I can confirm that it is indeed ran every 15 minutes. The screenshot above displays the old time.

MegaDrive68k commented 4 years ago

Hi @ruiplcorreia and @booshlinux

Your 3.3.0 instance is upgraded from another old instance? In that case, which version?

Regards!

ruiplcorreia commented 4 years ago

Hi @MegaDrive68k,

Upgraded instance from version 3.2.8.

Regards

1kUHuiswkvj7spRO commented 4 years ago

I upgraded from 3.2.6.

Thanks @MegaDrive68k

MegaDrive68k commented 4 years ago

Confirmed in this way:

1) Set a scheduled date to a job with a simple schedule :

Screenshot_1

2) The job is scheduled normally:

Screenshot_2

3) Edit the job:

Screenshot_3

4) The job doesn't change the scheduled time:

Screenshot_4

Tested on Rundeck 3.3.0/3.3.1-SNAPSHOT+H2 & Rundeck 3.3.0/3.3.1-SNAPSHOT+PostgreSQL.

NOTE 1: This happening with job definitions from "old" rundeck versions, this doesn't happen with jobs created on 3.3.0. I used this one:

<joblist>
  <job>
    <defaultTab>summary</defaultTab>
    <description>Regex and data passing demo.</description>
    <executionEnabled>true</executionEnabled>
    <id>a0daf1e3-e918-43dc-b232-bc46a7a287b6</id>
    <loglevel>INFO</loglevel>
    <name>Regex</name>
    <nodeFilterEditable>false</nodeFilterEditable>
    <scheduleEnabled>true</scheduleEnabled>
    <sequence keepgoing='false' strategy='node-first'>
      <command>
        <exec>env</exec>
      </command>
      <command>
        <exec>echo ${data.SHELL}</exec>
      </command>
      <command>
        <exec>echo ${data.USER}</exec>
      </command>
      <command>
        <exec>echo ${data.PWD}</exec>
      </command>
      <pluginConfig>
        <LogFilter type='key-value-data'>
          <config>
            <logData>true</logData>
            <regex>^(SHELL|USER|PWD)\s*=\s*(.+)$</regex>
          </config>
        </LogFilter>
      </pluginConfig>
    </sequence>
    <uuid>a0daf1e3-e918-43dc-b232-bc46a7a287b6</uuid>
  </job>
</joblist>

NOTE 2: Happening on 3.3.1-SNAPSHOT too.

1kUHuiswkvj7spRO commented 4 years ago

That describes the bug I'm seeing perfectly.

ruiplcorreia commented 4 years ago

Any planned release to deliver this fix?

gschueler commented 4 years ago

I'm unable to reproduce this using 3.3.3 release @MegaDrive68k

MegaDrive68k commented 4 years ago

Hi @gschueler

The issue occurs when you use job definitions from Rundeck 3.0/3.1/3.2 (check the "NOTE 1").

I tested with the following job dfinition (from Rundeck 3.0.X) under 3.3.3 release and the issue persist:

<joblist>
  <job>
    <defaultTab>summary</defaultTab>
    <description>Regex and data passing demo.</description>
    <executionEnabled>true</executionEnabled>
    <id>a0daf1e3-e918-43dc-b232-bc46a7a287b6</id>
    <loglevel>INFO</loglevel>
    <name>Regex</name>
    <nodeFilterEditable>false</nodeFilterEditable>
    <scheduleEnabled>true</scheduleEnabled>
    <sequence keepgoing='false' strategy='node-first'>
      <command>
        <exec>env</exec>
      </command>
      <command>
        <exec>echo ${data.SHELL}</exec>
      </command>
      <command>
        <exec>echo ${data.USER}</exec>
      </command>
      <command>
        <exec>echo ${data.PWD}</exec>
      </command>
      <pluginConfig>
        <LogFilter type='key-value-data'>
          <config>
            <logData>true</logData>
            <regex>^(SHELL|USER|PWD)\s*=\s*(.+)$</regex>
          </config>
        </LogFilter>
      </pluginConfig>
    </sequence>
    <uuid>a0daf1e3-e918-43dc-b232-bc46a7a287b6</uuid>
  </job>
</joblist>

If you set "simple schedule" and save, re-edit the job to switch to "crontab schedule" and save again, the job keeps with the first saved attempt ("simple schedule").

h4c5 commented 3 years ago

Hello, I know this issue has been closed but I found a workaround that might help someone : using "edit job" > "load a definition" works.