2018-10-04 16:19:44,807 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /api2/ping/
Traceback (most recent call last):
File "/seafile/seafile-pro-server-6.3.6/seahub/thirdpart/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/seafile/seafile-pro-server-6.3.6/seahub/thirdpart/django/core/handlers/base.py", line 249, in _legacy_get_response
response = self._get_response(request)
File "/seafile/seafile-pro-server-6.3.6/seahub/thirdpart/django/core/handlers/base.py", line 217, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/seafile/seafile-pro-server-6.3.6/seahub/thirdpart/django/core/handlers/base.py", line 215, in _get_response
response = response.render()
File "/seafile/seafile-pro-server-6.3.6/seahub/thirdpart/django/template/response.py", line 107, in render
self.content = self.rendered_content
File "/seafile/seafile-pro-server-6.3.6/seahub/thirdpart/rest_framework/response.py", line 71, in rendered_content
ret = renderer.render(self.data, media_type, context)
File "/seafile/seafile-pro-server-6.3.6/seahub/thirdpart/rest_framework/renderers.py", line 676, in render
ret = template.render(context)
File "/seafile/seafile-pro-server-6.3.6/seahub/thirdpart/django/template/backends/django.py", line 64, in render
context = make_context(context, request, autoescape=self.backend.engine.autoescape)
File "/seafile/seafile-pro-server-6.3.6/seahub/thirdpart/django/template/context.py", line 287, in make_context
raise TypeError('context must be a dict rather than %s.' % context.__class__.__name__)
TypeError: context must be a dict rather than RequestContext.
It’s an upgrade from 6.2.13 to 6.3.6
Uploaded and extracted the latest seafile to the server, ran upgrade script, seahub works,sync works, api gives this error.
I have to add, on first sight it seems the api does work with requests other than /ping.
I can request a login token for example. Ping error still remains…
Encountered another error: url: /api/v2.1/admin/devices/
2018-10-06 12:52:22,863 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /api/v2.1/admin/devices/
Traceback (most recent call last):
File "/seafile/seafile-pro-server-6.3.6/seahub/thirdpart/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/seafile/seafile-pro-server-6.3.6/seahub/thirdpart/django/core/handlers/base.py", line 249, in _legacy_get_response
response = self._get_response(request)
File "/seafile/seafile-pro-server-6.3.6/seahub/thirdpart/django/core/handlers/base.py", line 217, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/seafile/seafile-pro-server-6.3.6/seahub/thirdpart/django/core/handlers/base.py", line 215, in _get_response
response = response.render()
File "/seafile/seafile-pro-server-6.3.6/seahub/thirdpart/django/template/response.py", line 107, in render
self.content = self.rendered_content
File "/seafile/seafile-pro-server-6.3.6/seahub/thirdpart/rest_framework/response.py", line 71, in rendered_content
ret = renderer.render(self.data, media_type, context)
File "/seafile/seafile-pro-server-6.3.6/seahub/thirdpart/rest_framework/renderers.py", line 676, in render
ret = template.render(context)
File "/seafile/seafile-pro-server-6.3.6/seahub/thirdpart/django/template/backends/django.py", line 64, in render
context = make_context(context, request, autoescape=self.backend.engine.autoescape)
File "/seafile/seafile-pro-server-6.3.6/seahub/thirdpart/django/template/context.py", line 287, in make_context
raise TypeError('context must be a dict rather than %s.' % context.__class__.__name__)
TypeError: context must be a dict rather than RequestContext.
In all honesty, it would be nice if the pro version would actually act like a pro version and just work
not sure what this has to do with a programming error.shoeper.
Another question, when listing a dir via the API, is there a way to limit its output via pages? It would become quite a mess if there are thousands of files in a directory wouldn’t it?
This error TypeError: context must be a dict rather than RequestContext. only occurs when you visit api through web page or using cUrl with html header like curl 'https://xxx/api2/ping/' -H 'Accept: text/html' which is not recommended.
The preferred method is curl 'https://xxx/api2/ping/' -H 'Accept: application/json' which works in 6.3.x
Anyway, we will update our code in next version which will fix those errors.
I will continue posting my feedback in this thread when I encounter questions using the API, I hope there will come answers or implementations to my questions as well. E.g.: Is there a way to limit file listing output via pages…
It says: “Perform the following two steps to download directory”. Although it only shows one, then shows “Revert Directory” instructions, and then shows step 2
Question: is there a way to cancel the zip creation task? What if a user doesn’t want to wait for a huge zip, does it continue creating the zip anyway?
There’s a method missing to get the user permissions (read/write or read-only) of a certain folder.
Let’s say I’m user Bob, and I access a single read-only folder in a Read/Write shared library (Sonya is owner). How can Bob find out that the folder is read-only?
It would make sense to use the “Get Directory Detail” API, expecting it would return permission:r but it doesn’t do that.
The library detail returns permission but that’s global to the whole library, which can be different from a specific folder inside the same library.
Seahub returns user_perm r when opening the folder but it uses an internal url for an ajax call: https://domain.com:8000/ajax/lib/d7478d33-fe1a-4018-86bd-708e9351384e/dir/?p=/read-only-folder&thumbnail_size=48&_=1539172930432
How can Bob find out he has read-only access using the API?
It seems to be impossible to get information about a library being shared as public using the repo_id. There’s only a method to get all publicly shared libraries.
GET https://cloud.seafile.com/api2/repos/?type={type}
type org, get public libraires.
A member (Bob) that is an Admin of a group where someone else (Alice) is the owner cannot leave that group.
2018-10-12 20:34:49,990 [ERROR] seahub.api2.endpoints.group_members:211 delete Group staff can not quit group
However, an admin (Bob) cannot remove admin privileges themselves, so an admin is basically stuck in a group unless the group owner (Alice) removes Admin privileges on Bob.
I think a user should always be able to leave a group, admin or not.