Convex-Dev / convex

Convex Main Repository - Decentralised platform for the Internet of Value
https://convex.world
Other
93 stars 30 forks source link

Desktop yields a :TIMEOUT but expected :TRUST exception #513

Open ash-mcc opened 2 weeks ago

ash-mcc commented 2 weeks ago

Desktop yields a :TIMEOUT but expected :TRUST exception

When using the Desktop REPL in Query mode, I get this:

(eval-as #43 (asset/balance ft1coin))
 Exception: :TRUST Cannot control address with nil controller set: #43

...which is expected.

When I try to do the same in Transact mode, I get this:

(eval-as #43 (asset/balance ft1coin))
 Exception: :TIMEOUT null

...which I wouldn't have expected.

At the same time, I see the Desktop logging this:

11:15:51.377 [Connection NIO client selector loop] WARN  convex.net.ResultConsumer - Exception handling result
convex.core.exceptions.BadFormatException: Unexpected Exception when decoding: Missing hash:0x41c18cb1c2739a4264e4b46a63a2854561f4a1e6083d836af71d93d609b85b84 in store EtchStore: /private/var/folders/wl/ff7688p93t1b3tm2l0bv93yc0000gn/T/convex-db-17208883811936279990.tmp
Caused by: convex.core.exceptions.MissingDataException: Missing hash:0x41c18cb1c2739a4264e4b46a63a2854561f4a1e6083d836af71d93d609b85b84 in store EtchStore: /private/var/folders/wl/ff7688p93t1b3tm2l0bv93yc0000gn/T/convex-db-17208883811936279990.tmp

Cheers, Ash

mikera commented 2 weeks ago

Thanks for the report!

I currently get the same :TRUST error in query and transact mode.

That particular error message is indicative of a corrupt Etch file, because the peer can't find some data it expects to be there. It is possible that an earlier issue caused the corruption (or possibly a very old version?).

Can you please try:

ash-mcc commented 2 weeks ago

Hi Mike, I deleted my ~/.convex/etch.db plus a couple of older convex related tmp files I found in my macOS' tmp dir. I mvn clean install-ed the latest commit. (Not in a position at the moment to try your snapshot JAR on Google Drive.) And... I can reproduce what seem like the same issue: In the Desktop REPL, in Query mode, this:

(eval-as #43 (balance #41))

yields an expected :TRUST exception. But when I try the same in Transact mode, it yields a :TIMEOUT and I see the Desktop logging:

18:44:36.766 [Connection NIO client selector loop] WARN  convex.net.ResultConsumer - Exception handling result
convex.core.exceptions.BadFormatException: Unexpected Exception when decoding: Missing hash:0xcba712f2c2402333de1d1054b6e27d0786842da7251da8ae94d54f39d86d78e9 in store EtchStore: /private/var/folders/wl/ff7688p93t1b3tm2l0bv93yc0000gn/T/convex-db-6948005365238454646.tmp
Caused by: convex.core.exceptions.MissingDataException: Missing hash:0xcba712f2c2402333de1d1054b6e27d0786842da7251da8ae94d54f39d86d78e9 in store EtchStore: /private/var/folders/wl/ff7688p93t1b3tm2l0bv93yc0000gn/T/convex-db-6948005365238454646.tmp

So it doesn't seem happy about what is in those tmp files (that it has just created). ... O, just a thought, I'm running both a Peer process and a Desktop process on my Mac. I don't suppose that there is any way that either would pick up the other's tmp file. Hmmm - unlikely. Anyway, tomorrow I'll try to download your Google Drive JAR to try that. ...And I'll let you know.