Open guysoft opened 5 years ago
In debug mode when runnign curl and tail I get this:
==> log/ownphotos.log <==
2019-04-27 21:33:45,743 : views.py : get : 1603 : INFO : about to get root path tree
2019-04-27 21:33:45,935 : views.py : get : 1605 : INFO : root path tree calculated
==> log/gunicorn_django.log <==
[2019-04-27 21:33:54 +0000] [146] [ERROR] Error handling request /api/dirtree/
Traceback (most recent call last):
File "/miniconda/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/miniconda/lib/python3.6/site-packages/django/core/handlers/base.py", line 156, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/miniconda/lib/python3.6/site-packages/django/core/handlers/base.py", line 154, in _get_response
response = response.render()
File "/miniconda/lib/python3.6/site-packages/django/template/response.py", line 106, in render
self.content = self.rendered_content
File "/miniconda/lib/python3.6/site-packages/rest_framework/response.py", line 72, in rendered_content
ret = renderer.render(self.data, accepted_media_type, context)
File "/miniconda/lib/python3.6/site-packages/rest_framework/renderers.py", line 118, in render
return bytes(ret.encode('utf-8'))
UnicodeEncodeError: 'utf-8' codec can't encode characters in position 31996-32003: surrogates not allowed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/miniconda/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/code/api/middleware.py", line 9, in __call__
response = self.get_response(request)
File "/miniconda/lib/python3.6/site-packages/django/core/handlers/exception.py", line 36, in inner
response = response_for_exception(request, exc)
File "/miniconda/lib/python3.6/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/miniconda/lib/python3.6/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/miniconda/lib/python3.6/site-packages/django/views/debug.py", line 95, in technical_500_response
return HttpResponse(html, status=status_code, content_type='text/html')
File "/miniconda/lib/python3.6/site-packages/django/http/response.py", line 291, in __init__
self.content = content
File "/miniconda/lib/python3.6/site-packages/django/http/response.py", line 321, in content
content = self.make_bytes(value)
File "/miniconda/lib/python3.6/site-packages/django/http/response.py", line 236, in make_bytes
return bytes(value.encode(self.charset))
UnicodeEncodeError: 'utf-8' codec can't encode characters in position 6386-6393: surrogates not allowed
Ok, error seems to be in https://github.com/hooram/ownphotos/blob/dev/api/middleware.py#L5
I am getting this error too. I have many photo files/directory name with non ascii characters (in German). Can't get going with ownphotos because of this bug :/
Seems that I have stumbled upon this as well. Any suggestions on how to fix this?
@hooram is not maintaining this anymore, I gave you the path in the code where it needs to be fixed. The suggestion I have is you either fix the code yourself of find someone who knows how.
If @hooram is not maintaining it, is anyone? Should I make a pull request or just fork the whole project?
I can pull request stuff since I have permissions. And I will if you have a solution.
You are also welcome to fork if that makes sense for you.
I can't see the directory tree in
/data
when trying to add a folder to scan.I can reproduce this by running in browser or in curl:
From ownphotos logs I am getting: