[2026-02-09 15:00:02.000] === STARTING PROCESSING SESSION === [2026-02-09 15:00:02.000] PHP Version: 8.4.16 [2026-02-09 15:00:02.000] Memory Limit: 128M [2026-02-09 15:00:02.000] Max Execution Time: 120 [2026-02-09 15:00:02.000] Disabled functions: NONE [2026-02-09 15:00:02.000] Raw body length: 82753 [2026-02-09 15:00:02.000] Provided signature: 529a72f668474c2420cd... [2026-02-09 15:00:02.000] Expected signature: 529a72f668474c2420cd... [2026-02-09 15:00:02.000] Signature verified successfully [2026-02-09 15:00:02.000] Payload JSON decoded: SUCCESS [2026-02-09 15:00:02.000] Number of PDFs to process: 1 [2026-02-09 15:00:02.000] --- Processing PDF #1 --- [2026-02-09 15:00:02.000] PDF base64 provided: YES, length: 81672 [2026-02-09 15:00:02.000] PDF bytes decoded: 61254 bytes [2026-02-09 15:00:02.000] Temp PDF written to /tmp/invoice_6989f67298f1c.pdf, bytes written: 61254 [2026-02-09 15:00:02.000] Temp PDF exists: YES [2026-02-09 15:00:02.000] Temp PDF size: 61254 bytes [2026-02-09 15:00:02.000] PDF hash: 47b1c5705ee8238b6e5a7d4c2c424b8aa1c6474afdd103bca24f1b150d658786 [2026-02-09 15:00:02.000] Checking database cache for hash: 47b1c5705ee8238b... [2026-02-09 15:00:02.000] CACHE MISS - Not found in database [2026-02-09 15:00:02.000] Starting PDF processing (not cached) [2026-02-09 15:00:02.000] STEP 1: Quick Smalot parser attempt [2026-02-09 15:00:02.000] Smalot parsing took: 0.01 seconds [2026-02-09 15:00:02.000] Number of pages detected: 1 [2026-02-09 15:00:02.000] Smalot extracted text length: 0 [2026-02-09 15:00:02.000] Smalot parser returned insufficient text (length: 0) [2026-02-09 15:00:02.000] Smalot failed or insufficient, GOING STRAIGHT TO LAMBDA (skipping pdftoppm/tesseract) [2026-02-09 15:00:02.000] run_lambda_ocr called, base64 length: 81672 [2026-02-09 15:00:02.000] Calling Lambda OCR... [2026-02-09 15:00:07.000] Lambda call took: 4.56 seconds [2026-02-09 15:00:07.000] Lambda HTTP response code: 200 [2026-02-09 15:00:07.000] Lambda response length: 609 [2026-02-09 15:00:07.000] Lambda response preview | Data: {"rawOCR": "INVOICE\nInvoice# MYKL/040619/HONDA BR-V/02\nBill To\nInvoice Date :\n22 Jul 2019\nDentsu X (Malaysia) Sdn. Bhd.\nLot 10-2, Level 10, Wisma Guocoland, Damansara City, No. 6, Jalan\nTerms : [2026-02-09 15:00:07.000] Lambda OCR result length: 563 [2026-02-09 15:00:07.000] Lambda OCR preview | Data: INVOICE Invoice# MYKL/040619/HONDA BR-V/02 Bill To Invoice Date : 22 Jul 2019 Dentsu X (Malaysia) Sdn. Bhd. Lot 10-2, Level 10, Wisma Guocoland, Damansara City, No. 6, Jalan Terms : Net 60 Damanlela, [2026-02-09 15:00:07.000] Lambda OCR SUCCESS, text length: 563 [2026-02-09 15:00:07.000] Lambda text preview (first 200 chars): | Data: INVOICE Invoice# MYKL/040619/HONDA BR-V/02 Bill To Invoice Date : 22 Jul 2019 Dentsu X (Malaysia) Sdn. Bhd. Lot 10-2, Level 10, Wisma Guocoland, Damansara City, No. 6, Jalan Terms : Net 60 Damanlela, [2026-02-09 15:00:07.000] Attempting OpenAI parsing with lambda_primary OCR [2026-02-09 15:00:07.000] run_openai_parse called, text length: 563 [2026-02-09 15:00:07.000] OpenAI input preview: | Data: INVOICE Invoice# MYKL/040619/HONDA BR-V/02 Bill To Invoice Date : 22 Jul 2019 Dentsu X (Malaysia) Sdn. Bhd. Lot 10-2, Level 10, Wisma Guocoland, Damansara City, No. 6, Jalan Terms : Net 60 Damanlela, ... [2026-02-09 15:00:07.000] Making OpenAI API call... [2026-02-09 15:00:08.000] OpenAI HTTP response code: 200 [2026-02-09 15:00:08.000] OpenAI response received, length: 1006 [2026-02-09 15:00:08.000] OpenAI content extracted, length: 166 [2026-02-09 15:00:08.000] OpenAI parsed JSON result | Data: {"invoice_number":"MYKL\/040619\/HONDA BR-V\/02","amount":"25324.16","due_date":"2019-09-20","invoice_date":"2019-07-22","currency":"MYR"} [2026-02-09 15:00:08.000] Final AI result | Data: {"invoice_number":"MYKL\/040619\/HONDA BR-V\/02","amount":"25324.16","due_date":"2019-09-20","invoice_date":"2019-07-22","currency":"MYR"} [2026-02-09 15:00:08.000] normalize_amount called with: | Data: 25324.16 [2026-02-09 15:00:08.000] normalize_amount result: | Data: 25324.16 [2026-02-09 15:00:08.000] normalize_date_iso called with: | Data: 2019-07-22 [2026-02-09 15:00:08.000] Final extracted values | Data: {"invoice_number":"MYKL\/040619\/HONDA BR-V\/02","amount":"25324.16","due_date":"2019-09-20","invoice_date":"2019-07-22","currency":"MYR"} [2026-02-09 15:00:08.000] Attempting to save PDF to: /var/www/sandbox/pdfs/invoice_0c96b5971aad60c7f19bb246e81d3be2.pdf [2026-02-09 15:00:08.000] PDF saved successfully to /var/www/sandbox/pdfs/invoice_0c96b5971aad60c7f19bb246e81d3be2.pdf [2026-02-09 15:00:08.000] Database INSERT SUCCESS [2026-02-09 15:00:08.000] Adding to invoices array | Data: {"uuid":"0c96b5971aad60c7f19bb246e81d3be2","invoice_number":"MYKL\/040619\/HONDA BR-V\/02","amount":"25324.16","due_date":"2019-09-20","invoice_date":"2019-07-22","currency":"MYR","cached":false,"ocr_method":"lambda_primary","local_ocr_failed":true} [2026-02-09 15:00:08.000] --- Finished processing PDF #1 --- [2026-02-09 15:00:08.000] === TOTAL PROCESSING TIME: 5751.86ms === [2026-02-09 15:00:08.000] Total invoices processed: 1 [2026-02-09 15:00:08.000] Response sent, size: 264 bytes