[2026-02-09 09:25:35.000] === STARTING PROCESSING SESSION === [2026-02-09 09:25:35.000] PHP Version: 8.4.16 [2026-02-09 09:25:35.000] Memory Limit: 128M [2026-02-09 09:25:35.000] Max Execution Time: 120 [2026-02-09 09:25:35.000] Disabled functions: NONE [2026-02-09 09:25:35.000] Raw body length: 16556 [2026-02-09 09:25:35.000] Provided signature: 903859b009ebc946cb0a... [2026-02-09 09:25:35.000] Expected signature: 903859b009ebc946cb0a... [2026-02-09 09:25:35.000] Signature verified successfully [2026-02-09 09:25:35.000] Payload JSON decoded: SUCCESS [2026-02-09 09:25:35.000] Number of PDFs to process: 1 [2026-02-09 09:25:35.000] --- Processing PDF #1 --- [2026-02-09 09:25:35.000] PDF base64 provided: YES, length: 16312 [2026-02-09 09:25:35.000] PDF bytes decoded: 12233 bytes [2026-02-09 09:25:35.000] Temp PDF written to /tmp/invoice_6989a80fd2f39.pdf, bytes written: 12233 [2026-02-09 09:25:35.000] Temp PDF exists: YES [2026-02-09 09:25:35.000] Temp PDF size: 12233 bytes [2026-02-09 09:25:35.000] PDF hash: acf0b4c4c0d943772f832955c1fe018f46288f2f88fa8dd281096db2b5bc1c6c [2026-02-09 09:25:35.000] Checking database cache for hash: acf0b4c4c0d94377... [2026-02-09 09:25:35.000] CACHE MISS - Not found in database [2026-02-09 09:25:35.000] Starting PDF processing (not cached) [2026-02-09 09:25:35.000] STEP 1: Quick Smalot parser attempt [2026-02-09 09:25:35.000] Smalot parsing took: 0 seconds [2026-02-09 09:25:35.000] Number of pages detected: 1 [2026-02-09 09:25:35.000] Smalot extracted text length: 4 [2026-02-09 09:25:35.000] Smalot parser returned insufficient text (length: 4) [2026-02-09 09:25:35.000] Smalot failed or insufficient, GOING STRAIGHT TO LAMBDA (skipping pdftoppm/tesseract) [2026-02-09 09:25:35.000] run_lambda_ocr called, base64 length: 16312 [2026-02-09 09:25:35.000] Calling Lambda OCR... [2026-02-09 09:25:39.000] Lambda call took: 3.14 seconds [2026-02-09 09:25:39.000] Lambda HTTP response code: 200 [2026-02-09 09:25:39.000] Lambda response length: 18 [2026-02-09 09:25:39.000] Lambda response preview | Data: {"rawOCR": "test"} [2026-02-09 09:25:39.000] Lambda OCR result length: 4 [2026-02-09 09:25:39.000] Lambda OCR preview | Data: test [2026-02-09 09:25:39.000] Lambda OCR SUCCESS, text length: 4 [2026-02-09 09:25:39.000] Lambda text preview (first 200 chars): | Data: test [2026-02-09 09:25:39.000] Attempting OpenAI parsing with lambda_primary OCR [2026-02-09 09:25:39.000] run_openai_parse called, text length: 4 [2026-02-09 09:25:39.000] OpenAI input preview: | Data: test... [2026-02-09 09:25:39.000] Making OpenAI API call... [2026-02-09 09:25:40.000] OpenAI HTTP response code: 200 [2026-02-09 09:25:40.000] OpenAI response received, length: 910 [2026-02-09 09:25:40.000] OpenAI content extracted, length: 89 [2026-02-09 09:25:40.000] OpenAI parsed JSON result | Data: {"invoice_number":null,"amount":null,"due_date":null,"invoice_date":null,"currency":null} [2026-02-09 09:25:40.000] Final AI result | Data: {"invoice_number":null,"amount":null,"due_date":null,"invoice_date":null,"currency":null} [2026-02-09 09:25:40.000] normalize_amount called with: | Data: 0.00 [2026-02-09 09:25:40.000] normalize_amount result: | Data: 0.00 [2026-02-09 09:25:40.000] normalize_date_iso called with: [2026-02-09 09:25:40.000] Final extracted values | Data: {"invoice_number":"","amount":"0.00","due_date":null,"invoice_date":null,"currency":""} [2026-02-09 09:25:40.000] Attempting to save PDF to: /var/www/sandbox/pdfs/invoice_8d363db128bca1cd83df86ca0ac739cd.pdf [2026-02-09 09:25:40.000] PDF saved successfully to /var/www/sandbox/pdfs/invoice_8d363db128bca1cd83df86ca0ac739cd.pdf [2026-02-09 09:25:40.000] Database INSERT SUCCESS [2026-02-09 09:25:40.000] Adding to invoices array | Data: {"uuid":"8d363db128bca1cd83df86ca0ac739cd","invoice_number":"","amount":"0.00","due_date":null,"invoice_date":null,"currency":"","cached":false,"ocr_method":"lambda_primary","local_ocr_failed":true} [2026-02-09 09:25:40.000] --- Finished processing PDF #1 --- [2026-02-09 09:25:40.000] === TOTAL PROCESSING TIME: 4572.82ms === [2026-02-09 09:25:40.000] Total invoices processed: 1 [2026-02-09 09:25:40.000] Response sent, size: 213 bytes