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

6 years 1 month ago - 6 years 1 month ago #2061 by mertverik
mertverik created the topic: Сервер перестал сканировать директорию с книгами
Доброго дня
пробовал запустить сканирование вручную и вот что выдает,не могу понять в чем проблема
Startup once book-scan.
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
Last Edit: 6 years 1 month ago by mertverik.

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

  • mertverik
  • mertverik's Avatar Topic Author
  • Offline
  • Новый участник
  • Новый участник
More
6 years 1 month ago #2062 by mitshel
mitshel replied the topic: Сервер перестал сканировать директорию с книгами
А какая кодировка локали в вашей системе. Наберите в терминале команду:
locale

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

  • mitshel
  • mitshel's Avatar
  • Offline
  • Администратор
  • Администратор
More
6 years 1 month ago #2063 by mertverik
mertverik replied the topic: Сервер перестал сканировать директорию с книгами
LANG=ru_RU.UTF-8
LANGUAGE=
LC_CTYPE="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_PAPER="ru_RU.UTF-8"
LC_NAME="ru_RU.UTF-8"
LC_ADDRESS="ru_RU.UTF-8"
LC_TELEPHONE="ru_RU.UTF-8"
LC_MEASUREMENT="ru_RU.UTF-8"
LC_IDENTIFICATION="ru_RU.UTF-8"
LC_ALL=

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

  • mertverik
  • mertverik's Avatar Topic Author
  • Offline
  • Новый участник
  • Новый участник
More
6 years 1 month ago #2064 by mitshel
mitshel replied the topic: Сервер перестал сканировать директорию с книгами
Запустите сканирование с опцией --verbose. И лог покажите потом.

Команда:
python3 manage.py sopds_scanner start --verbose

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

  • mitshel
  • mitshel's Avatar
  • Offline
  • Администратор
  • Администратор
More
6 years 1 month ago #2068 by mertverik
mertverik replied the topic: Сервер перестал сканировать директорию с книгами
Startup scheduled book-scan (min=0, hour=0,12, day_of_week=*, day=*).
2018-02-27 09:15:58,312 INFO Adding job tentatively -- it will be properly scheduled when the scheduler starts
2018-02-27 09:15:58,313 INFO Adding job tentatively -- it will be properly scheduled when the scheduler starts
Quit the server with CONTROL-C.
2018-02-27 09:15:58,315 INFO Added job "Command.scan" to job store "default"
2018-02-27 09:15:58,315 INFO Added job "Command.check_settings" to job store "default"
2018-02-27 09:15:58,315 INFO Scheduler started
2018-02-27 09:15:58,316 DEBUG Looking for jobs to run
2018-02-27 09:15:58,316 DEBUG Next wakeup is due at 2018-02-27 09:20:00+03:00 (in 241.683577 seconds)
2018-02-27 09:20:00,001 DEBUG Looking for jobs to run
2018-02-27 09:20:00,007 DEBUG Next wakeup is due at 2018-02-27 09:30:00+03:00 (in 599.998292 seconds)
2018-02-27 09:20:00,006 INFO Running job "Command.check_settings (trigger: cron[minute='*/10'], next run at: 2018-02-27 09:30:00 MSK)" (scheduled at 2018-02-27 09:20:00+03:00)
2018-02-27 09:20:00,023 INFO Job "Command.check_settings (trigger: cron[minute='*/10'], next run at: 2018-02-27 09:30:00 MSK)" executed successfully
2018-02-27 09:30:00,011 DEBUG Looking for jobs to run
2018-02-27 09:30:00,013 INFO Running job "Command.check_settings (trigger: cron[minute='*/10'], next run at: 2018-02-27 09:30:00 MSK)" (scheduled at 2018-02-27 09:30:00+03:00)
2018-02-27 09:30:00,015 DEBUG Next wakeup is due at 2018-02-27 09:40:00+03:00 (in 599.988395 seconds)
2018-02-27 09:30:00,018 INFO Job "Command.check_settings (trigger: cron[minute='*/10'], next run at: 2018-02-27 09:40:00 MSK)" executed successfully
2018-02-27 09:40:00,004 DEBUG Looking for jobs to run
2018-02-27 09:40:00,005 INFO Running job "Command.check_settings (trigger: cron[minute='*/10'], next run at: 2018-02-27 09:40:00 MSK)" (scheduled at 2018-02-27 09:40:00+03:00)
2018-02-27 09:40:00,009 DEBUG Next wakeup is due at 2018-02-27 09:50:00+03:00 (in 599.995354 seconds)
2018-02-27 09:40:00,014 INFO Job "Command.check_settings (trigger: cron[minute='*/10'], next run at: 2018-02-27 09:50:00 MSK)" executed successfully
2018-02-27 09:50:00,005 DEBUG Looking for jobs to run
2018-02-27 09:50:00,018 DEBUG Next wakeup is due at 2018-02-27 10:00:00+03:00 (in 599.994403 seconds)
2018-02-27 09:50:00,018 INFO Running job "Command.check_settings (trigger: cron[minute='*/10'], next run at: 2018-02-27 10:00:00 MSK)" (scheduled at 2018-02-27 09:50:00+03:00)
2018-02-27 09:50:00,026 INFO Job "Command.check_settings (trigger: cron[minute='*/10'], next run at: 2018-02-27 10:00:00 MSK)" executed successfully

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

  • mertverik
  • mertverik's Avatar Topic Author
  • Offline
  • Новый участник
  • Новый участник
More
6 years 1 month ago #2069 by mitshel
mitshel replied the topic: Сервер перестал сканировать директорию с книгами
Прошу, прощения, не ту команду надо было выполнить. Вот эту:

Команда:
python3 manage.py sopds_scanner scan --verbose

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

  • mitshel
  • mitshel's Avatar
  • Offline
  • Администратор
  • Администратор
More
Time to create page: 0.123 seconds