This message was deleted.
# atlantis-community
s
This message was deleted.
p
Coming up next, in the episode of "Sorry for my stupid suggestion", have you checked the logs during the execution of the pre/post workflow hooks?
j
The logs files are actually empty, but the correct actions are being taken by the scripts producing them.
but if the script is executed outside of atlantis (but still in the container) with the same command
backup-manager.sh | tee /opt/atlantis/backup.log
the logs are written.
p
From my experience (not a pro level user) the logs usually indicate the invocation of the pre/post workflow hooks so not sure why they are empty
j
The atlantis logs show that the pre/post scripts ran without error, but don't show the stdout content. That's why the tee command is there, but that outputs nothing. It's weird because the python script out DOES appear. They're all being called by bash in the same way. It's very odd.
p
I know it does not make much sense but could you try to remove the
tee
commands just for the sake of it?
j
Oh, I was originally running them without the tee commands. There's no output there at all when run that way. They still work either way.
p
damn 😛
j
originally I was hoping they would show up in the atlantis 'jobs' page that you get for the actual terraform run, but it's clear to me now that pre and post hooks specifically don't output there
p
yeah that's true with the hooks
j
someone suggested using the stored github credential to post them to PR comments, and that may be the route I take next here since the log file is a bust
👍 1
thanks for the input! 🙂
p
no problem sorry I wasn't much of a help
j
All good!
@Pantelis Karamolegkos I actually just figured this out. Looks like bash output from the pre/post workflow command runners are going to stderr, not stdout. So to get logfile output I had to run this as
backup-manager.sh 2>&1 | tee <logfile>
p
good catch! glad you figured it out, I know the feeling of being tortured by such issues 👏
j
oh the pain 😄
😃 1