langgenius / langgenius/dify-sandbox
raise OSError( OSError: Matplotlib requires access to a writable cache directory, but the default path (/root/.config/matplotlib) is not a writable directory, and a temporary directory could not be created; set the MPLCONFIGDIR environment variable to a writable directory error: exit status 255
- Dominant language
- Go
- Stars
- 1.3k
- Forks
- 326
- Avg merge
- 56m
- Merged PRs (30d)
- 3
Description
### Self Checks
- [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general).
- [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones.
- [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)).
- [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [X] Please do not modify this template :) and fill in all the required fields.
### Dify version
0.7.1
### Cloud or Self Hosted
Self Hosted (Docker)
### Steps to reproduce
Node [PY] 工作流输出 run failed: sandbox-python/tmp/68e7b735_8d47_4b5a_9cae_dcdf32e68c70.py", line 48, in File "", line 15, in File "/usr/local/lib/python3.10/site-packages/matplotlib/__init__.py", line 981, in dict.update(rcParams, _rc_params_in_file(matplotlib_fname())) File "/usr/local/lib/python3.10/site-packages/matplotlib/__init__.py", line 629, in matplotlib_fname for fname in gen_candidates(): File "/usr/local/lib/python3.10/site-packages/matplotlib/__init__.py", line 626, in gen_candidates yield os.path.join(get_configdir(), 'matplotlibrc') File "/usr/local/lib/python3.10/site-packages/matplotlib/__init__.py", line 339, in wrapper ret = func(**kwargs) File "/usr/local/lib/python3.10/site-packages/matplotlib/__init__.py", line 572, in get_configdir return _get_config_or_cache_dir(_get_xdg_config_dir) File "/usr/local/lib/python3.10/site-packages/matplotlib/__init__.py", line 540, in _get_config_or_cache_dir raise OSError( OSError: Matplotlib requires access to asandbox-python/tmp/68e7b735_8d47_4b5a_9cae_dcdf32e68c70.py", line 48, in File "", line 15, in File "/usr/local/lib/python3.10/site-packages/matplotlib/__init__.py", line 981, in dict.update(rcParams, _rc_params_in_file(matplotlib_fname())) File "/usr/local/lib/python3.10/site-packages/matplotlib/__init__.py", line 629, in matplotlib_fname for fname in gen_candidates(): File "/usr/local/lib/python3.10/site-packages/matplotlib/__init__.py", line 626, in gen_candidates yield os.path.join(get_configdir(), 'matplotlibrc') File "/usr/local/lib/python3.10/site-packages/matplotlib/__init__.py", line 339, in wrapper ret = func(**kwargs) File "/usr/local/lib/python3.10/site-packages/matplotlib/__init__.py", line 572, in get_configdir return _get_config_or_cache_dir(_get_xdg_config_dir) File "/usr/local/lib/python3.10/site-packages/matplotlib/__init__.py", line 540, in _get_config_or_cache_dir raise OSError( OSError: Matplotlib requires access to a writable cache directory, but the default path (/root/.config/matplotlib) is not a writable directory, and a temporary directory could not be created; set the MPLCONFIGDIR environment variable to a writable directory error: exit status 255
i got it, please help.
_Originally posted by @pyxsqbs in https://github.com/langgenius/dify-sandbox/issues/37#issuecomment-2522616574_
### ✔️ Expected Behavior
Run success!
### ❌ Actual Behavior
OSError( OSError: Matplotlib requires access to a writable cache directory, but the default path (/root/.config/matplotlib) is not a writable directory, and a temporary directory could not be created; set the MPLCONFIGDIR environment variable to a writable directory error: exit status 255
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the Python workflow in the self-hosted Docker setup and start by inspecting the sandbox Python execution environment around the reported Matplotlib import failure. Done means the workflow runs successfully without the writable-cache OSError; the payload does not name a source file or test to run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100