No output for manifest or remotes #140
Labels
No labels
bugfix
cleanup
discussion
documentation
doing
done
feature
improvement
packaging
Stale
testing
TODO
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ungleich-public/cdist#140
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Created by: antifob
Commit
9703e0f08e"broke" things for us.We used to, among other things, trace execution by calling
set -xfrom inside our remote scripts. This patch silences the output.Why was this change introduced? Why is there no documentation? And why is there no way to configure this behavior?
Created by: antifob
👍
Created by: darko-poljak
@uqam-fob @asteven @tom-ee https://github.com/darko-poljak/cdist/tree/output_streams_switch
Can you clone my repo and test this branch?
If you run cdist config as usual then output streams will be saved.
If you run cdist config with
-Soption then saving output streams should be disabled.@tom-ee Yes, those files are saved to cache only after run has finished. In case of error those files are not saved to cache. But tmp directory is not removed and all known info is printed, e.g.
Since it is not removed, you can discover tmp dir.
With new
-Soption the output is as the following:Created by: tom-ee
I'd second adding a switch to disable the "save output streams". In particular the
stderr/*- andstdout/*-files created by the new features are only available after the config-run has finished.The
messages-file is only created if the config-run does not error-out. Is this also the case for output-streams?Created by: antifob
@asteven Yes, I understand the problem and why it might be desired. Overall, I think it is a good solution. I just don't see why it should be forced on users.
@darko-poljak This looks like a good change for us. Whether the default or not, if the feature can be opted-in/-out, it would be greatly appreciated 👍 Documentation would help to prevent confusion too, so would be a nice addition.
Created by: darko-poljak
@uqam-fob @asteven Adding option to turn this off shouldn't be hard. I will take this task and this new command line/config option. If you agree, by default, saving output streams will be turned on.
I also plan to add docs chapter where saving output streams will be described/explained in more details.
Created by: asteven
I understand your problem: it used to work, now it doesn't. Without you changing anything yourself. That sucks from a users point of view.
I implemented the output stream capturing because I had some real problems debugging things when running multiple cdist runs in parallel. The unexpected output, e.g. warning and error messages from commands run in generated code are all printed in random order to stderr. There's no prefix, like we have for log messages. You simply don't have a clue which warning/error message belongs to which command.
This is now cleanly handled. All created output is bound to the context where it was produced. Overall I think this is a big win and I want to stick to this feature.
But we can discuss if/how we can make the output capturing optional. Problem is that it could hurt performance. We will investigate.
For debugging remote-copy and remote-exec I also run them with
set -x. But I send that output to a file. Would that also work for you? IMHO while running remote-exec withset -xthere's so much output that it's almost useless if not redirected to a dedicated file.Created by: antifob
Thanks for the information.
When I wrote "remote scripts", I was mentioning "remote-copy" and "remote-exec" scripts; as this patch affects more than the scripts you mentioned. Knowing exactly what commands are executed helps us analyzing the execution and what is being done on our systems. Also,
set -xonly prints executed commands to stderr, nothing specific about shell scripts here.I understand it might be useful to silence output sometimes, but I don't think having code totally silenced is useful or even desired. Of course, we could collect the information as an after-fact, or write a program that constantly polls output files and prints them to the screen, but I don't believe it is an elegant solution as it blocks real-time feedback and the notion of a timeline (can it even be reconstructed?).
A switch to turn this off would provide backward-compatibility, or having access to a facility that would allow messages to be printed to the screen would be useful here.
Makes me wonder if ssh connection prompts (e.g. accept certificates) are hidden now.
Created by: darko-poljak
@uqam-fob The reason for implementing output-streams: important information was lost during a config run, hidden in all the other output.
We now store all that, including error messages.
This all is saved into following files under host entry (sub-directory) under ~/.cdist/cache:
and for each object under
there could be files like manifest, gencode-remote, code-remote, gencode-local, code-local (if output was produced) which contain stdout/stderr content.
Setting set -x and seeing the output is sort of what one would expect when running a shell script. Then again we're not just running shell scripts.
Also, now in case of an error, cdist can exit and show all information it has about the error.
Can you use this new saved output streams?