Azure-Samples / container-apps-store-api-microservice

Sample microservices solution using Azure Container Apps, Dapr, Cosmos DB, and Azure API Management
MIT License
340 stars 420 forks source link

Error Viewing Inventory Status #31

Open DanWahlin opened 2 years ago

DanWahlin commented 2 years ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [X ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

  1. Launch the app in VS Code and enable Remote Containers.
  2. Run debug All Services.
  3. Web page launches and an order can be created and viewed.
  4. When trying to view the Inventory status for the order Id (I created an order with an Id of 2) a 500 error occurs.

Any log messages given by the failure

vscode ➜ /workspaces/container-apps-store-api-microservice/node-service $  cd /workspaces/container-apps-store-api-microservice/node-service ; /usr/bin/env DAPR_HTTP_PORT=3501 DAPR_GRPC_PORT=50001 DAPR_METRICS_PORT=9091 INVENTORY_SERVICE_NAME=go-app ORDER_SERVICE_NAME=python-app PORT=3000 'NODE_OPTIONS=--require /vscode/vscode-server/bin/linux-x64/e4503b30fc78200f846c62cf8091b76ff5547662/extensions/ms-vscode.js-debug/src/bootloader.bundle.js --inspect-publish-uid=http' 'VSCODE_INSPECTOR_OPTIONS={"inspectorIpc":"/tmp/node-cdp.689-3.sock","deferredMode":false,"waitForDebugger":"","execPath":"/usr/local/share/nvm/current/bin/node","onlyEntrypoint":false,"autoAttachMode":"always","mandatePortTracking":true,"fileCallback":"/tmp/node-debug-callback-8bab54b1c8fd9f9d"}' /usr/local/share/nvm/current/bin/npm run start 
Debugger attached.

> node-service@0.0.0 start /workspaces/container-apps-store-api-microservice/node-service
> node ./bin/www

Debugger attached.
listening on port 3000
GET /dapr/config 404 4956.315 ms - 1461
GET / 304 147.368 ms - -
GET /stylesheets/style.css 304 9.754 ms - -
GET /script.js 304 30.656 ms - -
GET /favicon.ico 404 27.534 ms - 1461
Service invoke to: http://localhost:3501/order?id=2
GET /order?id=2 304 264.462 ms - -
(node:11236) UnhandledPromiseRejectionWarning: Error: Request failed with status code 500
    at createError (/workspaces/container-apps-store-api-microservice/node-service/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/workspaces/container-apps-store-api-microservice/node-service/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/workspaces/container-apps-store-api-microservice/node-service/node_modules/axios/lib/adapters/http.js:293:11)
    at IncomingMessage.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1333:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11236) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:11236) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Expected/desired behavior

Show inventory status

OS and Version?

Windows 10 21H2 (OS Build 19044.1889) - on a virtual machine provided to me for use in another scenario

Versions

VS Code 1.70.2