stacks-archive / radiks-server

A server for indexing data in decentralized applications
MIT License
54 stars 19 forks source link

Error accessing data #26

Closed moxiegirl closed 4 years ago

moxiegirl commented 5 years ago

This error is showing up in the Stackit test app. @hstove Sahana believes it is the server not the code.

  1. Install the code from this repo: https://github.com/moxiegirl/radix-code
  2. Install mongodb with home brew
  3. Install the latest radiks-server
  4. Start the code npm start
  5. Create a block

image

When the create returns the user to the dashboard:

not available  bn.js:598 Uncaught (in promise) TypeError: Cannot read property '-1' of null at BN.bitLength (bn.js:598) at Point._hasDoubles (base.js:303) at Point.mul (short.js:403) at KeyPair.getPublic (key.js:63) at encryptECIES (ec.js:114) at helpers.js:138 at Array.forEach (<anonymous>) at encryptObject (helpers.js:121) at async http:/127.0.0.…js/0.chunk.js:77439 

You should see the create in the database so the connection does work. As the create block stores data:

image

uonuon commented 4 years ago

The '-1' Error usually happens when the user is not signed in correctly, or the user is not available in radiks models, try to use User.createWithCurrentUser(); before the user start his session or logging in

moxiegirl commented 4 years ago

Thanks for the comment. @uonuon @friedger actually had a PR on the sample application with this fix but that call is already in the app which is gen'ing the error.

https://github.com/blockstack/stackit/pull/7

hstove commented 4 years ago

As @uonuon mentioned, this was due to not being signed in properly. I made the fix in @moxiegirl's app, which others can see here: https://github.com/blockstack/stackit/pull/8

I also made an issue for having better error messages: https://github.com/blockstack/radiks/issues/52