INFO:__main__:Worker started. INFO:__main__:Parameters: Namespace(history_uuid='31e7ae12-1d8b-11ef-b604-f2ae5aae5d1a', limit_vcpu=None, limit_ram=None) INFO:__main__:conversion_history INFO:__main__: INFO:__main__:current_user from db Christian INFO:__main__:processing history: 31e7ae12-1d8b-11ef-b604-f2ae5aae5d1a INFO:__main__:current history type: tts-document INFO:__main__:current user_id: 41047 INFO:__main__:processing document: 31e7ae12-1d8b-11ef-b604-f2ae5aae5d1a INFO:__main__:Try to download and decrypt if needed for flare_uploaded/41047/20240529_071510_853112/DieSchatzinsel.azw INFO:app.tts_common.helpers.tts_history_helper:File downloaded successfully to: tmp/flare_uploaded/41047/20240529_071510_853112/DieSchatzinsel.azw INFO:app.tts_common.services.key_service:Init key service with priorities: [90, 91, 92, 93, 96, 97] INFO:Job: history 31e7ae12-1d8b-11ef-b604-f2ae5aae5d1a:Convert TTS and send result START... INFO:Job: history 31e7ae12-1d8b-11ef-b604-f2ae5aae5d1a:conversion_history_uuid 31e7ae12-1d8b-11ef-b604-f2ae5aae5d1a INFO:Job: history 31e7ae12-1d8b-11ef-b604-f2ae5aae5d1a:input_file_path tmp/flare_uploaded/41047/20240529_071510_853112/DieSchatzinsel.azw INFO:Job: history 31e7ae12-1d8b-11ef-b604-f2ae5aae5d1a:model_price_rate 2 INFO:Job: history 31e7ae12-1d8b-11ef-b604-f2ae5aae5d1a:docs_extension azw INFO:Job: history 31e7ae12-1d8b-11ef-b604-f2ae5aae5d1a:Processing document with type : openai_voice INFO:Job: history 31e7ae12-1d8b-11ef-b604-f2ae5aae5d1a:START tts_document_extract_text_and_convert_to_speech ... INFO:app.tts_common.services.key_service:Init key service with priorities: [90, 91, 92, 93, 96, 97] INFO:app.tts_common.services.key_service:Init key service with priorities: [90, 91, 92, 93, 96, 97] INFO:Job: history 31e7ae12-1d8b-11ef-b604-f2ae5aae5d1a:START tts_document_extract_file_content ... ERROR:__main__:Convert and send result failed ERROR:__main__:unpack_from requires a buffer of at least 292030 bytes for unpacking 291952 bytes at offset 78 (actual buffer size is 233350) Traceback (most recent call last): File "/app/worker.py", line 155, in main convert_result = await convert_and_send_result_document( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/app/tts_common/jobs/convert_and_send_result.py", line 88, in convert_and_send_result_document pieces, list_files, base_used_credits = await tts_document_extract_text_and_convert_to_speech( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/app/tts_common/jobs/convert_and_send_result.py", line 354, in tts_document_extract_text_and_convert_to_speech characters_count, pieces = await tts_document_extract_file_content( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/app/tts_common/jobs/convert_and_send_result.py", line 453, in tts_document_extract_file_content content = tts_service.simple_extract_text_from_document(input_file_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/app/tts_common/services/speech.py", line 55, in wrapper result = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/app/app/tts_common/services/speech_tika.py", line 19, in simple_extract_text_from_document tempdir, file_path = extract(file_path) ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/mobi/extract.py", line 29, in extract unpackBook(infile, tempdir, epubver="A") File "/usr/local/lib/python3.11/site-packages/mobi/kindleunpack.py", line 989, in unpackBook sect = Sectionizer(infile) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/mobi/mobi_sectioner.py", line 62, in __init__ sectionsdata = struct.unpack_from( ^^^^^^^^^^^^^^^^^^^ struct.error: unpack_from requires a buffer of at least 292030 bytes for unpacking 291952 bytes at offset 78 (actual buffer size is 233350) ERROR:__main__:Traceback (most recent call last): File "/app/worker.py", line 155, in main convert_result = await convert_and_send_result_document( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/app/tts_common/jobs/convert_and_send_result.py", line 88, in convert_and_send_result_document pieces, list_files, base_used_credits = await tts_document_extract_text_and_convert_to_speech( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/app/tts_common/jobs/convert_and_send_result.py", line 354, in tts_document_extract_text_and_convert_to_speech characters_count, pieces = await tts_document_extract_file_content( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/app/tts_common/jobs/convert_and_send_result.py", line 453, in tts_document_extract_file_content content = tts_service.simple_extract_text_from_document(input_file_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/app/tts_common/services/speech.py", line 55, in wrapper result = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/app/app/tts_common/services/speech_tika.py", line 19, in simple_extract_text_from_document tempdir, file_path = extract(file_path) ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/mobi/extract.py", line 29, in extract unpackBook(infile, tempdir, epubver="A") File "/usr/local/lib/python3.11/site-packages/mobi/kindleunpack.py", line 989, in unpackBook sect = Sectionizer(infile) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/mobi/mobi_sectioner.py", line 62, in __init__ sectionsdata = struct.unpack_from( ^^^^^^^^^^^^^^^^^^^ struct.error: unpack_from requires a buffer of at least 292030 bytes for unpacking 291952 bytes at offset 78 (actual buffer size is 233350) Traceback (most recent call last): File "/app/worker.py", line 155, in main convert_result = await convert_and_send_result_document( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/app/tts_common/jobs/convert_and_send_result.py", line 88, in convert_and_send_result_document pieces, list_files, base_used_credits = await tts_document_extract_text_and_convert_to_speech( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/app/tts_common/jobs/convert_and_send_result.py", line 354, in tts_document_extract_text_and_convert_to_speech characters_count, pieces = await tts_document_extract_file_content( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/app/tts_common/jobs/convert_and_send_result.py", line 453, in tts_document_extract_file_content content = tts_service.simple_extract_text_from_document(input_file_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/app/tts_common/services/speech.py", line 55, in wrapper result = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/app/app/tts_common/services/speech_tika.py", line 19, in simple_extract_text_from_document tempdir, file_path = extract(file_path) ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/mobi/extract.py", line 29, in extract unpackBook(infile, tempdir, epubver="A") File "/usr/local/lib/python3.11/site-packages/mobi/kindleunpack.py", line 989, in unpackBook sect = Sectionizer(infile) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/mobi/mobi_sectioner.py", line 62, in __init__ sectionsdata = struct.unpack_from( ^^^^^^^^^^^^^^^^^^^ struct.error: unpack_from requires a buffer of at least 292030 bytes for unpacking 291952 bytes at offset 78 (actual buffer size is 233350) ERROR:__main__:31e7ae12-1d8b-11ef-b604-f2ae5aae5d1a Traceback (most recent call last): File "/app/worker.py", line 155, in main convert_result = await convert_and_send_result_document( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/app/tts_common/jobs/convert_and_send_result.py", line 88, in convert_and_send_result_document pieces, list_files, base_used_credits = await tts_document_extract_text_and_convert_to_speech( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/app/tts_common/jobs/convert_and_send_result.py", line 354, in tts_document_extract_text_and_convert_to_speech characters_count, pieces = await tts_document_extract_file_content( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/app/tts_common/jobs/convert_and_send_result.py", line 453, in tts_document_extract_file_content content = tts_service.simple_extract_text_from_document(input_file_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/app/tts_common/services/speech.py", line 55, in wrapper result = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/app/app/tts_common/services/speech_tika.py", line 19, in simple_extract_text_from_document tempdir, file_path = extract(file_path) ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/mobi/extract.py", line 29, in extract unpackBook(infile, tempdir, epubver="A") File "/usr/local/lib/python3.11/site-packages/mobi/kindleunpack.py", line 989, in unpackBook sect = Sectionizer(infile) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/mobi/mobi_sectioner.py", line 62, in __init__ sectionsdata = struct.unpack_from( ^^^^^^^^^^^^^^^^^^^ struct.error: unpack_from requires a buffer of at least 292030 bytes for unpacking 291952 bytes at offset 78 (actual buffer size is 233350) INFO:app.tts_common.helpers.email_helper:Send vocalized file failed notice email INFO:app.tts_common.helpers.email_helper:sent to message to kafka topic: tts-emails-prod INFO:Firebase client:Add notification to firebase START INFO:Firebase client:Add notification to firebase END INFO:__main__:Recalculate user locked credit INFO:__main__:Convert and send result END Produced event to topic tts-emails-prod: value = {"function": "send_vocalized_file_failed_notice", "email_to": "theis1705@gmx.net", "recipient_name": "Christian", "file_name": "DieSchatzinsel.azw"}