gray13
1
这个问题我看到英文论坛也有人发,
我测试了好几次
一旦我把多存储后台enable然后用USER_SELECT, ROLE_BASED 其中一个 就会报错
引用
ENABLE_STORAGE_CLASSES = True
STORAGE_CLASS_MAPPING_POLICY = ‘USER_SELECT’
#STORAGE_CLASS_MAPPING_POLICY = ‘REPO_ID_MAPPING’
#STORAGE_CLASS_MAPPING_POLICY = ‘ROLE_BASED’
引用
==> seahub.log <==
2019-10-23 07:36:22,287 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /api2/repos/
Traceback (most recent call last):
File “/seafile/seafile-pro-server-7.0.5/seahub/thirdpart/django/core/handlers/exception.py”, line 41, in inner
response = get_response(request)
File “/seafile/seafile-pro-server-7.0.5/seahub/thirdpart/django/core/handlers/base.py”, line 249, in _legacy_get_response
response = self._get_response(request)
File “/seafile/seafile-pro-server-7.0.5/seahub/thirdpart/django/core/handlers/base.py”, line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File “/seafile/seafile-pro-server-7.0.5/seahub/thirdpart/django/core/handlers/base.py”, line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File “/seafile/seafile-pro-server-7.0.5/seahub/thirdpart/django/views/decorators/csrf.py”, line 58, in wrapped_view
return view_func(*args, **kwargs)
File “/seafile/seafile-pro-server-7.0.5/seahub/thirdpart/django/views/generic/base.py”, line 68, in view
return self.dispatch(request, *args, **kwargs)
File “/seafile/seafile-pro-server-7.0.5/seahub/seahub/api2/base.py”, line 23, in dispatch
response = super(APIView, self).dispatch(*a, **kw)
File “/seafile/seafile-pro-server-7.0.5/seahub/thirdpart/rest_framework/views.py”, line 466, in dispatch
response = self.handle_exception(exc)
File “/seafile/seafile-pro-server-7.0.5/seahub/seahub/api2/base.py”, line 20, in handle_exception
return super(APIView, self).handle_exception(exc)
File “/seafile/seafile-pro-server-7.0.5/seahub/thirdpart/rest_framework/views.py”, line 463, in dispatch
response = handler(request, *args, **kwargs)
File “/seafile/seafile-pro-server-7.0.5/seahub/seahub/api2/views.py”, line 950, in post
repo_id, error = self._create_repo(request, repo_name, repo_desc, username, org_id)
File “/seafile/seafile-pro-server-7.0.5/seahub/seahub/api2/views.py”, line 1006, in _create_repo
enc_version=settings.ENCRYPTED_LIBRARY_VERSION)
TypeError: create_repo() got multiple values for keyword argument ‘enc_version’
不知道有没有人遇到
gray13
2
还是无法解决。。。 哎。。无奈 难道没人 测试这个ENABLE_STORAGE_CLASSES = True
我看国外论坛也有人遇到了 这个问题
gray13
4
测试了 7.0.6 和7.0.10 版本问题是一样的。。
已经配置hot为默认的路径 而 cold为新的lib 路径 但是当新建repo的时候 永远只会用default的那个路径
测试了 REPO_ID_MAPPING 和ROLE_BASED’ 两种均无效
引用
“storage_id”: “hot_storage”,
“name”: “Hot Storage”,
“is_default”: true,
“fs”: {“backend”: “fs”, “dir”: “/storage/hot/seafile-data”},
“commits”: {“backend”: “fs”, “dir”: “/storage/hot/seafile-data”},
“blocks”: {“backend”: “fs”, “dir”: “/storage/hot/seafile-data”}
},
{
“storage_id”: “cold_storage”,
“name”: “Cold Storage”,
“is_default”: false,
“for_new_library”: true,
“fs”: {“backend”: “fs”, “dir”: “/storage/cold/seafile-data”},
“commits”: {“backend”: “fs”, “dir”: “/storage/cold/seafile-data”},
“blocks”: {“backend”: “fs”, “dir”: “/storage/cold/seafile-data”}
本来是想拿来做生产环境的 看来这个并没有好好的维护 也没人开发的support一下大家提出的问题。。
看来只能换去onwcloud 这个多存储后台我已经测试过1个半礼拜
提出了好几个问题。。并没有解决
找到了临时解决办法把代码注释了 但是这个功能完全不能用 测试了很久 永远是insert default storage_id
Hulk
6
我会找时间测试下这个问题,如果确实存在,会报给开发组解决下。
Hulk
7
我本地测试了这个问题,使用了USER_SELECT策略,一切正常,并没有看到任何报错,我用的7.0.10的版本
请问你用这个user_select 页面真的会有任何选项来选择吗?
我测试了好多次从来没有出来任何选择的下拉或者可以选的。看到英文论坛也有人提过 并没有任何可选的内容
所以我测试的主要是 role_base 和repo id mapping
有请问你测试的是本地挂在的多个硬盘给不同storage id吗
我自己注释了代码后,不会报错 但是后台的log显示永远会去用default storage id,所以如果只是一个storage类型的话 都是不会报错的。
我会重新安装一个全新的7.0.10的版本 再测试一下
谢谢你的测试 哈哈 感谢
gray13
10
感谢 这次重新安装了所有的虚机 并且又下载了一次 7.0.10的centos 版本
可以有下拉的选项了 unbelievable… 之前也用了7.0.10的版本 但是enable了所有的配置 最后失败了
这次用了最简单的配置 没有用cloud mode也没有enable multi-tenacy
会测试一下 再来反馈
再次感谢你的测试
gray13
11
你好绿巨人hulk 
我觉得这里应该有一个bug 而且是数据库的设计问题 不知道是不是对的
我测试了 multi-tenancy 这个多存储后台是无效的
我依然是用的role base 的多存储后台选项 所有的新建的资料库repo都会去默认的storage_id
因为我看到数据库里面 如果用了multi-tenancy 新建的repo是在表OrgRepo这个表里面 而所有Org相关的表都没有storageid 这个列
仅有RepoStorageId这个表有 storageid 这里仅仅用来存放非多租户的用户的资料库UUID
因为我们公司要买pro版本 所以现在主要是在测试pro的各个功能 但是目前来看 这里是不是有点问题
如果可以麻烦你测试一下 或者有什么渠道可以联系到开发的 问一下
你们比较专业 我只是自己测试的 下面截图 供参考
我的租户是org1 设置的role是 org1user 对应的自己的storage id 是org1storage
设置的role是org1 storage 在前台唯一的选项
但是一旦创建显示的存储后台还是默认的 hot storage(is default: true)
查看了REPO UUID 存储位置确实是默认的
[root@app03 conf]# find / -type d -name 2cd2b2b0-fec5-45ea-937b-c58cf3d5c0f2
/storage/hot/seafile-data/storage/commits/2cd2b2b0-fec5-45ea-937b-c58cf3d5c0f2
数据库我也查看过了
其他测试的场景:
1)org1 admin user1 创建了新的普通用户 user2 设置同样的 角色对应storage 新建的资料库还是为默认的
2)给每个角色设置多个storage id,前台可以选择,但是创建的资料库依然指向默认的 stoage id
3)只有超级管理可以根据指定的storage id 创建正确路径的 资料库,因为超级管理不属于任何 Org
gray13
13
难怪。。但是发布的文档貌似没有提到。。。那我白测了 哈哈哈哈哈。。 谢谢
希望可以在新版本加进去 这样企业用户才比较好用 哈哈哈