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

bug: "result": "RPC client error: sendRequest failed: http status 401 Unauthorized unmarshaling response: EOF" on querying account-address #3384

Closed
jcstein opened this issue May 8, 2024 · 10 comments
Assignees
Labels
bug Something isn't working external Issues created by non node team members

Comments

@jcstein
Copy link
Member

jcstein commented May 8, 2024

Celestia Node version

v0.13.5

OS

macOS

Install tools

docs

Others

No response

Steps to reproduce it

  1. run a light node with state access using celestia light start --p2p.network arabica --core.ip validator-1.celestia-arabica-11.com
  2. try to query the account address with celestia state account-address --node.store $HOME/.celestia-light-arabica-11
  3. receive result:
{
  "result": "RPC client error: sendRequest failed: http status 401 Unauthorized unmarshaling response: EOF"
}

Expected result

account address

Actual result

http status 401 Unauthorized unmarshaling response: EOF

Relevant log output

No response

Notes

No response

@jcstein jcstein added the bug Something isn't working label May 8, 2024
@github-actions github-actions bot added the external Issues created by non node team members label May 8, 2024
@ramin ramin self-assigned this May 9, 2024
@renaynay renaynay assigned renaynay and unassigned ramin May 9, 2024
@distractedm1nd
Copy link
Collaborator

I'm assuming this is fixed by this pr and #3385 can fix it once released.

Expected Result should probably not be "account address", 401 signifies you did not have permission to access that endpoint -- meaning the expected result should be an error and not a result, with a cleaner ouput.

The 401 could either be internally from node/jsonrpc (by not setting the auth token), or from your networking setup between the client and node. Could you provide more details from the setup?

@jcstein
Copy link
Member Author

jcstein commented May 9, 2024

my setup is just me running celestia light start --p2p.network arabica --core.ip validator-1.celestia-arabica-11.com in one terminal, and in another, trying to get the account address celestia state account-address --node.store $HOME/.celestia-light-arabica-11

it also fails if i provide the auth token by doing:

export CELESTIA_NODE_AUTH_TOKEN=$(celestia light auth write --p2p.network arabica)
celestia state account-address --token $CELESTIA_NODE_AUTH_TOKEN

@jcstein
Copy link
Member Author

jcstein commented May 9, 2024

here is a loom

@jcstein
Copy link
Member Author

jcstein commented May 9, 2024

hold on a second...i think the auth token needs to be admin not write, but i guess there is still a bug in here as i should receive a more useful and readable error

export CELESTIA_NODE_AUTH_TOKEN=$(celestia light auth admin --p2p.network arabica)
celestia state account-address --token $CELESTIA_NODE_AUTH_TOKEN
{
  "result": "celestia1lvns26q9d43a5fcl3xjmfy3auk6fekf2x5pp93"
}

@Wondertan
Copy link
Member

hold on a second...i think the auth token needs to be admin not write, but i guess there is still a bug in here as i should receive a more useful and readable error

Hmn, the logic added by @mastergaurang94 that removes the need to specify the store should have automatically gotten the admin token. Do i understand correctly that you don't have this issue when you specify admin token, but when not it fails?

@jcstein
Copy link
Member Author

jcstein commented May 9, 2024

@Wondertan #3246 is not included in v0.13.5 release

if running:

  1. the nodecelestia light start --p2p.network arabica --core.ip validator-1.celestia-arabica-11.com
  2. then requesting account address with no auth token or node store, it errors because it needs either auth or node store, as expected.
celestia state account-address
Error: cant get the access to the auth token: token/node-store flag was not specified
Usage:
  celestia state account-address [flags]

Flags:
  -h, --help   help for account-address

Global Flags:
      --node.store string   The path to root/home directory of your Celestia Node Store
      --token string        Authorization token
      --url string          Request URL (default "http://localhost:26658")

@Wondertan
Copy link
Member

Ah, I see, thanks for correction

@jcstein
Copy link
Member Author

jcstein commented May 9, 2024

and now that i've changed the auth token to admin, i cannot reproduce an error where:

celestia state account-address --node.store $HOME/.celestia-light-arabica-11

results in an error. i don't know how this is related, though tbh 😅

i can also use this successfully and see no error from using write instead of admin

export CELESTIA_NODE_AUTH_TOKEN=$(celestia light auth write --p2p.network arabica)
celestia state account-address --token $CELESTIA_NODE_AUTH_TOKEN
{
  "result": "celestia1lvns26q9d43a5fcl3xjmfy3auk6fekf2x5pp93"
}

@renaynay
Copy link
Member

@jcstein Is the issue resolved here? If so, feel free to close the issue

@jcstein
Copy link
Member Author

jcstein commented Jun 20, 2024

yep let's close this

@jcstein jcstein closed this as completed Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external Issues created by non node team members
Projects
None yet
Development

No branches or pull requests

5 participants