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-15 15:21:46Z]: 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: cf63ff81-3c20-4e1c-ba63-ceea02a01800 Correlation ID: be31cfb4-f421-4f7a-9db0-204dfa1111eb Timestamp: 2026-07-15 15:21:46Z - Correlation ID: be31cfb4-f421-4f7a-9db0-204dfa1111eb - Trace ID: cf63ff81-3c20-4e1c-ba63-ceea02a01800
(node:5784) [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-15 15:21:46Z]: 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: e47f1aad-e39d-4bda-b32d-176cec1f1200 Correlation ID: 457c197e-3f6b-45c8-b92b-78c9cbdb7dbc Timestamp: 2026-07-15 15:21:46Z - Correlation ID: 457c197e-3f6b-45c8-b92b-78c9cbdb7dbc - Trace ID: e47f1aad-e39d-4bda-b32d-176cec1f1200
Error getting the secret: invalid_client: 7000222 - [2026-07-15 15:21: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: 508c67c2-f76e-45cc-9169-f911ae361a00 Correlation ID: 457d18e4-25f7-4cd0-8aa5-fdca84fa42fa Timestamp: 2026-07-15 15:21:47Z - Correlation ID: 457d18e4-25f7-4cd0-8aa5-fdca84fa42fa - Trace ID: 508c67c2-f76e-45cc-9169-f911ae361a00
Error getting the secret: invalid_client: 7000222 - [2026-07-15 15:21: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: e0ed0d10-c2ec-4afc-b935-9a77e7651500 Correlation ID: 112f5b3a-ea6a-42c3-b36c-2345d4396207 Timestamp: 2026-07-15 15:21:47Z - Correlation ID: 112f5b3a-ea6a-42c3-b36c-2345d4396207 - Trace ID: e0ed0d10-c2ec-4afc-b935-9a77e7651500
Error getting the secret: invalid_client: 7000222 - [2026-07-15 15:21: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: c1e6cd25-05f3-4319-868d-528f439b1300 Correlation ID: 5ecbade9-6332-4ba5-90b8-ae1a0c40f5e4 Timestamp: 2026-07-15 15:21:47Z - Correlation ID: 5ecbade9-6332-4ba5-90b8-ae1a0c40f5e4 - Trace ID: c1e6cd25-05f3-4319-868d-528f439b1300
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)