Сервер перестал сканировать директорию с книгами

6 months 4 weeks ago #2070 by mertverik
mertverik replied the topic: Сервер перестал сканировать директорию с книгами
Startup once book-scan.
2018-02-27 15:23:44,930 INFO ***** Starting sopds-scan...
2018-02-27 15:23:44,930 DEBUG OPTIONS SET
2018-02-27 15:23:44,932 DEBUG root_lib = /opt/sopds/books/
2018-02-27 15:23:44,933 DEBUG fb2toepub =
2018-02-27 15:23:44,935 DEBUG fb2tomobi =
2018-02-27 15:23:44,936 DEBUG temp_dir = /opt/sopds/tmp
2018-02-27 15:23:44,938 INFO FB2SAX = True
2018-02-27 15:23:44,945 DEBUG Attempt to add book ./usaw_v1_wolftales.fb2
2018-02-27 15:23:44,950 DEBUG Book ./usaw_v1_wolftales.fb2 Already in DB.
2018-02-27 15:23:44,952 DEBUG Attempt to add book ./\udcc4\udcec\udce8\udcf2\udcf0\udce8\udce9 \udcc3\udceb\udcf3\udcf5\udcee\udce2\udcf1\udcea\udce8\udce9 1 \udccc\udce5\udcf2\udcf0\udcee 2033.fb2
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/sqlite3/base.py", line 328, in execute
return Database.Cursor.execute(self, query, params)
UnicodeEncodeError: 'utf-8' codec can't encode character '\udcc4' in position 0: surrogates not allowed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/opt/sopds/opds_catalog/management/commands/sopds_scanner.py", line 57, in handle
self.scan()
File "/opt/sopds/opds_catalog/management/commands/sopds_scanner.py", line 80, in scan
scanner.scan_all()
File "/opt/sopds/opds_catalog/sopdscan.py", line 107, in scan_all
self.processfile(name,full_path,file,None,0,file_size)
File "/opt/sopds/opds_catalog/sopdscan.py", line 206, in processfile
if opdsdb.findbook(name, rel_path, 1) == None:
File "/opt/sopds/opds_catalog/opdsdb.py", line 193, in findbook
book = Book.objects.get(filename=name[:SIZE_BOOK_FILENAME], path=path[:SIZE_BOOK_PATH])
File "/usr/local/lib/python3.5/dist-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py", line 374, in get
num = len(clone)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py", line 232, in __len__
self._fetch_all()
File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py", line 1118, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py", line 53, in __iter__
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/sql/compiler.py", line 899, in execute_sql
raise original_exception
File "/usr/local/lib/python3.5/dist-packages/django/db/models/sql/compiler.py", line 889, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/utils.py", line 83, in execute
sql = self.db.ops.last_executed_query(self.cursor, sql, params)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/sqlite3/operations.py", line 135, in last_executed_query
params = self._quote_params_for_last_executed_query(params)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/sqlite3/operations.py", line 124, in _quote_params_for_last_executed_query
return cursor.execute(sql, params).fetchone()
UnicodeEncodeError: 'utf-8' codec can't encode character '\udcc4' in position 0: surrogates not allowed

Please Войти or Create an account to join the conversation.

  • mertverik
  • mertverik's Avatar Topic Author
  • Offline
  • Новый участник
  • Новый участник
More
6 months 4 weeks ago #2071 by mitshel
mitshel replied the topic: Сервер перестал сканировать директорию с книгами
Теперь видно, что сканер не может добавить книгу с именем
2018-02-27 15:23:44,952 DEBUG Attempt to add book ./\udcc4\udcec\udce8\udcf2\udcf0\udce8\udce9 \udcc3\udceb\udcf3\udcf5\udcee\udce2\udcf1\udcea\udce8\udce9 1 \udccc\udce5\udcf2\udcf0\udcee 2033.fb2

Либо удалите ее, либо нужно разобраться с тем почему в Вашей системе это наименование не удовлетворяет используемому кодеку UTF-8

Please Войти or Create an account to join the conversation.

  • mitshel
  • mitshel's Avatar
  • Offline
  • Администратор
  • Администратор
More
6 months 4 weeks ago #2073 by mertverik
mertverik replied the topic: Сервер перестал сканировать директорию с книгами
Книга была названа по русски, аббривиатура разделенная точками. Операционка видимо не смогла опознать кодировку. Переименовал транслейтом без точек все прошло гладко. Спасибо

Please Войти or Create an account to join the conversation.

  • mertverik
  • mertverik's Avatar Topic Author
  • Offline
  • Новый участник
  • Новый участник
More
Time to create page: 0.134 seconds