Bug #20401
closedError while deleting new / imported Techniques
Description
Hello,
I have this strange behaviour when importing a technique. On gitter @Fdall ask me to create an issue here.
Infrastructure :
- PP Server : Rudder 6.2.11
- Prod Server : Rudder 6.2.10
What I did :
From my preprod I exported some of my techniques.
On prod server I import the files and save the technique.
After a technique's reload I wanted to create a directive, the technique doesn't show up. I first thought I failled to import properly and I try to delete the two techniques I created, but I get the follow error :
[2021-12-10 16:46:31+0100] ERROR com.normation.rudder.rest.RestUtils - "delete technique <- Inconsistency: No Technique with ID 'Deploy_SNMP/1.0' found in reference library."
(see picture).
The problem seem deeper. Since I want to deploy my new server with my technique I recreated my technique directly from de WebUI and not using the import tools.
But now I get the same error with fresh technique.
I hope, I give enough information if you need anything just ask.
best regards,
Elenui
Updated by Alexis TARUSSIO almost 3 years ago
- Category set to Web - Technique editor
Updated by Vincent MEMBRÉ almost 3 years ago
Thanks for reporting your issue!
Do you have any error logs after import ? Look for logs in ERROR, or keyword like "reload" "techniques" or the id "Deploy_SNMP"
maybe the technique was ok from the editor point of view, but Rudder failed to create a technique
You may also look for files in "/var/rudder/configuration-repository/techniques/ncf_techniques/Deploy_SNMP/1.0"
Is it possible for you to share the imported technique.json?
Updated by Alexis TARUSSIO almost 3 years ago
Hello Vincent,
Thanks for your quick Answer !!
Deploy SNMP.json is the technique I create manually from the web UI.
SNMPd Configuration V2.json is the technique I imported.
For the log file :
Webapp stderrout.log
./webapp/2021_12_10.stderrout.log:1980:[2021-12-10 15:42:03+0100] ERROR com.normation.rudder.rest.RestUtils - "delete technique <- Inconsistency: No Technique with ID 'Deploy_SNMP/1.0' found in reference library."
Apache :
./apache2/access.log:5903:MYIP - - [10/Dec/2021:15:30:52 +0100] "DELETE /rudder/secure/api/internal/techniques/Deploy_SNMP/1.0?force=false HTTP/1.1" 500 845 "https://myrudderinstance/rudder/secure/configurationManager/techniqueEditor" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36"
RudderLang :
/rudder-lang/Deploy_SNMP/rudderc_compile.log:13: "from": "/tmp/tmp.zCP9sD0PYE/Deploy_SNMP.rl", ./rudder-lang/Deploy_SNMP/rudderc_compile.log:14: "to": "/tmp/tmp.zCP9sD0PYE/Deploy_SNMP.rl.cf", ./rudder-lang/Deploy_SNMP/rudderc_compile.log:31: "from": "/tmp/tmp.Wk2aJ4T0R7/Deploy_SNMP.rl", ./rudder-lang/Deploy_SNMP/rudderc_compile.log:32: "to": "/tmp/tmp.Wk2aJ4T0R7/Deploy_SNMP.rl.cf", ./rudder-lang/Deploy_SNMP/rudderc_translate.log:9: "from": "/tmp/tmp.zCP9sD0PYE/Deploy_SNMP.json", ./rudder-lang/Deploy_SNMP/rudderc_translate.log:10: "to": "/tmp/tmp.zCP9sD0PYE/Deploy_SNMP.rl", ./rudder-lang/Deploy_SNMP/rudderc_translate.log:23: "from": "/tmp/tmp.Wk2aJ4T0R7/Deploy_SNMP.json", ./rudder-lang/Deploy_SNMP/rudderc_translate.log:24: "to": "/tmp/tmp.Wk2aJ4T0R7/Deploy_SNMP.rl",
For the file :
:/var/rudder/configuration-repository/techniques/ncf_techniques/Deploy_SNMP/1.0# ls -ltra total 28 drwxrws--- 3 root rudder 4096 déc. 10 15:29 .. drwxrws--- 2 root rudder 4096 déc. 10 15:29 . -rw-rw---- 1 root rudder 1814 déc. 10 15:40 technique.ps1 -rw-rw---- 1 root rudder 3660 déc. 10 15:40 technique.json -rw-rw---- 1 root rudder 3790 déc. 10 15:40 technique.cf -rw-rw---- 1 root rudder 897 déc. 10 15:40 rudder_reporting.cf -rw-rw---- 1 root rudder 2001 déc. 10 15:40 metadata.xml
regards,
Alexis TARUSSIO
Updated by Alexis TARUSSIO almost 3 years ago
Hello,
I tried again to do a full reboot cycle. With no luck, technique are still broken.
But I think I get something. Vincent ask me to do a git status inside : /var/rudder/configuration-repository/.
And this morning I have the idea to compare my Preprod git status with the production one :
PP :
rudderpreprod:/var/rudder/configuration-repository# git status Sur la branche master Modifications qui ne seront pas validées : (utilisez "git add/rm <fichier>..." pour mettre à jour ce qui sera validé) (utilisez "git checkout -- <fichier>..." pour annuler les modifications dans la copie de travail) supprimé : ncf/ncf-hooks.d/post.write_technique.10_commit.sh supprimé : ncf/ncf-hooks.d/post.write_technique.50_rudderify.sh Fichiers non suivis: (utilisez "git add <fichier>..." pour inclure dans ce qui sera validé) shared-files/ aucune modification n'a été ajoutée à la validation (utilisez "git add" ou "git commit -a")
Prod :
rudder:/var/rudder/configuration-repository# git status Sur la branche prod Modifications qui ne seront pas validées : (utilisez "git add/rm <fichier>..." pour mettre à jour ce qui sera validé) (utilisez "git checkout -- <fichier>..." pour annuler les modifications dans la copie de travail) supprimé : ncf/50_techniques/System_configuration/System_configuration.cf supprimé : ncf/ncf-hooks.d/post.write_technique.10_commit.sh supprimé : ncf/ncf-hooks.d/post.write_technique.50_rudderify.sh Fichiers non suivis: (utilisez "git add <fichier>..." pour inclure dans ce qui sera validé) shared-files/ aucune modification n'a été ajoutée à la validation (utilisez "git add" ou "git commit -a")
Something just hit me hard, something is wrong with git status. PP is on main and Prod is on Prod branch.
I check the config file and bingo, someone messed around with the config file and I think this is why my rudder's technique don't show up.
PP:
/var/rudder/configuration-repository/.git# cat config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true sharedrepository = 1 [receive] denyNonFastforwards = true [user] name = root user (CLI) email = root@localhost
Prod :
/var/rudder/configuration-repository/.git# cat config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true sharedrepository = 1 [receive] denyNonFastforwards = true [user] name = root user (CLI) email = root@localhost [remote "origin"] url = git@gitlab.mygitlab.fr:/project/rudder-files/client.git fetch = +refs/heads/*:refs/remotes/origin/*
I'll try to restore hit and try again.
best regards,
Alexis TARUSSIO
Updated by Alexis TARUSSIO almost 3 years ago
Hello,
So I did a restauration for my .git.
And now I get this :
root@rudder:/var/rudder/configuration-repository# git status fatal: unable to read tree 44da02aa1742effda47a8842e4c1046721f98edd
And now my rudder doesn't show any techniques on the UI.
Not fun for a friday morning.
But let's try to fix it and finish our week on a win.
root@rudder:/var/rudder/configuration-repository# git fsck --name-objects Vérification des répertoires d'objet: 100% (256/256), fait. broken link from tree 5d2b0f3c20230750ac6cf6dd30cf7a723da7869b (HEAD@{1639732957}:) to tree 44da02aa1742effda47a8842e4c1046721f98edd (HEAD@{1639732957}:groups/) broken link from tree 5d2b0f3c20230750ac6cf6dd30cf7a723da7869b (HEAD@{1639732957}:) to tree 5d638adace6a108183f6e3a8bca8e9862125a6d6 (HEAD@{1639732957}:rules/) broken link from tree 5d2b0f3c20230750ac6cf6dd30cf7a723da7869b (HEAD@{1639732957}:) to tree 797cb07c4f6f32ff4bec6ddb5ddbc4230c950b65 (HEAD@{1639732957}:techniques/) dangling blob 2b40741f39ab0933d1c67375923918578ac47bb9 dangling blob 65c1a00629f9aa600fd99b53984f6ea8c1d8cb93 dangling blob 3b5309736045062b2cdc7df71675b2a03a886f60 dangling blob 4297dfb376a07fc7cce43a991248900d42c1805b missing tree 44da02aa1742effda47a8842e4c1046721f98edd (HEAD@{1639732957}:groups/) dangling blob f22222733ff77dda4c95a4bf4fa61ef7c8f527f3 missing tree 5d638adace6a108183f6e3a8bca8e9862125a6d6 (HEAD@{1639732957}:rules/) dangling blob 682d45a23027f5dd231af8b0e6eb692b71515bbb dangling blob a3710d92fa60df360e766b2317d6a01dc3dbfb53 dangling blob 5ff9ede493500579a285d45747d671d4a9f0068b missing tree 797cb07c4f6f32ff4bec6ddb5ddbc4230c950b65 (HEAD@{1639732957}:techniques/)
I use a git stash to be clean and it's working now, my git's commands works and my techniques shows up on the UI.
root@rudder:/var/rudder/configuration-repository# git stash fatal: unable to read tree 44da02aa1742effda47a8842e4c1046721f98edd fatal: unable to read tree 44da02aa1742effda47a8842e4c1046721f98edd Copie de travail et état de l'index sauvegardés dans WIP on master: d4de50c Saving updated generic methods definition HEAD est maintenant à d4de50c Saving updated generic methods definition root@rudder:/var/rudder/configuration-repository# git status Sur la branche master Fichiers non suivis: (utilisez "git add <fichier>..." pour inclure dans ce qui sera validé) shared-files/ aucune modification ajoutée à la validation mais des fichiers non suivis sont présents (utilisez "git add" pour les suivre)
And I can finally delete / edit my technique.
Thanks @Vincent for putting me on the right track.
Maybe it'll help someone ;).
Best regards,
Alexis TARUSSIO
Updated by François ARMAND almost 3 years ago
- Related to Bug #20520: Error while importing ncf techniques using the restore from latest commit feature added
Updated by Alexis TARUSSIO over 2 years ago
Hello,
is it possible to mark this ticket as closed plz ?
I can't do it.
regards,
Alexis TARUSSIO