Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bitnami/grafana] Read only filesystem error when any init scripts are present #24473

Closed
bpfoster opened this issue Mar 15, 2024 · 7 comments · Fixed by #24532
Closed

[bitnami/grafana] Read only filesystem error when any init scripts are present #24473

bpfoster opened this issue Mar 15, 2024 · 7 comments · Fixed by #24532
Assignees
Labels
grafana solved tech-issues The user has a technical issue about an application triage Triage is needed

Comments

@bpfoster
Copy link
Contributor

bpfoster commented Mar 15, 2024

Name and Version

bitnami/grafana 10.0.0

What architecture are you using?

amd64

What steps will reproduce the bug?

  1. Configure chart to install with a custom init script
  2. Get error

Are you using any custom parameters or values?

extraVolumes:
  - name: init-scripts
    configMap:
      name: "grafana-init-scripts"
extraVolumeMounts:
  - name: init-scripts
    mountPath: /docker-entrypoint-init.d

What is the expected behavior?

Chart installs as it did prior

What do you see instead?

grafana 12:39:20.18 INFO  ==> Executing /docker-entrypoint-init.d/..2024_03_15_12_17_10.2617271577/my-init.sh
touch: cannot touch '/bitnami/grafana/.user_scripts_initialized': Read-only file system

Additional information

I know you note in the chart readme that "This could potentially break any customization or init scripts used in your deployment. If this is the case, change the default values to the previous ones."

However I think that the readonly filesystem is a good thing, and I'm not sure that we should have to choose between it and having init scrpts.

Note that this has nothing to do with what the init script is doing. Yes, if my init script is trying to write to a readonly filesystem I would expect there to be issues. However the issue is in the container image's scripts - the container itself can't handle any init scripts when running on readonly fs.

The container is failing when writing the initialized marker file. Could you not alter that to write to one of the writable volumes mounted by the chart, e.g. /tmp or /opt/bitnami/grafana/tmp?
https://github.com/bitnami/containers/blob/main/bitnami/grafana/10/debian-12/rootfs/post-init.sh#L24

I see many other containers are also writing a similar marker file, so as you roll out the readonly changes across all charts I'd expect this same issue to pop up all over.

@bpfoster bpfoster added the tech-issues The user has a technical issue about an application label Mar 15, 2024
@github-actions github-actions bot added the triage Triage is needed label Mar 15, 2024
@javsalgar
Copy link
Contributor

Hi!

Thank you so much for reporting. I believe that adding an emptydir in /bitnami/grafana could potentially fix the issue. Before creating a PR, could you check if the following works?

grafana:
  extraVolumeMounts:
    - name: empty-dir
      mountPath: /bitnami/grafana
      subPath: app-volume-dir

@bpfoster
Copy link
Contributor Author

Hi, yes this approach does appear to resolve the issue.

@javsalgar
Copy link
Contributor

Hi! I created the PR above to fix the issue

@bpfoster
Copy link
Contributor Author

Thanks!

@TomRoush
Copy link
Contributor

@javsalgar Can this fix be applied to other charts that have support init scripts and read only file system enabled by default? I ran into the same problem with permissions with Elasticsearch, and I'm guessing that other charts will have the same issue

@javsalgar
Copy link
Contributor

Sure! Let me check them

@kedare
Copy link

kedare commented Jul 18, 2024

Same issue on the Keycloak chart for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
grafana solved tech-issues The user has a technical issue about an application triage Triage is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants