rundeck / rundeck

Enable Self-Service Operations: Give specific users access to your existing tools, services, and scripts

Home Page:http://rundeck.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

4.17.4 deletes/loses ALL project configs for all projects - reproducible

pob8888 opened this issue · comments

Describe the bug
Fully working rundeck with multiple projects, configured with node lists etc will delete and lose all projects configs

My Rundeck detail

  • Rundeck version: 4.17.4
  • install type: deb
  • OS Name/version: ubuntu 20.04
  • DB Type/version: mysql (off-host)

To Reproduce
Steps to reproduce the behavior:
Have multiple projects defined, with each project having (under edit configuration) a description, execution history clean enabled, and default node executor + default file copier setup with ssh + scp respectively.
Under project settings -> edit nodes, have valid node sources defined (we have ansible resource model source)
(I am not 100% sure on whether the above mentioned configs are required to trigger this bug, but these are what we have)

export RD_TOKEN=
export RD_URL=https://dev.rundeck.<ourdomain.com>

for i in `rd projects list | grep -v ^#`
do         
 rd projects configure set -p $i -- --project.gui.motd.display=projectList,projectHome,navbar
 rd projects readme put -p $i -m -t 'this is a test'
done

for i in `rd projects list | grep -v ^#`
do 
  rd projects configure set -p $i -- --project.gui.motd.display=''
 rd projects readme delete -p $i -m; done
done

Now, go back into the UI, and go to any project... under Project settings, ALL settings are lost, and under Edit Nodes, all node sources are lost

Expected behavior
Project MOTD to be added, then removed, without nuking all the configuration for all projects

Desktop (please complete the following information):

  • OS: MacOS
  • Browser Chrome
  • Version 120.0.6099.129

Additional context
We were running 4.16.0, then updated to 4.17.4
I ran the above rd cli commands to try and set a MOTD to all projects, then removed it again (it did add the motd to each project).
Next visit to the UI, and all projects are missing their configs, and as a result, all missing their node lists.

I then re-installed 4.16.0, reconfigured all projects, and repeated the upgrade and the rd cli commands to prove if this was repeatable - and for the 2nd time, all projects have lost their configs

Further testing suggests the thing that breaks everything is:

for i in `rd projects list | grep -v ^#`
do         
 rd projects configure set -p $i -- --project.gui.motd.display=projectList,projectHome,navbar
 rd projects readme put -p $i -m -t 'this is a test'
done

Nothing else is required

The example for setting the project motd display was taken from https://docs.rundeck.com/docs/manual/projects/project-motd.html#cli-usage

Further reading of the api documentation confirms this is user-error...
it should be rd projects configure update -p <project> -- --project.gui.motd.display=projectList,projectHome,navbar

However, the example in the documentation does not make it clear that this remove all other values ... can the documentation be updated to make this explicitly clear:
https://docs.rundeck.com/docs/manual/projects/project-motd.html#cli-usage

Hi @pob8888,

That's correct, I'll send a doc update for that.

Thank you for your feedback!

Thank you for addressing - this will hopefully save someone else from the pain/embarassment of running this incorrectly in the future!