FileExistsError: [Errno 17] File exists: '/app/run/gui'

Has anyone experienced the error - FileExistsError: [Errno 17] File exists: '/app/run/gui' when trying to bring up the docker-based nomad-oasis app?

I tried the following solutions without success:

  • run a removal command (rm -rf /app/run/gui) inside docker (sudo docker exec -ti nomad_oasis_app /bin/bash) after executing sudo docker compose up.
  • Modified the command in yaml to clear that directory before running run.sh `

command: ["/bin/sh", "-c", "rm -rf /app/run/gui && ./run.sh"]

Anyone knows why this problem is happening and how I can solve this?

Portion of the logs added below:

nomad_oasis_app       |   File "/opt/venv/lib/python3.12/site-packages/nomad_plugin_gui/apis/__init__.py", line 75, in load
nomad_oasis_app       |     shutil.copytree(static_folder, run_gui_folder)
nomad_oasis_app       |   File "/usr/local/lib/python3.12/shutil.py", line 600, in copytree
nomad_oasis_app       |     return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
nomad_oasis_app       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
nomad_oasis_app       |   File "/usr/local/lib/python3.12/shutil.py", line 498, in _copytree
nomad_oasis_app       |     os.makedirs(dst, exist_ok=dirs_exist_ok)
nomad_oasis_app       |   File "<frozen os>", line 225, in makedirs
nomad_oasis_app       | FileExistsError: [Errno 17] File exists: '/app/run/gui'
nomad_oasis_app       | [2025-02-10 10:54:14 +0000] [27] [INFO] Worker exiting (pid: 27)
nomad_oasis_app       | [2025-02-10 10:54:14 +0000] [26] [INFO] Worker exiting (pid: 26)
nomad_oasis_app       | [2025-02-10 10:54:14 +0000] [29] [ERROR] Exception in worker process
nomad_oasis_app       | Traceback (most recent call last):
nomad_oasis_app       |   File "/opt/venv/lib/python3.12/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker
nomad_oasis_app       |     worker.init_process()
nomad_oasis_app       |   File "/opt/venv/lib/python3.12/site-packages/uvicorn/workers.py", line 75, in init_process
nomad_oasis_app       |     super().init_process()
nomad_oasis_app       |   File "/opt/venv/lib/python3.12/site-packages/gunicorn/workers/base.py", line 134, in init_process
nomad_oasis_app       |     self.load_wsgi()
nomad_oasis_app       |   File "/opt/venv/lib/python3.12/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
nomad_oasis_app       |     self.wsgi = self.app.wsgi()
nomad_oasis_app       |                 ^^^^^^^^^^^^^^^
nomad_oasis_app       |   File "/opt/venv/lib/python3.12/site-packages/gunicorn/app/base.py", line 67, in wsgi
nomad_oasis_app       |     self.callable = self.load()
nomad_oasis_app       |                     ^^^^^^^^^^^
nomad_oasis_app       |   File "/opt/venv/lib/python3.12/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
nomad_oasis_app       |     return self.load_wsgiapp()
nomad_oasis_app       |            ^^^^^^^^^^^^^^^^^^^
nomad_oasis_app       |   File "/opt/venv/lib/python3.12/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
nomad_oasis_app       |     return util.import_app(self.app_uri)
nomad_oasis_app       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
nomad_oasis_app       |   File "/opt/venv/lib/python3.12/site-packages/gunicorn/util.py", line 371, in import_app
nomad_oasis_app       |     mod = importlib.import_module(module)
nomad_oasis_app       |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
nomad_oasis_app       |   File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
nomad_oasis_app       |     return _bootstrap._gcd_import(name[level:], package, level)
nomad_oasis_app       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
nomad_oasis_app       |   File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
nomad_oasis_app       |   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
nomad_oasis_app       |   File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
nomad_oasis_app       |   File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
nomad_oasis_app       |   File "<frozen importlib._bootstrap_external>", line 995, in exec_module
nomad_oasis_app       |   File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
nomad_oasis_app       |   File "/opt/venv/lib/python3.12/site-packages/nomad/app/main.py", line 103, in <module>
nomad_oasis_app       |     api_app = entry_point.load()
nomad_oasis_app       |               ^^^^^^^^^^^^^^^^^^
nomad_oasis_app       |   File "/opt/venv/lib/python3.12/site-packages/nomad_plugin_gui/apis/__init__.py", line 75, in load
nomad_oasis_app       |     shutil.copytree(static_folder, run_gui_folder)
nomad_oasis_app       |   File "/usr/local/lib/python3.12/shutil.py", line 600, in copytree
nomad_oasis_app       |     return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
nomad_oasis_app       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
nomad_oasis_app       |   File "/usr/local/lib/python3.12/shutil.py", line 498, in _copytree
nomad_oasis_app       |     os.makedirs(dst, exist_ok=dirs_exist_ok)
nomad_oasis_app       |   File "<frozen os>", line 225, in makedirs
nomad_oasis_app       | FileExistsError: [Errno 17] File exists: '/app/run/gui'
nomad_oasis_app       | [2025-02-10 10:54:14 +0000] [29] [INFO] Worker exiting (pid: 29)
nomad_oasis_app       | [2025-02-10 10:54:14 +0000] [28] [INFO] Started server process [28]
nomad_oasis_app       | [2025-02-10 10:54:14 +0000] [28] [INFO] Waiting for application startup.
nomad_oasis_app       | [2025-02-10 10:54:17 +0000] [9] [ERROR] Worker (pid:26) exited with code 3
nomad_oasis_app       | [2025-02-10 10:54:17 +0000] [9] [ERROR] Worker (pid:27) was sent SIGTERM!
nomad_oasis_app       | [2025-02-10 10:54:17 +0000] [9] [ERROR] Worker (pid:29) was sent SIGTERM!
nomad_oasis_app       | [2025-02-10 10:54:47 +0000] [9] [ERROR] Shutting down: Master
nomad_oasis_app       | [2025-02-10 10:54:47 +0000] [9] [ERROR] Reason: Worker failed to boot.

Hi @sherin!

I think this error is related to the plugin nomad-pluging-gui. You are probably using one of our pre-build docker images as a basis for your Oasis?

The simplest option to fix this error would be to disable part of that plugin that is causing problems. You can do this through the nomad.yaml config file:

plugins:
  entry_points:
    exclude:
      - "nomad_plugin_gui.apis:gui_api"

Could you see if this fixes your problem? If this fixes the problem, we can create a better fix directly in the plugin itself.

excellent! it works for me! :heart_eyes:

But @laurih I’m wondering…if we disable parts of the plugin, will it mess things up for the user? Like, will any functionality stop working?

Awesome, then I also can create a fix in the plugin directly.

It is completely safe to disable this plugin entry point in your Oasis: it only contains a prototype of our new user interface.

Btw: instead of building your Oasis on top of our Docker image, we nowadays actually suggest that you build your very own image using nomad-distro-template: this way you can fully control which plugins get installed and also can better ensure plugin compatibility. We will have to update our documentation to reflect this as well.

1 Like

thanks for explaining about this :heart:. Looking forward to the updates that will happen to the documentation! :slight_smile: