EOSCommunity.org Forums

Unable to sign transaction from web

We are getting ‘Unable to sign transaction’ from anchor when trying to sign a request on our web app to the Telos mainnet. It only occurs for one particular transactions for our app – all others work fine using the same version and api. When attempting to sign this transaction, it rejects during the ‘Prepare’ step and the web popup hangs indefinitely saying ‘Loading: Preparing Request’

Any assistance here? I don’t know how to debug what’s causing the issue here since our other transactions are working fine when called in the same way.

Any way I can see this happening by using the app?

That message you cited is normal and shouldn’t stop the UI from proceeding though. It sounds like another error is occurring during the preparation of the request before it is sent to Anchor - most likely with some part of the transaction not being valid (or a bug).

There may also be some hints as to what’s up with the transaction in the network response from the Fuel API. It’ll be a request to /v1/resource_provider/request_transaction and in the JSON response we do return any errors our backend gets while interpreting the request.

Actually I did some more investigation, it fails before sending anything. No network activity is occuring.

I edited out the message I mentioned above that was for a different transaction for clarity.

I’d need either an error its throwing or something more to provide any assistance. Either that or seeing it happen live on my machine so I can poke around and see what’s causing it.

The error is ‘Unable to sign transaction’ – it’s very unhelpful. Then its stuck here:

I’m not sure if there is an easy way for you to see it happen yourself – I’ll see what I can do. Regardless you definitely have a bug because the error is produced but the UX is stuck.

EDIT: Stack trace:

Error: Unable to sign transaction
at AnchorUser. (AnchorUser.js:53)
at Generator.throw ()
at rejected (AnchorUser.js:6)

And the generating error stack trace:

AnchorUser.js:50 Error: Found null for non-optional type: string
at encodeInner (eosio-core.m.js:1480)
at encodeAny (eosio-core.m.js:1467)
at encodeInner (eosio-core.m.js:1502)
at encodeAny (eosio-core.m.js:1467)
at abiEncode (eosio-core.m.js:1439)
at Function.from (eosio-core.m.js:3118)
at encodeAction (esr.m.js:1288)
at encode (esr.m.js:537)
at Array.map ()
at Function.createSync (esr.m.js:557)

It looks like that specific transaction is passing a null value into something that requires a string.

What kind of transaction is it? I’d check that you are assembling the values for it properly.

We’ll also open an issue to prevent it getting stuck there and actually throwing the error up to the user interface :+1:

Found the issue – it was a null :slight_smile:
Thanks for the help

1 Like