Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot deliver "getBridge" to target. error from agoric start #6189

Closed
cboydstun opened this issue Sep 13, 2022 · 28 comments
Closed

Cannot deliver "getBridge" to target. error from agoric start #6189

cboydstun opened this issue Sep 13, 2022 · 28 comments
Assignees
Labels
agoric-cli package: agoric-cli bug Something isn't working devex developer experience vaults_triage DO NOT USE

Comments

@cboydstun
Copy link

cboydstun commented Sep 13, 2022

Describe the bug

An error appears when running agoric start --reset --verbose to launch my Ag Solo chain. I'm unable to interact with my Wallet nor deploy the API, but the REPL is responsive.

To Reproduce

Steps to reproduce the behavior:

  1. Navigate to dapp directory. (that is: agoric init my-dapp; cd my-dapp)
  2. Enter agoric start --reset --verbose.
  3. Let process and then scroll down to 'Deployed Wallet!
  4. See error immediately below:
SES_UNHANDLED_REJECTION: (TypeError#1)
TypeError#1: Cannot deliver getBridge to target; typeof target is undefined

Expected behavior

Expected to be able to interact with my wallet using the agoric open command. The browser does open to localhost:8000 but I'm unable to meaningfully interact with any of the elements.

Platform Environment

  • macOS and Node 16.17.0
  • Agoric v 0.16.0 14b20e6

Additional context

Working on deploying the card store dapp. The command agoric deploy ./contract/deploy.js works correctly and returns SUCCESS! contract code installed on Zoe. The command agoric deploy ./api/deploy.js fails with "nameKey" not found.

Output

terminalOutput_091322.pdf
The UI just spins out. Console output attached in pdf document.

@cboydstun cboydstun added the bug Something isn't working label Sep 13, 2022
@dckc
Copy link
Member

dckc commented Sep 14, 2022

I'm struggling to find Agoric v 0.16.0 fdf6ea2

@cboydstun
Copy link
Author

Thanks for your help! =)

from the "agoric-sdk" directory the command git describe --tags --always returns agoricxnet-7-880-g14b20e605

from my "card-store" dapp directory the command returns fdf6ea2

@0xshipthecode
Copy link
Contributor

I encountered the exact same error with master from 6th of September. Wallet app then hangs.

@dckc
Copy link
Member

dckc commented Sep 15, 2022

Did you see any more stack trace around TypeError#1: Cannot deliver getBridge?
I don't see it in the pdf attachment, but maybe I'm not looking in the right place.

@dckc
Copy link
Member

dckc commented Sep 15, 2022

Aha. Something missed the RUN->IST memo:

2022-09-13T01:14:14.261Z SwingSet: ls: v1: Error#1: nameKey not found: 
RUN

(edited title to reflect partial diagnosis)

