最近,不知道怎么回事,可以导入EXCEL,但不能导出EXCEL了,提示如下:
[2025-04-15 09:40:35] [ERROR] __init__.py[line:796] get nicknames. ERROR: HTTPSConnectionPool(host='XXX.XXX.XXX', port=XXX): Max retries exceeded with url: /api/v2.1/dtables/120aec9b-c610-4b71-9040-39099bdb4c25/related-users/?from=dtable_events (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f7fb4160170>: Failed to establish a new connection: [Errno 111] Connection refused'))
jie
2025 年4 月 15 日 04:08
2
您这子表格名字是否有特殊字符,您们更改一个子表的名字导出试试
试过了,没用。
完整的错误日志:
[2025-04-15 13:14:32] [INFO] task_manager.py[line:32] func: add_convert_table_to_excel_task args: dtable_uuid: 22ee65ae-7a59-4762-9bea-70b48b8766c5, table_id: 30XR, username: 79bf588b69094b71aefa1f347c63792c@auth.local, name: 2025工作清单, repo_id: 1c5afd27-668a-4ee5-b8f4-73aa244e1395, is_support_image: False
[2025-04-15 13:14:32] [INFO] task_manager.py[line:475] Run task: bb6402e2-ab26-4e96-a1c5-6b5e36f6b969 <function convert_table_to_excel at 0x7f7fb6ed0ea0>
[2025-04-15 13:14:32] [ERROR] __init__.py[line:796] get nicknames. ERROR: HTTPSConnectionPool(host=xxx.xxx', port=12080): Max retries exceeded with url: /api/v2.1/dtables/22ee65ae-7a59-4762-9bea-70b48b8766c5/related-users/?from=dtable_events (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f7fb4146b70>: Failed to establish a new connection: [Errno 111] Connection refused'))
[2025-04-15 13:14:32] [INFO] task_manager.py[line:487] Run task success: bb6402e2-ab26-4e96-a1c5-6b5e36f6b969 <function convert_table_to_excel at 0x7f7fb6ed0ea0> cost 0s
[2025-04-15 13:15:50] [INFO] task_manager.py[line:32] func: add_convert_table_to_excel_task args: dtable_uuid: 4b0e7f4b-1d3b-4642-ab0c-338970a37b1e, table_id: y143, username: 79bf588b69094b71aefa1f347c63792c@auth.local, name: 工作簿1, repo_id: 913b2224-a4cc-43fa-b24b-57386766850a, is_support_image: False
[2025-04-15 13:15:50] [INFO] task_manager.py[line:475] Run task: e3126e7f-4ff3-48ec-8428-da8ed609a818 <function convert_table_to_excel at 0x7f7fb6ed0ea0>
[2025-04-15 13:15:50] [ERROR] __init__.py[line:796] get nicknames. ERROR: HTTPSConnectionPool(host='XXXX.XXX', port=12080): Max retries exceeded with url: /api/v2.1/dtables/4b0e7f4b-1d3b-4642-ab0c-338970a37b1e/related-users/?from=dtable_events (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f7fb411c9e0>: Failed to establish a new connection: [Errno 111] Connection refused'))
[2025-04-15 13:15:50] [INFO] task_manager.py[line:487] Run task success: e3126e7f-4ff3-48ec-8428-da8ed609a818 <function convert_table_to_excel at 0x7f7fb6ed0ea0> cost 0s
无法导入导出表格(可选)
容器:seatable
文件:/opt/seatable/seatable-server-latest/dtable-events/dtable_events/dtable_io/utils.py
步骤:测试是否因为容器内部未能成功请求外部的原因,若是,尝试修改ip为localhost
# 交互容器,并尝试在python中模拟请求
# docker exec -it seatable /bin/sh
# 可从浏览器开发者工具控制台获取相关host, dtable_uuid, access_token值
import requests
host = '' # location.origin
dtable_uuid = '' # dtable.dtableUuid
access_token = '' # dtable.accessToken
requests.get(f"{host}/api/v2.1/dtables/{dtable_uuid}/related-users/", headers={ "authorization": f"Token {access_token}" })
# 如果一直请求中,直到超时,说明容器内部未能成功发起请求
def get_related_nicknames_from_dtable(dtable_uuid, username, permission):
# url = DTABLE_WEB_SERVICE_URL.strip('/') + '/api/v2.1/dtables/%s/related-users/' % dtable_uuid # 修改前
url = 'http://localhost'.strip('/') + '/api/v2.1/dtables/%s/related-users/' % dtable_uuid # 修改后
payload = {
'exp': int(time.time()) + 60,
'dtable_uuid': dtable_uuid,
'username': username,
'permission': permission,
}
access_token = jwt.encode(payload, DTABLE_PRIVATE_KEY, algorithm='HS256')
headers = {'Authorization': 'Token ' + access_token}
res = requests.get(url, headers=headers)
if res.status_code != 200:
raise ConnectionError('failed to get related users %s %s' % (dtable_uuid, res.text))
res_json = res.json()
results = []
user_list = res_json.get('user_list', [])
app_user_list = res_json.get('app_user_list', [])
if app_user_list:
user_list.extend(app_user_list)
for user in user_list:
if user in results:
continue
results.append(user)
return results
# 如果请求成功,说明是其他原因造成的,需要再测试
1 个赞