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

Unable to stream OperationResponse event #2556

Closed
nagarwa2 opened this issue May 6, 2020 · 14 comments
Closed

Unable to stream OperationResponse event #2556

nagarwa2 opened this issue May 6, 2020 · 14 comments

Comments

@nagarwa2
Copy link

nagarwa2 commented May 6, 2020

What version are you using?

"horizon_version": "v1.2.0"
"core_version": "v13.0.0"

What did you do?

Upgraded and restarted the horizon server.

What did you expect to see?

Able to stream payments for an account.

What did you see instead?

Whenever I am trying to connect to payment stream listener for stellar network, I am getting below response from server
Optional.of(404)

Using below java code to connect
paymentsRequestBuilder.forAccount(account.getAccountId()).stream(operationsEventListener);

This was working before. Can anybody please let me know what I am doing wrong ?

@bartekn bartekn transferred this issue from lightsail-network/java-stellar-sdk May 6, 2020
@bartekn
Copy link
Contributor

bartekn commented May 6, 2020

What's the result of account.getAccountId()? Maybe it doesn't exist?

@rice2000
Copy link
Contributor

rice2000 commented May 6, 2020

Is this on the testnet? If so, it could be that the testnet reset last week and erased that account.

@nagarwa2
Copy link
Author

nagarwa2 commented May 6, 2020

It is on prod. This is the account Id, I am trying to stream payments - GD5G2MBZTRGPQFSBPRFPSA7SF4C6KX6M5HNTM4NSXNNWN65UDWALUGJM

@nagarwa2
Copy link
Author

nagarwa2 commented May 6, 2020

I am able to start stream for Ledger events and even seeing latest blocks in logs But when I am trying to start payment stream for a account on prod getting 404 error don't know what change ?

@nagarwa2
Copy link
Author

nagarwa2 commented May 6, 2020

I have created an horizon server using below - https://github.com/stellar/docker-stellar-core-horizon/blob/master/README.md. It was working before I restarted the horizon server. When I hit my server url I see that it's in sync

@bartekn
Copy link
Contributor

bartekn commented May 6, 2020

Can you run:

curl -H "Accept: text/event-stream" "{your horizon}/accounts/GD5G2MBZTRGPQFSBPRFPSA7SF4C6KX6M5HNTM4NSXNNWN65UDWALUGJM/payments"

Does it stream events one by one or all payments all at once?

@nagarwa2
Copy link
Author

nagarwa2 commented May 6, 2020

Got the below error
{
"type": "https://stellar.org/horizon-errors/not_found",
"title": "Resource Missing",
"status": 404,
"detail": "The resource at the url requested was not found. This usually occurs for one of two reasons: The url requested is not valid, or no data in our database could be found with the parameters provided."
}

Horizon server node status:
"horizon_version": "v1.2.0",
"core_version": "v13.0.0",
"ingest_latest_ledger": 29523651,
"history_latest_ledger": 29523651,
"history_elder_ledger": 29518272,
"core_latest_ledger": 29523651,
"network_passphrase": "Public Global Stellar Network ; September 2015",
"current_protocol_version": 12,
"core_supported_protocol_version": 13

@bartekn
Copy link
Contributor

bartekn commented May 6, 2020

Any chance you can share your Horizon server URL? Can be privately (send an email to bartek at stellar org).

@nagarwa2
Copy link
Author

nagarwa2 commented May 6, 2020

Sent. Can you please check

@bartekn
Copy link
Contributor

bartekn commented May 6, 2020

OK, I know what's going on. There were no payments from/to this account in the ingested ledger range [29518272, now]. Seems like a duplicate of #736 and can be pretty confusing.

@nagarwa2 thanks for this report!

@stellar/horizon-committers what do you think about it?

@nagarwa2
Copy link
Author

nagarwa2 commented May 6, 2020

When I try to hit the below url to stellar prod server - curl -H "Accept: text/event-stream" "https://horizon.stellar.org/accounts/GD5G2MBZTRGPQFSBPRFPSA7SF4C6KX6M5HNTM4NSXNNWN65UDWALUGJM/payments" I am getting payments

@nagarwa2
Copy link
Author

nagarwa2 commented May 6, 2020

Do you know how can i start the horizon server using docker by giving custom history_elder_ledger value ?

@ire-and-curses
Copy link
Contributor

@bartekn it seems related but not quite a duplicate? In #736 the account doesn't exist. Here, the account exists but with no payments in the range.

I do think we should do something about these streaming semantics for the general case where there is no data to stream. Does it make sense to just maintain a connection with an empty stream? I'd be ok with that. That fixes #736 but I don't know that it makes the situation in this issue any easier to understand for a user. I'm not really sure what we could do to make this clearer.

I note that the 404 actually explicitly mentions the possibility of no data:

The url requested is not valid, or no data in our database could be found with the parameters provided.

@nagarwa2
Copy link
Author

nagarwa2 commented Nov 3, 2020

This was resolved with the recommendation.

@nagarwa2 nagarwa2 closed this as completed Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants