TKFRvisionOfficial / bszet_substitution_plan

Parsing and Image creation service of the BSZET substitution plan bot
GNU Affero General Public License v3.0
2 stars 0 forks source link

Unable to archive pdf's #40

Closed MarcelCoding closed 2 years ago

MarcelCoding commented 2 years ago
pdf2img-staging_1  | INFO:     172.19.0.1:41896 - "POST /store-pdf HTTP/1.1" 500 Internal Server Error
pdf2img-staging_1  | ERROR:    Exception in ASGI application
pdf2img-staging_1  | Traceback (most recent call last):
pdf2img-staging_1  |   File "/usr/local/lib/python3.9/site-packages/uvicorn/protocols/http/httptools_impl.py", line 376, in run_asgi
pdf2img-staging_1  |     result = await app(self.scope, self.receive, self.send)
pdf2img-staging_1  |   File "/usr/local/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__
pdf2img-staging_1  |     return await self.app(scope, receive, send)
pdf2img-staging_1  |   File "/usr/local/lib/python3.9/site-packages/fastapi/applications.py", line 208, in __call__
pdf2img-staging_1  |     await super().__call__(scope, receive, send)
pdf2img-staging_1  |   File "/usr/local/lib/python3.9/site-packages/starlette/applications.py", line 112, in __call__
pdf2img-staging_1  |     await self.middleware_stack(scope, receive, send)
pdf2img-staging_1  |   File "/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py", line 181, in __call__
pdf2img-staging_1  |     raise exc
pdf2img-staging_1  |   File "/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py", line 159, in __call__
pdf2img-staging_1  |     await self.app(scope, receive, _send)
pdf2img-staging_1  |   File "/usr/local/lib/python3.9/site-packages/starlette/middleware/base.py", line 57, in __call__
pdf2img-staging_1  |     task_group.cancel_scope.cancel()
pdf2img-staging_1  |   File "/usr/local/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 574, in __aexit__
pdf2img-staging_1  |     raise exceptions[0]
pdf2img-staging_1  |   File "/usr/local/lib/python3.9/site-packages/starlette/middleware/base.py", line 30, in coro
pdf2img-staging_1  |     await self.app(scope, request.receive, send_stream.send)
pdf2img-staging_1  |   File "/usr/local/lib/python3.9/site-packages/starlette/exceptions.py", line 82, in __call__
pdf2img-staging_1  |     raise exc
pdf2img-staging_1  |   File "/usr/local/lib/python3.9/site-packages/starlette/exceptions.py", line 71, in __call__
pdf2img-staging_1  |     await self.app(scope, receive, sender)
pdf2img-staging_1  |   File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 656, in __call__
pdf2img-staging_1  |     await route.handle(scope, receive, send)
pdf2img-staging_1  |   File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 259, in handle
pdf2img-staging_1  |     await self.app(scope, receive, send)
pdf2img-staging_1  |   File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 61, in app
pdf2img-staging_1  |     response = await func(request)
pdf2img-staging_1  |   File "/usr/local/lib/python3.9/site-packages/fastapi/routing.py", line 226, in app
pdf2img-staging_1  |     raw_response = await run_endpoint_function(
pdf2img-staging_1  |   File "/usr/local/lib/python3.9/site-packages/fastapi/routing.py", line 159, in run_endpoint_function
pdf2img-staging_1  |     return await dependant.call(**values)
pdf2img-staging_1  |   File "/app/./pdf_converter.py", line 97, in store_pdf
pdf2img-staging_1  |     for pdf_files in separate_pdf_into_days(data, row_tol):
pdf2img-staging_1  |   File "/app/./util.py", line 159, in separate_pdf_into_days
pdf2img-staging_1  |     new_date = parse_date(pdf_page)  # let's hope this doesn't produce wrong results
pdf2img-staging_1  |   File "/app/./pdf_parsing.py", line 74, in parse_date
pdf2img-staging_1  |     if search_obj := re.search(r"\d\d\.\d\d\.\d\d\d\d", cell):
pdf2img-staging_1  |   File "/usr/local/lib/python3.9/re.py", line 201, in search
pdf2img-staging_1  |     return _compile(pattern, flags).search(string)
pdf2img-staging_1  | TypeError: expected string or bytes-like object