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-06-17 09:42:21Z]: 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: dffb39f0-39fa-485a-af6b-3369f2dc6100 Correlation ID: 7f7d9373-73c0-4a6e-8454-f3f3b97651aa Timestamp: 2026-06-17 09:42:21Z - Correlation ID: 7f7d9373-73c0-4a6e-8454-f3f3b97651aa - Trace ID: dffb39f0-39fa-485a-af6b-3369f2dc6100
(node:5936) [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-06-17 09:42:21Z]: 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: 40eb83c7-c44a-47e6-9c57-0b17b1d41400 Correlation ID: a2ebf3ab-0bca-436c-9a03-4f60226c44d2 Timestamp: 2026-06-17 09:42:21Z - Correlation ID: a2ebf3ab-0bca-436c-9a03-4f60226c44d2 - Trace ID: 40eb83c7-c44a-47e6-9c57-0b17b1d41400
Error getting the secret: invalid_client: 7000222 - [2026-06-17 09:42:21Z]: 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: 40eb83c7-c44a-47e6-9c57-0b17b3d41400 Correlation ID: 3cf28afd-1991-409a-bd35-dd74e2fea6f3 Timestamp: 2026-06-17 09:42:21Z - Correlation ID: 3cf28afd-1991-409a-bd35-dd74e2fea6f3 - Trace ID: 40eb83c7-c44a-47e6-9c57-0b17b3d41400
Error getting the secret: invalid_client: 7000222 - [2026-06-17 09:42:21Z]: 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: 465c393f-ae04-4541-b48b-502541f74c00 Correlation ID: 1a72a484-c4c5-465d-bd06-e67d57ec7766 Timestamp: 2026-06-17 09:42:21Z - Correlation ID: 1a72a484-c4c5-465d-bd06-e67d57ec7766 - Trace ID: 465c393f-ae04-4541-b48b-502541f74c00
Error getting the secret: invalid_client: 7000222 - [2026-06-17 09:42:22Z]: 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: 5c5da41e-995d-4ff2-90b3-477bdbd85100 Correlation ID: 1ec3fbe3-5bdc-4759-95ef-6d04ce2899c7 Timestamp: 2026-06-17 09:42:22Z - Correlation ID: 1ec3fbe3-5bdc-4759-95ef-6d04ce2899c7 - Trace ID: 5c5da41e-995d-4ff2-90b3-477bdbd85100
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)