question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

async offers stream return 406 error

See original GitHub issue

As I read in the documentation, everything seems to be supported: https://stellar-sdk.readthedocs.io/en/stable/api.html?highlight=server.offers().for_seller().cursor#id9 There is almost no search for information on 406 errors in the SDK. Thanks in advance for replies and advice.

ps: tried both on the local horizon server and on the main code:

HORIZON_URL = "https://horizon.stellar.org"
async def offers(acc1):
    async with ServerAsync(HORIZON_URL, AiohttpClient()) as server:
        async for offers in server.offers().for_seller(acc1).cursor(cursor=last_cursor).stream():
            ofr2df(offers) ##  acc_offers
#            print(f"\nacc: {acc}\n offers len: {len(offers)}")

error:

ConnectionError: fetch https://horizon.stellar.org/offers failed: 406

the function is called like this:

async def listen():
    global acc
    await asyncio.gather( 
    await asyncio.get_running_loop().run_in_executor(None, offers, acc[1])
    )
if __name__ == "__main__":
    asyncio.run(listen())

pps: sdk update 8.0 beta

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
minherccommented, Apr 20, 2022

Thank you very much for the quick response. Is this a bug in horizon server?

Is there another option to get a list of account offers stream?

UPDATE: who needs a working tool, here it is:

async def offers_fr_oper(acc1):
    async with ServerAsync(HORIZON_URL1, AiohttpClient()) as server:
        async for offers in server.operations().for_account(acc1).cursor(cursor=last_cursor).stream():
            ofr2df(offers) ##  all operations
#            print(f"\All operations kol: {len(offers)}")

as a result there will be a lot of unnecessary, you need to filter (for example: “type”==“manage_sell_offer”)

0reactions
overcatcommented, Apr 23, 2022

It is inherited from the parent class. In fact, it does not support stream. I will improve it in the coming release, sorry for causing you trouble.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does my Twitter stream give me the HTTP Error: 406?
A 406 Not Acceptable HTTP Error means: At least one request parameter is invalid. For example, the filter endpoint returns this status if:....
Read more >
How to Fix a 406 Error and Find the Source of the Problem
The primary way to address and fix a 406 error is by checking the source code for issues in the Accept-, Request-, and...
Read more >
Request failed with status code 406 · Issue #43 - GitHub
Error 406 means the http code that create persistent subscription on $ce-user has an issue. Stream does exists ?
Read more >
406 Not Acceptable: What It Is and How to Fix It - Airbrake Blog
The 406 Not Acceptable is an HTTP response status code indicating that the client has requested a response using Accept- headers that the ......
Read more >
17. Web MVC framework - Spring
Type mismatches as application-level validation errors that keep the offending value, ... The Spring DispatcherServlet also supports the return of the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found