Ошибка при сканировании через планировщик задач в 0,41

4 months 3 weeks ago #1992 by miketam
miketam created the topic: Ошибка при сканировании через планировщик задач в 0,41
При сканировании через планировщик возникает следующая ошибка.
При ручном запуске в консоли ошибки нет. В чем может быть проблема и как от нее избавится?
Система DSM 6.0.2
Было бы замечательно если бы собрали стандартный установочный пакет для Synology/

Задача: Opds scan
Время запуска: Sun, 26 Nov 2017 00:00:02 GMT
Время остановки: Sun, 26 Nov 2017 00:06:42 GMT
Текущее состояние: 1
Стандартный вывод/ошибка:
System check identified some issues:

WARNINGS:
?: (urls.W005) URL namespace 'web' isn't unique. You may not be able to reverse all URLs in this namespace
2017-11-26 00:00:14,375 INFO ***** Starting sopds-scan...
2017-11-26 00:00:14,378 DEBUG OPTIONS SET
2017-11-26 00:00:14,398 DEBUG root_lib = /volume1/Download
2017-11-26 00:00:14,418 DEBUG fb2toepub = /volume1/web/opds/convert/fb2epub/fb2epub
2017-11-26 00:00:14,442 DEBUG fb2tomobi =
2017-11-26 00:00:14,461 DEBUG temp_dir = /volume1/web/opds/tmp
2017-11-26 00:03:56,897 DEBUG Attempt to add book ./\udcd0\udc9a\udcd0\udcb8\udcd1\udc80\udcd1\udc8c\udcd1\udc8f\udcd0\udcbd\udcd0\udcbe\udcd0\udcb2 \udcd0\udc94., \udcd0\udc9a\udcd0\udcb8\udcd1\udc80\udcd1\udc8c\udcd1\udc8f\udcd0\udcbd\udcd0\udcbe\udcd0\udcb2\udcd0\udcb0 \udcd0\udc95. - \udcd0\udc92\udcd0\udcb8\udcd0\udcb4\udcd0\udcb5\udcd0\udcbe\udcd0\udcbc\udcd0\udcbe\udcd0\udcbd\udcd1\udc82\udcd0\udcb0\udcd0\udcb6, \udcd0\udcb0\udcd0\udcbd\udcd0\udcb8\udcd0\udcbc\udcd0\udcb0\udcd1\udc86\udcd0\udcb8\udcd1\udc8f \udcd0\udcb8 DVD-\udcd0\udcb0\udcd0\udcb2\udcd1\udc82\udcd0\udcbe\udcd1\udc80\udcd0\udcb8\udcd0\udcbd\udcd0\udcb3 \udcd0\udcb4\udcd0\udcbb\udcd1\udc8f \udcd0\udcb2\udcd1\udc81\udcd0\udcb5\udcd1\udc85. Adobe Premiere Pro CS4 \udcd0\udcb8 After Effects CS4.pdf
Startup once book-scan.
Traceback (most recent call last):
File "/opt/lib/python3.6/site-packages/django/db/backends/utils.py", line 80, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/opt/lib/python3.6/site-packages/django/db/backends/utils.py", line 65, in execute
return self.cursor.execute(sql, params)
File "/opt/lib/python3.6/site-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 characters in position 0-15: surrogates not allowed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/volume1/web/opds/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/opt/lib/python3.6/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/opt/lib/python3.6/site-packages/django/core/management/__init__.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/lib/python3.6/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/lib/python3.6/site-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/volume1/web/opds/opds_catalog/management/commands/sopds_scanner.py", line 57, in handle
self.scan()
File "/volume1/web/opds/opds_catalog/management/commands/sopds_scanner.py", line 80, in scan
scanner.scan_all()
File "/volume1/web/opds/opds_catalog/sopdscan.py", line 103, in scan_all
self.processfile(name,full_path,file,None,0,file_size)
File "/volume1/web/opds/opds_catalog/sopdscan.py", line 201, in processfile
if opdsdb.findbook(name,rel_path,1)==None:
File "/volume1/web/opds/opds_catalog/opdsdb.py", line 181, in findbook
book = Book.objects.get(filename=name[:SIZE_BOOK_FILENAME], path=path[:SIZE_BOOK_PATH])
File "/opt/lib/python3.6/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/opt/lib/python3.6/site-packages/django/db/models/query.py", line 374, in get
num = len(clone)
File "/opt/lib/python3.6/site-packages/django/db/models/query.py", line 232, in __len__
self._fetch_all()
File "/opt/lib/python3.6/site-packages/django/db/models/query.py", line 1118, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/opt/lib/python3.6/site-packages/django/db/models/query.py", line 53, in __iter__
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
File "/opt/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 894, in execute_sql
raise original_exception
File "/opt/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 884, in execute_sql
cursor.execute(sql, params)
File "/opt/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in execute
sql = self.db.ops.last_executed_query(self.cursor, sql, params)
File "/opt/lib/python3.6/site-packages/django/db/backends/sqlite3/operations.py", line 135, in last_executed_query
params = self._quote_params_for_last_executed_query(params)
File "/opt/lib/python3.6/site-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 characters in position 0-15: surrogates not allowed

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

  • miketam
  • miketam's Avatar Topic Author
  • Offline
  • Новый участник
  • Новый участник