@dckc dckc changed the title Ag Solo SES_UNHANDLED_REJECTION: (TypeError#1) nameKey not found: RUN from api/deploy script Sep 15, 2022
@cboydstun
Copy link
Author

Thanks for the follow up @vejmelkam and the support @dckc!

We've got the LatAm University conference tomorrow. Will this be fixed before then? Or should we let them know we've identified a bug, are working hard on it, and should postpone until next week?

I'd rather get ahead of it by telling them about the bug than letting them take the time for the session only to get derailed. Please advise.

@dckc
Copy link
Member

dckc commented Sep 16, 2022

Perhaps you were using the beta version of the card store dapp? If so, this looks like the problem:

  const moneyIssuerP = E(home.agoricNames).lookup('issuer', 'RUN');

https://github.com/Agoric/dapp-card-store/blob/13dae9f4220f7cd3fc4af8970aed5068e93f5f87/api/deploy.js#L96

You might try the replacement in the main branch:

  const moneyIssuerP = E(home.agoricNames).lookup('issuer', 'IST');

https://github.com/Agoric/dapp-card-store/blob/a02e584b07b6aa9674f3cb7b3135fd0edb0d8e19/api/deploy.js#L95

or you might try the whole main branch.

@samsiegart any recommendations?

@cboydstun
Copy link
Author

I don't think the error is dapp contract specific. I'm having the same difficulty while trying to spin up a generic "demo" dapp like the instructions at "Initialize demo Dapp Template" from the docs here. The problem comes from the very first terminal on agoric start --reset and prevents the wallet from loading.

@dckc
Copy link
Member

dckc commented Sep 20, 2022

Odd. We have robots that test those instructions on every change.

By "same difficulty" you mean you're seeing "nameKey" not found when you do agoric deploy ./api/deploy.js?

p.s. let's avoid "here" links when writing hyperlinks.

@cboydstun
Copy link
Author

Good morning! We're seeing "namekey" not found in Terminal 1 when attempting to launch to ag solo chain with the command agoric start --reset --verbose. 😣

@dckc
Copy link
Member

dckc commented Sep 20, 2022

I don't seem to have enough info to reproduce those symptoms. I recorded myself starting fro zero up thru agoric start --reset --verbose without seeing "nameKey" not found"

The recording captures the sdk version that I tried: 7165dea

@cboydstun
Copy link
Author

cboydstun commented Sep 20, 2022

okay back up I'm sorry... two different issues and I crossed streams before breakfast this morning....

Good morning! We're seeing "namekey" not found in Terminal 1 when attempting to launch to ag solo chain with the command agoric start --reset --verbose. 😣

APOLOGIES! We're seeing "SES UNHANDLED REJECTION: (TypeError#1) Cannot deliver "getBridge" to target." in Terminal 1*.

You and I @dckc saw this in my terminal together last Monday night. It's in your video at 6:23. That was the original bug described at the beginning of this thread. This issue is halting any interaction with my wallet for any other dapps like the faucet dapp.

I could not reproduce "nameKey" on execution of agoric deploy ./api/deploy.js this morning with the Agoric v 0.17.0 update.

@dckc dckc changed the title nameKey not found: RUN from api/deploy script Cannot deliver "getBridge" to target. error from agoric start Sep 20, 2022
@cboydstun
Copy link
Author

tried again this morning with agoric --version "0.17.0". This is the error that I've consistently encountered:

2022-09-20T13:16:50.334Z outbound: invoking deliverator; 7 new messages for sim-chain
Deployed Wallet!
SES_UNHANDLED_REJECTION: (TypeError#1)
TypeError#1: Cannot deliver getBridge to target; typeof target is undefined

2022-09-20T13:16:50.518Z web: 127.0.0.1:54329[1]: client closed
2022-09-20T13:16:51.336Z fake-chain: delivering to sim-chain (trips=20)
2022-09-20T13:16:51.615Z outbound: invoking deliverator; 6 new messages for sim-chain

@dckc
Copy link
Member

dckc commented Sep 20, 2022

yeah, without more of a stack trace, diagnosing that looks kinda challenging.

@cboydstun
Copy link
Author

So this is some odd terminal output that isn't to blame for my inability to interact with my wallet nor authorize any Dapp templates? Please advise thanks! =)

@dckc
Copy link
Member

dckc commented Sep 21, 2022

some discord discussion cites d952e56 as causing problems with local development. Using the previous commit, fedf049 , might be a work-around here. Give it a try, @cboydstun ?

@cboydstun
Copy link
Author

no unfortunately that branch showed the same bug and similarly had issues with the wallet in the browser...

@tgrecojs recommends dapp-fungible-faucet agoricxnet-7-19-gcb34f55da that i'll hunt for after some sleep 😴

@0xshipthecode
Copy link
Contributor

Just to help out a bit - this is the message I see in the browser console, when using current master (914626ebb15de990d61bc1a2fe45e8c68c90b8a0).

I did not investigate whether this is the source of the problem or not.

Error#1: Got unexpected jsonrpc version: {"ok":true,"res":{"obj":{"id":728885263733,"jsonrpc":"2.0","method":"status","params":{}},"type":"doesNotUnderstand"}}
lockdown.umd.js:6534   at s (http://localhost:8000/wallet/static/js/main.f0840d65.js:2:163904)
  at t.parseJsonRpcResponse (http://localhost:8000/wallet/static/js/main.f0840d65.js:2:164862)
  at t.HttpClient.execute (http://localhost:8000/wallet/static/js/main.f0840d65.js:2:321525)
  at async u.detectVersion (http://localhost:8000/wallet/static/js/main.f0840d65.js:2:345467)
  at async u.create (http://localhost:8000/wallet/static/js/main.f0840d65.js:2:345338)
  at async http://localhost:8000/wallet/static/js/858.502feaf5.chunk.js:1:6697

@0xshipthecode
Copy link
Contributor

0xshipthecode commented Sep 22, 2022

Also @cboydstun, if you need a commit version of master that has an operational wallet, use 3482e0d , that is:

git checkout 3482e0d98748c9b7995c93cbef9a06b0ec0fbea8

I will likely be using this same commit at Cosmoverse in Medellin for the intro workshop.

@dckc
Copy link
Member

dckc commented Sep 22, 2022

Thanks, @vejmelkam . For now, I made a community-dev branch pointed to 3482e0d from July 10.

@cboydstun in the docs where we tell people to clone agoric-sdk, perhaps it should say git clone -b community-dev https://github.com/Agoric/agoric-sdk.

@cboydstun
Copy link
Author

thanks so much @vejmelkam!!! thanks for the branch, too, @dckc! =)

I'd argue that we want the so called "community-dev branch" to be our main branch as we are the blockchain for builders. Adding complexity to the script will cause friction on installation for our newest of users.

@samsiegart
Copy link
Contributor

Sorry just catching up now, but yes we dropped ag-solo support for the wallet UI in d952e56 because smart wallet will be the main way users will interact with the chain in production. Ag-solo still has some use for development-related tasks but will possibly go away altogether.

This shift to smart wallet is drastically different from a UX perspective, and also requires substantial code changes to the dapps. We just unfortunately haven't had the resources to work on anything beyond PSM/Inter Protocol at the moment. This has surely created a pain point for BLDers trying out the sample dapps, which we should fix, but was less critical than Inter Protocol since it's technically MN-2-related.

In the meantime, a community-dev branch seems like an appropriate stop gap, so we can keep the dapps working with an older ag-solo-compatible sdk version until we're ready to make a consolidated effort to move everything to smart wallet. We're just stuck between a rock and a hard place right now. I think either way, the dapps will always need to be run with a specific version of the sdk, which should correspond to a certain release, because breaking changes can and will happen on the main branch before the dapps can be updated (and it's better to batch those updates together for certain releases to reduce churn).

I think it should be a priority to make sure @cboydstun is not blocked, but that may involve just saying some things are broken at the moment and we have to fix them when we have the time.

For card store, I may have forgot to merge a recent fix into the beta branch, so that could explain part of the problem.

@dckc dckc added agoric-cli package: agoric-cli devex developer experience labels Nov 3, 2022
@dckc
Copy link
Member

dckc commented Nov 3, 2022

@dckc
Copy link
Member

dckc commented Dec 8, 2022

Now that we updated devnet to agoricdev-16 which is supposed to support ag-solo style work, I'm trying the docker-compose ag-solo devnet docs and I see this in the logs. I'm still checking whether it's benign or gets in the way of important features.

ag-solo_1  | 2022-12-08T20:32:14.075Z chain-cosmos-sdk: gas estimate: 113044
ag-solo_1  | Deployed Wallet!
ag-solo_1  | SES_UNHANDLED_REJECTION: (TypeError#1)
ag-solo_1  | TypeError#1: Cannot deliver getBridge to target; typeof target is undefined
ag-solo_1  | 
ag-solo_1  | 2022-12-08T20:32:19.357Z chain-cosmos-sdk: gas estimate: 117458

p.s. REPL works but no purses display

This is consistent with the original problem report above. (I haven't tried to do any API stuff.)

@dckc
Copy link
Member

dckc commented Dec 13, 2022

Diagnosis: error initializing "cache coordinator" (benign)

We don't seem to wait long enough for home.wallet to be available:

const cache = makeCache(
E(E(E.get(bootP).wallet).getBridge()).getCacheCoordinator(),

stack trace using endo DEBUG options

DEBUG=track-turns TRACK_TURNS=enabled agoric start dev --reset --verbose
cf. https://github.com/endojs/endo/blob/master/packages/eventual-send/NEWS.md

2022-12-13T20:12:59.596Z outbound: invoking deliverator; 1 new messages for sim-chain

agoric: deploy: running /home/connolly/projects/agoric-sdk/packages/wallet/api/deploy.js
THROWN to top of event loop (TypeError#1)
TypeError#1: Cannot deliver getBridge to target; typeof target is undefined

TypeError#1 ERROR_NOTE: Thrown from: (Error#2) : 16 . 0
Nested error under TypeError#1
  Error#2: Event: 13.2
  
    at WebSocket.<anonymous> (packages/agoric-cli/src/deploy.js:302:36)
  
TypeError#1 ERROR_NOTE: Rejection from: (Error#3) : 15 . 0
Nested error under TypeError#1
  Error#3: Event: 13.3
  
    at WebSocket.<anonymous> (packages/agoric-cli/src/deploy.js:302:49)
  
REJECTED at top of event loop (TypeError#1)
2022-12-13T20:13:00.598Z fake-chain: delivering to sim-chain (trips=3)

DEBUG=track-turns gets clobbered

so I did this kludge:

agoric-sdk$ git diff
diff --git a/packages/agoric-cli/src/start.js b/packages/agoric-cli/src/start.js
index 6546a510b..f31289a2d 100644
--- a/packages/agoric-cli/src/start.js
+++ b/packages/agoric-cli/src/start.js
@@ -71,7 +71,7 @@ export default async function startMain(progname, rawArgs, powers, opts) {
     pspawnEnv.DEBUG = 'agoric,SwingSet:vat,SwingSet:ls';
   } else if (opts.verbose) {
     // Verbose vat logs (nondeterministic).
-    pspawnEnv.DEBUG = 'SwingSet:vat,SwingSet:ls';
+    pspawnEnv.DEBUG = 'SwingSet:vat,SwingSet:ls:track-turns';
   }
 
   const pspawn = makePspawn({ env: pspawnEnv, spawn, log, chalk });

@dckc
Copy link
Member

dckc commented Dec 13, 2022

The getBridge symptoms don't seem to be related to "cannot deploy the API". It seems to be a result of a stale cache.

It seems to work for me now (65d3f14 , default dapp):

~/projects$ agoric init thing2
~/projects$ cd thing2

~/projects/thing2/contract$ agoric deploy deploy.js 
Open CapTP connection to ws://127.0.0.1:8000/private/captp...o
agoric: deploy: running /home/connolly/projects/thing2/contract/deploy.js
agoric: deploy: Deploy script will run with Node.js ESM
- Installing Contract Name: fungibleFaucet
- Installed Contract Name: fungibleFaucet
writing /home/connolly/projects/thing2/ui/public/conf/installationConstants.js

~/projects/thing2/contract$ cd ../api
~/projects/thing2/api$ agoric deploy deploy.js
Open CapTP connection to ws://127.0.0.1:8000/private/captp...o
agoric: deploy: running /home/connolly/projects/thing2/api/deploy.js
agoric: deploy: Deploy script will run with Node.js ESM
- SUCCESS! contract instance is running on Zoe
Retrieving Board IDs for issuers and brands
-- Contract Name: fungibleFaucet
-- INSTANCE_BOARD_ID: board00530
-- TOKEN_ISSUER_BOARD_ID: board05432
-- TOKEN_BRAND_BOARD_ID: board04431
writing /home/connolly/projects/thing2/ui/public/conf/defaults.js

double-checked with card store dapp:

~/projects$ agoric init thing3 --dapp-template dapp-card-store
~/projects$ cd thing3

~/projects/thing3$ cd contract/
~/projects/thing3/contract$ agoric deploy deploy.js 
Open CapTP connection to ws://127.0.0.1:8000/private/captp...o
agoric: deploy: running /home/connolly/projects/thing3/contract/deploy.js
agoric: deploy: Deploy script will run with Node.js ESM
- SUCCESS! contract code installed on Zoe
-- Contract Name: cardStore
-- Installation Board Id: board02733
-- Auction Installation Board Id: board03935
-- Auction Items Installation Board Id: board01034
writing /home/connolly/projects/thing3/ui/src/conf/installationConstants.js

~/projects/thing3/contract$ cd ../api
~/projects/thing3/api$ agoric deploy deploy.js 
Open CapTP connection to ws://127.0.0.1:8000/private/captp...o
agoric: deploy: running /home/connolly/projects/thing3/api/deploy.js
agoric: deploy: Deploy script will run with Node.js ESM
- SUCCESS! contract instance is running on Zoe
Retrieving Board IDs for issuers and brands
-- Contract Name: cardStore
-- INSTANCE_BOARD_ID: board05736
-- CARD_ISSUER_BOARD_ID: board03138
-- CARD_BRAND_BOARD_ID: board02437
writing /home/connolly/projects/thing3/ui/src/conf/defaults.js

@dckc
Copy link
Member

dckc commented Dec 13, 2022

after some testing, community-dev = master = 65d3f14

@dckc dckc assigned michaelfig and unassigned dckc Dec 13, 2022
@michaelfig
Copy link
Member

Can't reproduce on master (as of 0cc126e). Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agoric-cli package: agoric-cli bug Something isn't working devex developer experience vaults_triage DO NOT USE
Projects
None yet
Development

No branches or pull requests

7 participants