Output from init container 'init-directories' logged at level ERROR. #701

Open
opened 2024-08-23 13:29:01 +00:00 by tobiasbp · 8 comments
tobiasbp commented 2024-08-23 13:29:01 +00:00 (Migrated from gitea.com)

Running Gitea in Kubernetes (GKE), the output from the init-directories container is logged at severity ERROR. I believe that is incorrect, and the level should be INFO. Can I do a configuration change to address this, or does it need to be fixed in the chart itself?
I'm wondering why the output of the other init containers is not logged at level ERROR?

Example from the GKE GUI:
image.png

Running _Gitea_ in _Kubernetes_ (GKE), the output from the _init-directories_ container is logged at severity _ERROR_. I believe that is incorrect, and the level should be _INFO_. Can I do a configuration change to address this, or does it need to be fixed in the chart itself? I'm wondering why the output of the other _init containers_ is not logged at level _ERROR_? Example from the _GKE_ GUI: <img width="307" alt="image.png" src="attachments/66237b7f-841e-47d1-8b38-e1663a91cb5e">
tobiasbp commented 2024-08-26 08:48:09 +00:00 (Migrated from gitea.com)

The script, init_directory_structure.sh, that is being run in the container, seems to be here: 036b469ff9/templates/gitea/init.yaml (L14)

The script, _init_directory_structure.sh_, that is being run in the container, seems to be here: https://gitea.com/gitea/helm-chart/src/commit/036b469ff9d4c2c3fe385eb623d7356157140c69/templates/gitea/init.yaml#L14
tobiasbp commented 2024-08-26 10:25:08 +00:00 (Migrated from gitea.com)

It seems to me, that the problem might be with the set -x command used in the script. Someone is having a similar problem here: https://stackoverflow.com/questions/66815412/redirect-set-x-set-o-xtrace-to-standard-output

It seems to me, that the problem might be with the _set -x_ command [used in the script](https://gitea.com/gitea/helm-chart/src/commit/036b469ff9d4c2c3fe385eb623d7356157140c69/templates/gitea/init.yaml#L27). Someone is having a similar problem here: https://stackoverflow.com/questions/66815412/redirect-set-x-set-o-xtrace-to-standard-output
tobiasbp commented 2024-08-27 13:46:32 +00:00 (Migrated from gitea.com)

It looks to me like the set -x was added by @justusbunsi in this PR: https://gitea.com/gitea/helm-chart/pulls/178

It looks to me like the _set -x_ was added by @justusbunsi in this PR: https://gitea.com/gitea/helm-chart/pulls/178
pat-s commented 2024-08-28 08:35:52 +00:00 (Migrated from gitea.com)

Interesting! I didn't know this.

I think you're right, set -x is logging to stderr and hence you're seeing them logged as you described.

@justusbunsi Are you ok with removing set -x in this case?

Interesting! I didn't know this. I think you're right, `set -x` is logging to stderr and hence you're seeing them logged as you described. @justusbunsi Are you ok with removing `set -x` in this case?
techknowlogick commented 2024-08-28 17:30:21 +00:00 (Migrated from gitea.com)

I think set -x could be removed in this case, but perhaps some echo statements could be added in, so the progress of the script is still tracked.

I think `set -x` could be removed in this case, but perhaps some echo statements could be added in, so the progress of the script is still tracked.
tobiasbp commented 2024-08-29 06:50:42 +00:00 (Migrated from gitea.com)

I'm happy to make a PR for that. Should I go ahead?

I'm happy to make a PR for that. Should I go ahead?
pat-s commented 2024-08-29 09:15:48 +00:00 (Migrated from gitea.com)

Yes, thanks!

Yes, thanks!
tobiasbp commented 2024-09-02 12:55:26 +00:00 (Migrated from gitea.com)
My PR is ready for review: https://gitea.com/gitea/helm-chart/pulls/708
Sign in to join this conversation.
No Milestone
No project
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lunny/helm-chart#701
No description provided.