More
4 months 3 weeks ago #1993 by mitshel
mitshel replied the topic: Ошибка при сканировании через планировщик задач в 0,41
Почитайте эту тему, должно помочь: sopds.ru/index.php/forum/razdel-predlozh...o-sopds?limitstart=0

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

  • mitshel
  • mitshel's Avatar
  • Offline
  • Администратор
  • Администратор
More
4 months 3 weeks ago #1994 by miketam
miketam replied the topic: Ошибка при сканировании через планировщик задач в 0,41
Не помогло.
Остановил сервер. Добавил скрипт запуска
export LANG=ru_RU.UTF-8
export LC_ALL=ru_RU.UTF-8

Выполнил скрипт.
После запуска сервера выполнил скрипт сканирования.
Результат ниже

Уважаемый пользователь!

Планировщик задач завершил выполнение запланированной задачи.

Задача: Opds scan
Время запуска: Sun, 26 Nov 2017 19:26:35 GMT
Время остановки: Sun, 26 Nov 2017 19:33:53 GMT
Текущее состояние: 1
Стандартный вывод/ошибка:
System check identified some issues:

WARNINGS:
?: (urls.W005) URL namespace 'web' isn't unique. You may not be able to reverse all URLs in this namespace
2017-11-26 19:26:45,326 INFO ***** Starting sopds-scan...
2017-11-26 19:26:45,349 DEBUG OPTIONS SET
2017-11-26 19:26:45,364 DEBUG root_lib = /volume1/Download
2017-11-26 19:26:45,384 DEBUG fb2toepub = /volume1/web/opds/convert/fb2epub/fb2epub
2017-11-26 19:26:45,400 DEBUG fb2tomobi =
2017-11-26 19:26:45,417 DEBUG temp_dir = /volume1/web/opds/tmp
2017-11-26 19:30:51,131 DEBUG Attempt to add book ./\udcd0\udc9a\udcd0\udcb8\udcd1\udc80\udcd1\udc8c\udcd1\udc8f\udcd0\udcbd\udcd0\udcbe\udcd0\udcb2 \udcd0\udc94., \udcd0\udc9a\udcd0\udcb8\udcd1\udc80\udcd1\udc8c\udcd1\udc8f\udcd0\udcbd\udcd0\udcbe\udcd0\udcb2\udcd0\udcb0 \udcd0\udc95. - \udcd0\udc92\udcd0\udcb8\udcd0\udcb4\udcd0\udcb5\udcd0\udcbe\udcd0\udcbc\udcd0\udcbe\udcd0\udcbd\udcd1\udc82\udcd0\udcb0\udcd0\udcb6, \udcd0\udcb0\udcd0\udcbd\udcd0\udcb8\udcd0\udcbc\udcd0\udcb0\udcd1\udc86\udcd0\udcb8\udcd1\udc8f \udcd0\udcb8 DVD-\udcd0\udcb0\udcd0\udcb2\udcd1\udc82\udcd0\udcbe\udcd1\udc80\udcd0\udcb8\udcd0\udcbd\udcd0\udcb3 \udcd0\udcb4\udcd0\udcbb\udcd1\udc8f \udcd0\udcb2\udcd1\udc81\udcd0\udcb5\udcd1\udc85. Adobe Premiere Pro CS4 \udcd0\udcb8 After Effects CS4.pdf
Startup once book-scan.
Traceback (most recent call last):
File "/opt/lib/python3.6/site-packages/django/db/backends/utils.py", line 80, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/opt/lib/python3.6/site-packages/django/db/backends/utils.py", line 65, in execute
return self.cursor.execute(sql, params)
File "/opt/lib/python3.6/site-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 characters in position 0-15: surrogates not allowed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/volume1/web/opds/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/opt/lib/python3.6/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/opt/lib/python3.6/site-packages/django/core/management/__init__.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/lib/python3.6/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/lib/python3.6/site-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/volume1/web/opds/opds_catalog/management/commands/sopds_scanner.py", line 57, in handle
self.scan()
File "/volume1/web/opds/opds_catalog/management/commands/sopds_scanner.py", line 80, in scan
scanner.scan_all()
File "/volume1/web/opds/opds_catalog/sopdscan.py", line 103, in scan_all
self.processfile(name,full_path,file,None,0,file_size)
File "/volume1/web/opds/opds_catalog/sopdscan.py", line 201, in processfile
if opdsdb.findbook(name,rel_path,1)==None:
File "/volume1/web/opds/opds_catalog/opdsdb.py", line 181, in findbook
book = Book.objects.get(filename=name[:SIZE_BOOK_FILENAME], path=path[:SIZE_BOOK_PATH])
File "/opt/lib/python3.6/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/opt/lib/python3.6/site-packages/django/db/models/query.py", line 374, in get
num = len(clone)
File "/opt/lib/python3.6/site-packages/django/db/models/query.py", line 232, in __len__
self._fetch_all()
File "/opt/lib/python3.6/site-packages/django/db/models/query.py", line 1118, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/opt/lib/python3.6/site-packages/django/db/models/query.py", line 53, in __iter__
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
File "/opt/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 894, in execute_sql
raise original_exception
File "/opt/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 884, in execute_sql
cursor.execute(sql, params)
File "/opt/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in execute
sql = self.db.ops.last_executed_query(self.cursor, sql, params)
File "/opt/lib/python3.6/site-packages/django/db/backends/sqlite3/operations.py", line 135, in last_executed_query
params = self._quote_params_for_last_executed_query(params)
File "/opt/lib/python3.6/site-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 characters in position 0-15: surrogates not allowed

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

  • miketam
  • miketam's Avatar Topic Author
  • Offline
  • Новый участник
  • Новый участник
More
4 months 3 weeks ago #1995 by mitshel
mitshel replied the topic: Ошибка при сканировании через планировщик задач в 0,41
Попрбуйте другую локаль:
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
Текущую локль которая используется когда вы запускаете программу из консоли можно посмотреть командой locale

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

  • mitshel
  • mitshel's Avatar
  • Offline
  • Администратор
  • Администратор
More
4 months 2 weeks ago #1997 by miketam
miketam replied the topic: Ошибка при сканировании через планировщик задач в 0,41
К сожалению это не помогло. Возникает все та же ошибка.
Вывод команды locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

Обновил версию до 0.43. Ошибка так и осталась

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

  • miketam
  • miketam's Avatar Topic Author
  • Offline
  • Новый участник
  • Новый участник
More
3 months 4 weeks ago #2008 by dvs
dvs replied the topic: Ошибка при сканировании через планировщик задач в 0,41

При ручном запуске в консоли ошибки нет.

Выводите переменные окружения и сравнивайте
env

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

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