Permission Denied for Accessing Flask Caching
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.2k
- Forks
- 1.8k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 6
Description
I'm using a flask app starter code, and I'm running into this caching permission issue from vercel dashboard runtime logs when deployed on vercel with vercel —prod, but don't run into the issue when testing locally with vercel dev.
Is this a caching permission issue with edge functions?
[WARNING] 2023-03-27T04:17:56.207Z d820d1ac-8e93-4d09-a5a0-7f97292c013e Exception raised while handling cache file '/var/task/cache/2029240f6d1128be89ddc32729463129'
Traceback (most recent call last):
File "/var/task/cachelib/file.py", line 209, in get
with self._safe_stream_open(filename, "rb") as f:
File "/var/lang/lib/python3.9/contextlib.py", line 119, in __enter__
return next(self.gen)
File "/var/task/cachelib/file.py", line 330, in _safe_stream_open
fs = self._run_safely(open, path, mode)
File "/var/task/cachelib/file.py", line 324, in _run_safely
output = fn(*args, **kwargs)
PermissionError: [Errno 13] Permission denied: '/var/task/cache/2029240f6d1128be89ddc32729463129'[WARNING] 2023-03-27T04:17:56.208Z d820d1ac-8e93-4d09-a5a0-7f97292c013e Exception raised while handling cache file '/var/task/cache/2029240f6d1128be89ddc32729463129'
Traceback (most recent call last):
File "/var/task/cachelib/file.py", line 209, in get
with self._safe_stream_open(filename, "rb") as f:
File "/var/lang/lib/python3.9/contextlib.py", line 119, in __enter__
return next(self.gen)
File "/var/task/cachelib/file.py", line 330, in _safe_stream_open
fs = self._run_safely(open, path, mode)
File "/var/task/cachelib/file.py", line 324, in _run_safely
output = fn(*args, **kwargs)
PermissionError: [Errno 13] Permission denied: '/var/task/cache/2029240f6d1128be89ddc32729463129'[WARNING] 2023-03-27T04:17:56.208Z d820d1ac-8e93-4d09-a5a0-7f97292c013e Exception raised while handling cache file '/var/task/cache/85cd70373cda23597cde41f6a0be4bed'
Traceback (most recent call last):
File "/var/task/cachelib/file.py", line 248, in set
fd, tmp = tempfile.mkstemp(
File "/var/lang/lib/python3.9/tempfile.py", line 336, in mkstemp
return _mkstemp_inner(dir, prefix, suffix, flags, output_type)
File "/var/lang/lib/python3.9/tempfile.py", line 255, in _mkstemp_inner
fd = _os.open(file, flags, 0o600)
OSError: [Errno 30] Read-only file system: '/var/task/cache/tmpc8_tjfew.__wz_cache'
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the deployed Vercel runtime logs and the cachelib/file.py paths shown in the traceback, then compare them with the local vercel dev behavior. Confirm whether the Flask cache is attempting writes under /var/task/cache and document the supported configuration or reproduction steps for a writable cache location.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- flask, python
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100