Can't create a new Libraries after upgrade to 7.0.5

Please Help! After the upgrade I can’t create new Libraries at all!
The error in the log is:

2019-07-18 09:57:34,807 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /api2/repos/
Traceback (most recent call last):
  File "/opt/seafile/seafile-pro-server-7.0.5/seahub/thirdpart/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/opt/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 "/opt/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 "/opt/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 "/opt/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 "/opt/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 "/opt/seafile/seafile-pro-server-7.0.5/seahub/seahub/api2/base.py", line 23, in dispatch
    response = super(APIView, self).dispatch(*a, **kw)
  File "/opt/seafile/seafile-pro-server-7.0.5/seahub/thirdpart/rest_framework/views.py", line 466, in dispatch
    response = self.handle_exception(exc)
  File "/opt/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 "/opt/seafile/seafile-pro-server-7.0.5/seahub/thirdpart/rest_framework/views.py", line 463, in dispatch
    response = handler(request, *args, **kwargs)
  File "/opt/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 "/opt/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'

I have the pro version. I’ve already tried to put

ENCRYPTED_LIBRARY_VERSION = ‘2’

in the config library without any success…

Thank you in advance for your support!

Same thing happen thru the App or the Desktop Client.

Help!!!

Seems related to Storage Classes. If I disable it all seems to work again.

Same problem here. I’ve upgraded from 6.3.14 to 7.0.5. No errors were shown during upgrade…

I’ve used Storage Classes with 6.4.13

Now I cannot create new Libraries anymore and the Web-UI does not show the “Storage Backend” of the libraries anymore (column is empty) :confused:

2019-07-18 12:23:21,435 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /api2/repos/
Traceback (most recent call last):
  File "/srv/seafile/seafile-pro-server-7.0.5/seahub/thirdpart/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/srv/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 "/srv/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 "/srv/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 "/srv/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 "/srv/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 "/srv/seafile/seafile-pro-server-7.0.5/seahub/seahub/api2/base.py", line 23, in dispatch
    response = super(APIView, self).dispatch(*a, **kw)
  File "/srv/seafile/seafile-pro-server-7.0.5/seahub/thirdpart/rest_framework/views.py", line 466, in dispatch
    response = self.handle_exception(exc)
  File "/srv/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 "/srv/seafile/seafile-pro-server-7.0.5/seahub/thirdpart/rest_framework/views.py", line 463, in dispatch
    response = handler(request, *args, **kwargs)
  File "/srv/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 "/srv/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'

My Storage-Backend column is empty too…

update 7.0.3 to 7.0.5 and it works for me to create new libs

Try to enable storage classes:

# Storage Classes
ENABLE_STORAGE_CLASSES = True

# Lo storage viene definito dal ruolo
STORAGE_CLASS_MAPPING_POLICY = 'ROLE_BASED'

ENABLED_ROLE_PERMISSIONS = {
	'default': {
		'can_add_repo': True,
		'can_add_group': True,
		'can_view_org': True,
		'can_use_global_address_book': True,
		'can_generate_share_link': True,
		'can_generate_upload_link': True,
		'can_invite_guest': True,
		'can_connect_with_android_clients': True,
		'can_connect_with_ios_clients': True,
		'can_connect_with_desktop_clients': True,
		'storage_ids': ['seafile'],
	},
	'All-Storages': {
	        'can_add_repo': True,
	        'can_add_group': True,
        	'can_view_org': True,
        	'can_use_global_address_book': True,
        	'can_generate_share_link': True,
        	'can_generate_upload_link': True,
        	'can_invite_guest': True,
        	'can_connect_with_android_clients': True,
        	'can_connect_with_ios_clients': True,
        	'can_connect_with_desktop_clients': True,
        	'storage_ids': ['seafile' , 'seafile-nobackup'],
	},
}

Ok, I thought maybe there is a problem with my OS (Archlinux) that causes the issue so I tried Seafile Server Pro 7.0.4 with Docker. There is exactly the same problem: cannot create new Libraries with Storage Classes enabled and the “Storage Backed” column in the Web-UI is still empty. Exactly the same errormessage in seahub.log

It seems that Storage Classes with Seahub are broken in 7.x – is there anyone who managed to get it working?

1 Like

Same problem with Seafile Pro 7.0.6 - I’ve upgraded a few minutes ago. Storage Classes in Seahub still not working… :disappointed_relieved:

And of course, still TypeError: create_repo() got multiple values for keyword argument 'enc_version' when trying to create a new Library as long as ENABLE_STORAGE_CLASSES = True

Hi,
same here, when I try to enble storage class and use multiple storage backend.
If I use repo id mapping it will work and no error…however if use user_select or role_base option.
Will have this error. I look in to the /seafile/seafile-pro-server-7.0.5/seahub/seahub/api2/views.py
and seafile.api only have enc_version=2
what is that used for?

just an update here, i am able to pass the error…however the user select or role based function still not working properly after that.
Role based storage_id setting not working at all… and will always go to default storage_id no matter how you edit it.
here is the solution for your reference

comment the line in /seafile/seafile-pro-server-7.0.6/seahub/seahub/api2/views.py #enc_version=settings.ENCRYPTED_LIBRARY_VERSION)

997 if is_pro_version() and ENABLE_STORAGE_CLASSES:
998
999 if STORAGE_CLASS_MAPPING_POLICY in (‘USER_SELECT’,
1000 ‘ROLE_BASED’):
1001
1002 storages = get_library_storages(request)
1003 storage_id = request.data.get(“storage_id”, None)
1004 logger.info("====show current storage list ---->%s",storages )
1005 if storage_id and storage_id not in [s[‘storage_id’] for s in storages]:
1006 error_msg = ‘storage_id invalid.’
1007 return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
1008 repo_id = seafile_api.create_repo(repo_name,
1009 repo_desc, username, passwd, storage_id)
1010 #enc_version=settings.ENCRYPTED_LIBRARY_VERSION)

Hi all,
fresh installation with 7.0.10 without cloud mode and multi-tenancy
able to pass the error and can choose storage type

==== update here for multi-tenancy mode ==
it is not working for mulitp storage backend if you enable cloud mdoe + multi-tenancy