Get help from the marimo community

Updated 2 months ago

.marimo file - access permission issues with docker

At a glance

The community member is trying to deploy a Flask app with a Marimo endpoint to a Kubernetes cluster, but is encountering permission errors. On the local machine, the setup and routing work fine, but on the cloud, the community member is getting an OSError: [Errno 30] Read-only file system: '/home/appuser/.marimo' error. The community member does not want to give write privileges to the /home/appuser/.marimo folder.

In the comments, another community member suggests placing a .marimo.toml file in the directory where the app is running, so that Marimo doesn't try to create a new one. The original community member acknowledges this suggestion and says they got it.

There is no explicitly marked answer, but the comment provides a potential solution to the issue.

Problem you are facing/What is currently happening:

Currently I am trying to deploy a flask app with a marimo endpoint to a Kubernetes cluster, On localhost the setup and routing works fine.
asgi_app = Starlette(
routes=[
Route("/", endpoint=lambda request: RedirectResponse(url="/api/")),
Mount("/api", app=wsgi_app),
Mount("/", app=marimo_app.build()),
]
)

On the cloud we ran into several permission errors. We are creating a user and gave privileges to /tmp folder, but now encounter the error:
OSError: [Errno 30] Read-only file system: '/home/appuser/.marimo'
However, we do not want to give write privileges to that folder.

What would you expect to happen?
Maybe I do not understand the architecture well enough, but it would be nice to be able to specify a folder where marimo reads and writes the data. Here is some more information/trace

File "/usr/local/lib/python3.12/site-packages/marimo/_server/api/endpoints/ws.py", line 441, in get_session
new_session = mgr.create_session(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/marimo/_server/sessions.py", line 729, in create_session
self.recents.touch(app_file_manager.path)
File "/usr/local/lib/python3.12/site-packages/marimo/_server/recents.py", line 49, in touch
self.config.write_toml(state)
File "/usr/local/lib/python3.12/site-packages/marimo/_utils/config/config.py", line 45, in write_toml
_maybe_create_directory(self.filepath)
File "/usr/local/lib/python3.12/site-packages/marimo/_utils/config/config.py", line 67, in _maybe_create_directory
os.makedirs(marimo_directory)
File "<frozen os>", line 225, in makedirs
OSError: [Errno 30] Read-only file system: '/home/appuser/.marimo'



Is there something I can do to change the directory in which .marimo lies?
M
m
2 comments
You could place a .marimo.toml file in the directory you are running the app, so it’s not trying to create a new one. It’s just looking for the user configuration
Allright got it. Thanks for the help!
Add a reply
Sign up and join the conversation on Discord