Agoric / dapp-card-store

A example dapp for selling baseball cards and other NFTs
29 stars 16 forks source link

Error: `board does not have id: (a string)` #36

Closed ctjlewis closed 3 years ago

ctjlewis commented 3 years ago

I was able to spin the app up successfully yesterday, but am encountering a hard-to-trace error:

Error#2: board does not have id: (a string)
lockdown.umd.js:4491   at Function.makeError [as error] (http://localhost:3001/lockdown.umd.js:3015:19)
  at fullRevive (http://localhost:3001/static/js/main.chunk.js:6008:83)
  at unserialize (http://localhost:3001/static/js/main.chunk.js:6091:19)
  at CTP_RETURN (http://localhost:3001/static/js/main.chunk.js:1444:16)
  at dispatch (http://localhost:3001/static/js/main.chunk.js:1524:9)
  at onMessage (http://localhost:3001/static/js/main.chunk.js:8747:25)
  at http://localhost:3001/static/js/main.chunk.js:11224:13

Any thoughts on what might be causing this / where to start debugging?

erights commented 3 years ago

Do you see a "Sent as " anywhere in your log? Could you provide the entire log output or explain how to reproduce? Thanks.

ctjlewis commented 3 years ago

@erights Apologies for not including more information—this seemed to be nondeterministic (couldn't figure how to reproduce), and seems to have resolved by cleaning out _agstate and rerunning agoric install.

Will close, this issue will be here if anyone else encounters, will reopen with more context if I do the same.

katelynsills commented 3 years ago

@ctjlewis If it happens again, a possible cause might be running api/deploy.js before contract/deploy.js, but I'm glad everything cleared up for you. Thank you for posting these issues! It's tremendously helpful to see where problems are arising.

ctjlewis commented 3 years ago

@katelynsills No worries at all! I actually left the server running overnight and when I came back to it, I got this error—super sorry I couldn't give more context. I will make sure to bump this if I encounter again, appreciate this team's receptiveness a lot!

(I did re-deploy both contracts also, I believe it was related to the client.)

ctjlewis commented 3 years ago

Left the service running again and am encountering errors that seem related. Not reopening this, but will sort of explain what the situation looks like:

2021-09-27T16:16:31.940Z SwingSet: kernel: error in kernel.deliver: (RangeError#8)
RangeError#8: vat v10 in delivery , not idle : reentrant delivery?

  at assertOldState (eval at <anonymous> (eval at makeEvaluateFactory (file:///home/christian/agoric-sdk/node_modules/ses/dist/ses.umd.js:1:1)), <anonymous>:130:14)
  at Object.delivery (eval at <anonymous> (eval at makeEvaluateFactory (file:///home/christian/agoric-sdk/node_modules/ses/dist/ses.umd.js:1:1)), <anonymous>:160:7)
  at Object.deliverToVat (eval at <anonymous> (eval at makeEvaluateFactory (file:///home/christian/agoric-sdk/node_modules/ses/dist/ses.umd.js:1:1)), <anonymous>:275:27)
  at async deliverAndLogToVat (eval at <anonymous> (eval at makeEvaluateFactory (file:///home/christian/agoric-sdk/node_modules/ses/dist/ses.umd.js:1:1)), <anonymous>:436:30)
  at async deliverToVat (eval at <anonymous> (eval at makeEvaluateFactory (file:///home/christian/agoric-sdk/node_modules/ses/dist/ses.umd.js:1:1)), <anonymous>:499:21)
  at async deliverToTarget (eval at <anonymous> (eval at makeEvaluateFactory (file:///home/christian/agoric-sdk/node_modules/ses/dist/ses.umd.js:1:1)), <anonymous>:531:23)
  at async processQueueMessage (eval at <anonymous> (eval at makeEvaluateFactory (file:///home/christian/agoric-sdk/node_modules/ses/dist/ses.umd.js:1:1)), <anonymous>:761:23)
  at async Object.run (eval at <anonymous> (eval at makeEvaluateFactory (file:///home/christian/agoric-sdk/node_modules/ses/dist/ses.umd.js:1:1)), <anonymous>:1131:27)
  at async processKernel (packages/solo/src/start.js:172:5)
  at async deliverInboundCommand (packages/solo/src/start.js:204:7)

2021-09-27T16:16:31.940Z web: 127.0.0.1:36924[29]: inbound error: (RangeError#8) from {
  "type": "ws/meta",
  "meta": {
    "channelID": 29,
    "dispatcher": "onClose",
    "origin": "http://localhost:8000",
    "query": {
      "isQuery": true,
      "suggestedDappPetname": "cardStore"
    },
    "url": "/private/wallet-bridge",
    "date": 1632759391916
  }
}
UnhandledPromiseRejectionWarning: vat (a string) in (a string), not (a string): (a string)

Also, after running agoric install && agoric start --reset, suddenly getting interesting ESM errors due the import 'ws' statement in Agoric SDK's entrypoint.js, i.e. the Agoric CLI itself has broken:

$ agoric
internal/process/esm_loader.js:74
    internalBinding('errors').triggerUncaughtException(
                              ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '/home/christian/agoric-sdk/packages/agoric-cli/node_modules/ws/' imported from /home/christian/agoric-sdk/packages/agoric-cli/lib/entrypoint.js
Did you mean to import ws/index.js?

This was resolved with cd ~/agoric-sdk && git pull && yarn install && yarn build—this CLI call could be trivially added as agoric update to add an easy escape hatch for this type of situation and also adding easy update functionality.