Troubleshooting Frontend Log Access Issue with Helm Deployment

Original Slack Thread

Hi Team, hope everyone is doing well!

We are not able to get frontend logs within helm deployment for version 0.11.0. Due to some reasons we need to run pod and container as non root user and for that we set securityContext to runAsNonRoot: true
runAsUser: 100.
This way it will not have access to other folders like /tmp and it is not able to give logs and giving below error -

Failed to create parent directories for [/tmp/datahub/logs/datahub-frontend/datahub-frontend.log]

If anyone can help to figure out the solution.


Hmm <@U063WTWMH2L> could you look into this?

I’m not sure I understand the problem. The docker image in datahub-frontend by default runs from datahub user (uid = 100), there’s no need to override securityContext for that. All the files that datahub creates are also created with that uid, which is accessible by both datahub and if I exec into the pod, or via kubectl logs.

Can you provide some more details? How are you accessing the logs, what specific error message are you getting?

Hi, I am trying to get the logs using this command:

kubectl get logs datahub-datahub-frontend -n datahub

Error: Failed to create parent directories for [/tmp/datahub/logs/datahub-frontend/datahub-frontend.log]

This message doesn’t seem to be from kubectl… I believe the correct command to get logs would be kubectl -n datahub logs datahub-datahub-frontend-nnnnnnnn-nnnn where datahub-datahub-frontend-nnnnnnnn-nnnn is the name of a frontend pod

Can you get logs from any other pod?