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-04-21 02:46:57Z]: 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: 4a427a64-9162-458e-b1a9-bb40a3350c00 Correlation ID: ecf443fe-f8c2-4924-aefe-3a7944de8c87 Timestamp: 2026-04-21 02:46:57Z - Correlation ID: ecf443fe-f8c2-4924-aefe-3a7944de8c87 - Trace ID: 4a427a64-9162-458e-b1a9-bb40a3350c00
(node:1968) [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-04-21 02:46:58Z]: 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: 3552a594-5a9b-4060-80c9-64636a9c1d00 Correlation ID: e1a4ab45-ef5e-480e-94c5-adcf4512a2d7 Timestamp: 2026-04-21 02:46:58Z - Correlation ID: e1a4ab45-ef5e-480e-94c5-adcf4512a2d7 - Trace ID: 3552a594-5a9b-4060-80c9-64636a9c1d00
Error getting the secret: invalid_client: 7000222 - [2026-04-21 02:46:59Z]: 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: 867f2eb0-1a9d-4d91-93eb-c57eb4f41b00 Correlation ID: 816c9a3a-31fc-42a0-b4f8-271e597a07ec Timestamp: 2026-04-21 02:46:59Z - Correlation ID: 816c9a3a-31fc-42a0-b4f8-271e597a07ec - Trace ID: 867f2eb0-1a9d-4d91-93eb-c57eb4f41b00
Error getting the secret: invalid_client: 7000222 - [2026-04-21 02:47:00Z]: 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: fc1e74e9-d954-4057-a96c-873511880d00 Correlation ID: 604ecfeb-6138-4345-89ea-bcef74cb04ce Timestamp: 2026-04-21 02:47:00Z - Correlation ID: 604ecfeb-6138-4345-89ea-bcef74cb04ce - Trace ID: fc1e74e9-d954-4057-a96c-873511880d00
Error getting the secret: invalid_client: 7000222 - [2026-04-21 02:47:00Z]: 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: 081d80ca-ef21-4276-8443-600f7dc72300 Correlation ID: 28de600d-3a5d-403f-96bb-735c46e3673b Timestamp: 2026-04-21 02:47:00Z - Correlation ID: 28de600d-3a5d-403f-96bb-735c46e3673b - Trace ID: 081d80ca-ef21-4276-8443-600f7dc72300
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)