iisnode encountered an error when processing the request.

HRESULT: 0x2
HTTP status: 500
HTTP subStatus: 1002
HTTP reason: Internal Server Error

You are receiving this HTTP 200 response because system.webServer/iisnode/@devErrorsEnabled configuration setting is 'true'.

In addition to the log of stdout and stderr of the node.exe process, consider using debugging and ETW traces to further diagnose the problem.

The last 64k of the output generated by the node.exe process to stderr is shown below:

Error getting the secret: invalid_client: 7000222 - [2026-10-06 12:24:47Z]: AADSTS7000222: The provided client secret keys for app '1a3f705e-321b-477c-a2a9-dd6e240f8c1e' are expired. Visit the Azure portal to create new keys for your app: https://aka.ms/NewClientSecret, or consider using certificate credentials for added security: https://aka.ms/certCreds. Trace ID: 5659115d-eab0-4984-8828-505cdd12c900 Correlation ID: c09baef1-a0d2-4b98-b817-8c8651085146 Timestamp: 2026-10-06 12:24:47Z - Correlation ID: c09baef1-a0d2-4b98-b817-8c8651085146 - Trace ID: 5659115d-eab0-4984-8828-505cdd12c900
(node:3220) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Error getting the secret: invalid_client: 7000222 - [2026-10-06 12:24:47Z]: AADSTS7000222: The provided client secret keys for app '1a3f705e-321b-477c-a2a9-dd6e240f8c1e' are expired. Visit the Azure portal to create new keys for your app: https://aka.ms/NewClientSecret, or consider using certificate credentials for added security: https://aka.ms/certCreds. Trace ID: 9ddc9e32-c5a9-43b0-8652-3fad8d780201 Correlation ID: c8e8f0cf-8ff6-45d5-8347-794adc293da6 Timestamp: 2026-10-06 12:24:47Z - Correlation ID: c8e8f0cf-8ff6-45d5-8347-794adc293da6 - Trace ID: 9ddc9e32-c5a9-43b0-8652-3fad8d780201
Error getting the secret: invalid_client: 7000222 - [2026-10-06 12:24:48Z]: AADSTS7000222: The provided client secret keys for app '1a3f705e-321b-477c-a2a9-dd6e240f8c1e' are expired. Visit the Azure portal to create new keys for your app: https://aka.ms/NewClientSecret, or consider using certificate credentials for added security: https://aka.ms/certCreds. Trace ID: 7829e540-f6ea-4cdc-966b-bca5ee0f1401 Correlation ID: fa278d48-a356-4967-95ae-ae73a813eded Timestamp: 2026-10-06 12:24:48Z - Correlation ID: fa278d48-a356-4967-95ae-ae73a813eded - Trace ID: 7829e540-f6ea-4cdc-966b-bca5ee0f1401
Error getting the secret: invalid_client: 7000222 - [2026-10-06 12:24:48Z]: AADSTS7000222: The provided client secret keys for app '1a3f705e-321b-477c-a2a9-dd6e240f8c1e' are expired. Visit the Azure portal to create new keys for your app: https://aka.ms/NewClientSecret, or consider using certificate credentials for added security: https://aka.ms/certCreds. Trace ID: 77744356-4c00-40da-ba59-253ea7521f00 Correlation ID: c98c9598-fae2-4bfb-9e63-6556e15c065a Timestamp: 2026-10-06 12:24:48Z - Correlation ID: c98c9598-fae2-4bfb-9e63-6556e15c065a - Trace ID: 77744356-4c00-40da-ba59-253ea7521f00
Error getting the secret: invalid_client: 7000222 - [2026-10-06 12:24:48Z]: AADSTS7000222: The provided client secret keys for app '1a3f705e-321b-477c-a2a9-dd6e240f8c1e' are expired. Visit the Azure portal to create new keys for your app: https://aka.ms/NewClientSecret, or consider using certificate credentials for added security: https://aka.ms/certCreds. Trace ID: 8a93b494-11ac-4607-91a4-ca49f3ee2100 Correlation ID: ff91aa46-f6e1-4bae-9b8d-3ce224fc4780 Timestamp: 2026-10-06 12:24:48Z - Correlation ID: ff91aa46-f6e1-4bae-9b8d-3ce224fc4780 - Trace ID: 8a93b494-11ac-4607-91a4-ca49f3ee2100
Application has thrown an uncaught exception and is terminated:
TypeError: Cannot read properties of undefined (reading 'username')
    at C:\vehicle_status_API\server.js:30:32
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)