小白求教:应用设置的本地存储无法写入? #5151
Unanswered
xia0zuanfeng
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
问题描述
部署 langflow 应用,设置本地存储路径为 /data,设置环境变量 LANGFLOW_CONFIG_DIR=/data
遇到报错,看起来是无法写入 secret_key。
尝试在本地存储窗口 UI 上手动上传文件,创建文件夹,操作后没有任何响应。
PS:本人是一个产品经理,业余尝试部署生产力工具因此使用 sealos 部署 langflow,对代码知识了解十分有限。
本地存储配置如下
volumeMounts:
- name: vn-data
mountPath: /data
volumes: []
volumeClaimTemplates:
- metadata:
annotations:
path: /data
value: '5'
name: vn-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
报错代码
│ /app/.venv/lib/python3.12/site-packages/langflow/services/settings/utils.py: │
│ 32 in write_secret_to_file │
│ │
│ 29 │
│ 30 │
│ 31 def write_secret_to_file(path: Path, value: str) -> None: │
│ ❱ 32 │ with path.open("wb") as f: │
│ 33 │ │ f.write(value.encode("utf-8")) │
│ 34 │ try: │
│ 35 │ │ set_secure_permissions(path) │
│ │
│ ╭─────────────────────── locals ────────────────────────╮ │
│ │ path = PosixPath('/data/secret_key') │ │
│ │ value = 'PzYFzNd3C81kZk1rEO01QhiizJif6OowSqSZUE7gyWc' │ │
│ ╰───────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.12/pathlib.py:1013 in open │
│ │
│ 1010 │ │ """ │
│ 1011 │ │ if "b" not in mode: │
│ 1012 │ │ │ encoding = io.text_encoding(encoding) │
│ ❱ 1013 │ │ return io.open(self, mode, buffering, encoding, errors, newli │
│ 1014 │ │
│ 1015 │ def read_bytes(self): │
│ 1016 │ │ """ │
│ │
│ ╭─────────────────────── locals ────────────────────────╮ │
│ │ buffering = -1 │ │
│ │ encoding = None │ │
│ │ errors = None │ │
│ │ mode = 'wb' │ │
│ │ newline = None │ │
│ │ self = PosixPath('/data/secret_key') │ │
│ ╰───────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
PermissionError: [Errno 13] Permission denied: '/data/secret_key'
LANGFLOW_CONFIG_DIR 的用途
Beta Was this translation helpful? Give feedback.
All reactions