Project

General

Profile

Actions

Bug #17977

closed

Resource automatically added on newly created technique - since 6.1 upgrade

Added by Nicolas Ecarnot over 3 years ago. Updated over 3 years ago.

Status:
Released
Priority:
N/A
Category:
Web - Technique editor
Target version:
Severity:
Major - prevents use of part of Rudder | no simple workaround
UX impact:
User visibility:
Getting started - demo | first install | Technique editor and level 1 Techniques
Effort required:
Priority:
70
Name check:
To do
Fix check:
Checked
Regression:

Description

All this began after 6.1 upgrade. Previously, nothing wrong happened.

When creating a blank and very simple custom technique, Rudder automatically adds a resource :
" shared-files/sit-rudder ${resources_dir}/shared-files/sit-rudder "
though I did not use any resource or add anything related to it.

This situation is severe as following this issue, the rules often fails to be generated until I disable everything related to this technique (the technique, the directives using it...)

Context :

Previously, I added the directory /var/rudder/configuration-repository/shared-files/sit-rudder which I'm using as a source for several other directives (but not this technique).
This sit-rudder directory is itself a git clone from another external git repository.
Please note that /var/rudder/configuration-repository is git-controlled.

In /var/rudder/configuration-repository, I can see this :

root@sit-conf-prd01:/var/rudder/configuration-repository# git status 
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   shared-files/sit-rudder (new commits)

no changes added to commit (use "git add" and/or "git commit -a")

The /var/rudder/configuration-repository/techniques/ncf_techniques/abcde01/1.0/metadata.xml file (created on this test) contains :

[...]
<FILE name="RUDDER_CONFIGURATION_REPOSITORY/techniques/ncf_techniques/abcde01/1.0/resources/shared-files/sit-rudder">
  <INCLUDED>false</INCLUDED>
  <OUTPATH>abcde01/1.0/resources/shared-files/sit-rudder</OUTPATH>
</FILE>
[...]

Would it help if I provide git-related information about /var/rudder/configuration-repository?

Workaround

As the problem is located in jgit library, we can't correct it immediatly.
A workaround is to ignore the sub-gig repository. It will still be a git repository, and files in it will still be shareable, but it will stop confusing everything in rudder.

- on root server, go to /var/rudder/configuration-repository
- remove from git knowledge sub-git: git rm -r --cached shared-files/sit-rudder
- add to /var/rudder/configuration-repository/.gitignore (create it if necessary) line: shared-files/sit-rudder
- add gitignore change (rm is already added): git add .gitignore
- commit: git commit -m "Forgeting about sub-repos, it's causing too much troubles"
- done.


Files


Related issues 1 (0 open1 closed)

Related to Rudder - Bug #17939: After upgrade from 6.0 to 6.1, deleted technique in editor still present in techniques repos breaks generationRejectedActions
Actions #1

Updated by François ARMAND over 3 years ago

  • Assignee set to Vincent MEMBRÉ
  • User visibility changed from Operational - other Techniques | Rudder settings | Plugins to Getting started - demo | first install | Technique editor and level 1 Techniques
  • Priority changed from 76 to 94

Some more information:

- it happens with an other user / an other browser
- it breaks a lot of things - it is likely the root cause of #17939

We must ensure that:

- the "check if something changed" feature is BY TECHNIQUE ID,
- we clean up session storage at login/logout,
- we don't check for resources anywhere but in technique directory.

Updated by François ARMAND over 3 years ago

Reproduced with:

- git clone a sit-rudder repo under /var/rudder/configuration-repository/shared-files/
- git add shared-files,
- git commit,
- modify something under sit-rudder and commit in that repos.

Result:


Actions #3

Updated by François ARMAND over 3 years ago

Created a simple reproducer: it's located in JGit (see attached file in https://bugs.eclipse.org/bugs/show_bug.cgi?id=565251)

Actions #4

Updated by François ARMAND over 3 years ago

  • Description updated (diff)
  • Severity changed from Critical - prevents main use of Rudder | no workaround | data loss | security to Major - prevents use of part of Rudder | no simple workaround
  • Priority changed from 94 to 70

Add a workaround.

Actions #5

Updated by François ARMAND over 3 years ago

  • Category set to Web - Technique editor
  • Target version set to 6.1.2
Actions #6

Updated by François ARMAND over 3 years ago

  • Status changed from New to In progress
  • Assignee changed from Vincent MEMBRÉ to François ARMAND
Actions #7

Updated by François ARMAND over 3 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from François ARMAND to Vincent MEMBRÉ
  • Pull Request set to https://github.com/Normation/rudder/pull/3127
Actions #8

Updated by François ARMAND over 3 years ago

  • Related to Bug #17939: After upgrade from 6.0 to 6.1, deleted technique in editor still present in techniques repos breaks generation added
Actions #9

Updated by François ARMAND over 3 years ago

  • Status changed from Pending technical review to Pending release
Actions #10

Updated by Nicolas Ecarnot over 3 years ago

Alas, the .gitignore get overwritten quickly, so the workaround only works for a moment.

Actions #11

Updated by Elaad FURREEDAN over 3 years ago

  • Fix check changed from To do to Checked
Actions #12

Updated by François ARMAND over 3 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 6.1.2 which was released today.

Actions

Also available in: Atom PDF