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

PermissionError: [Errno 13] Permission denied: '/tmp/qn-regions-cache.jsonl.shrink' in Ubuntu #454

Open
touero opened this issue Nov 28, 2024 · 1 comment · May be fixed by #457
Open

PermissionError: [Errno 13] Permission denied: '/tmp/qn-regions-cache.jsonl.shrink' in Ubuntu #454

touero opened this issue Nov 28, 2024 · 1 comment · May be fixed by #457

Comments

@touero
Copy link

touero commented Nov 28, 2024

python version: 3.10
qiniu sdk: 7.15.0
how start my process?: subprocess.Popen in root

File "/usr/local/lib/python3.10/dist-packages/qiniu/services/storage/uploader.py", line 116, in put_file
    ret, info = _form_put(
  File "/usr/local/lib/python3.10/dist-packages/qiniu/services/storage/uploader.py", line 153, in _form_put
    return uploader.upload(
  File "/usr/local/lib/python3.10/dist-packages/qiniu/services/storage/uploaders/form_uploader.py", line 125, in upload
    ret, resp = self.__upload_data_with_retrier(
  File "/usr/local/lib/python3.10/dist-packages/qiniu/services/storage/uploaders/form_uploader.py", line 157, in __upload_data_with_retrier
    for attempt in retrier:
  File "/usr/local/lib/python3.10/dist-packages/qiniu/retry/retrier.py", line 28, in __iter__
    retrying.init_context()
  File "/usr/local/lib/python3.10/dist-packages/qiniu/retry/retrier.py", line 110, in init_context
    policy.init_context(self.context)
  File "/usr/local/lib/python3.10/dist-packages/qiniu/http/regions_retry_policy.py", line 38, in init_context
    self._init_regions(context)
  File "/usr/local/lib/python3.10/dist-packages/qiniu/http/regions_retry_policy.py", line 76, in _init_regions
    regions = list(self.regions_provider)
  File "/usr/local/lib/python3.10/dist-packages/qiniu/http/regions_provider.py", line 418, in __iter__
    self.__shrink_cache()
  File "/usr/local/lib/python3.10/dist-packages/qiniu/http/regions_provider.py", line 649, in __shrink_cache
    with open(shrink_file_path, 'a') as f:
PermissionError: [Errno 13] Permission denied: '/tmp/qn-regions-cache.jsonl.shrink'

image

@touero touero changed the title Ubuntu下/tmp/qn-regions-cache.jsonl.shrink权限问题 PermissionError: [Errno 13] Permission denied: '/tmp/qn-regions-cache.jsonl.shrink' in Ubuntu Nov 28, 2024
@lihsai0
Copy link
Collaborator

lihsai0 commented Dec 5, 2024

@touero 非常感谢您的报告。

在修复前,您可以先使用同一个用户来运行您的程序。还有一种方式是暂时禁用掉文件缓存,不过会稍微复杂一点,如果您需要可以继续追问。

十分抱歉对您的使用造成了困扰。再次感谢您的报告。


Thanks for your report.

You can start your process with same user. Another way is disable the file cache, but will need more code to approach it. Comment more if you need that.

Sincere apologies for the issue have caused in your usage. And thanks again for your report.

@lihsai0 lihsai0 linked a pull request Dec 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants