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-07-13 06:23:39Z]: 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: f9a06d9f-56d6-402e-8f80-8ae74c041b00 Correlation ID: ad7b5f02-ad15-443a-b163-b00f7c1259a0 Timestamp: 2026-07-13 06:23:39Z - Correlation ID: ad7b5f02-ad15-443a-b163-b00f7c1259a0 - Trace ID: f9a06d9f-56d6-402e-8f80-8ae74c041b00
(node:4812) [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-07-13 06:23:39Z]: 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: 9b518973-49e8-498c-98ca-05d0e10c0500 Correlation ID: 92cb591b-696a-4341-aeff-667e397f18ab Timestamp: 2026-07-13 06:23:39Z - Correlation ID: 92cb591b-696a-4341-aeff-667e397f18ab - Trace ID: 9b518973-49e8-498c-98ca-05d0e10c0500
Error getting the secret: invalid_client: 7000222 - [2026-07-13 06:23:40Z]: 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: 9b518973-49e8-498c-98ca-05d0e40c0500 Correlation ID: 3adabba6-cd51-476c-97c7-d92e6a0d30d0 Timestamp: 2026-07-13 06:23:40Z - Correlation ID: 3adabba6-cd51-476c-97c7-d92e6a0d30d0 - Trace ID: 9b518973-49e8-498c-98ca-05d0e40c0500
Error getting the secret: invalid_client: 7000222 - [2026-07-13 06:23:40Z]: 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: f9a06d9f-56d6-402e-8f80-8ae75b041b00 Correlation ID: 07f35845-cde0-46ce-8ce1-59e27c852cb4 Timestamp: 2026-07-13 06:23:40Z - Correlation ID: 07f35845-cde0-46ce-8ce1-59e27c852cb4 - Trace ID: f9a06d9f-56d6-402e-8f80-8ae75b041b00
Error getting the secret: invalid_client: 7000222 - [2026-07-13 06:23:40Z]: 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: 386de887-56e2-400f-9e3f-5f6308881500 Correlation ID: 7dfb3976-9572-46dc-8339-0650d1095c0f Timestamp: 2026-07-13 06:23:40Z - Correlation ID: 7dfb3976-9572-46dc-8339-0650d1095c0f - Trace ID: 386de887-56e2-400f-9e3f-5f6308881500
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)