Skip to content

Fix: private league fetch failure crashes the trader. (TradeQuery.lua:157: table index is nil) (Cloudflare)#9912

Closed
apYdr6uxv wants to merge 2 commits into
PathOfBuildingCommunity:devfrom
apYdr6uxv:fix/trade-league-fallback
Closed

Fix: private league fetch failure crashes the trader. (TradeQuery.lua:157: table index is nil) (Cloudflare)#9912
apYdr6uxv wants to merge 2 commits into
PathOfBuildingCommunity:devfrom
apYdr6uxv:fix/trade-league-fallback

Conversation

@apYdr6uxv

@apYdr6uxv apYdr6uxv commented Jun 27, 2026

Copy link
Copy Markdown

Fixes #9176 .

Description of the problem being solved:

When retrieving leagues, if the private leagues fetch fails, it takes down the trader, even if the public leagues retrieve worked.
This fix proposes that it should instead continue , with just the public leagues it could retrieve.

Error:

In download callback: Classes/TradeQuery.lua:157: table index is nil
stack traceback:
	Classes/TradeQuery.lua:157: in function 'callback'
	Classes/TradeQuery.lua:85: in function 'callback'
	Launch.lua:319: in function <Launch.lua:318>
	[C]: in function 'PCall'
	Launch.lua:230: in function <Launch.lua:222>
v2.65.0 master
Press Enter/Escape to dismiss, or F5 to restart the application.
Press CTRL + C to copy error text.

Cause

The public leagues fetch is done using the API, and bypasses this issue entirely.
The private leagues fetch is done using HTTP callout (because there is no API for this), and runs into Cloudflare, if unlucky.

The private leagues fetch may hit Cloudflare challenge pages.
This is not an expected response, hence the crash. (The contents will be "Enable Javascript and cookies to continue")

This may not always happen, depending on how Cloudflare feels about you. (i.e. flaky repro)
Using a VPN might make it easier to reproduce.

The first sign of trouble is your trader window has no leagues populated.
The actual crash is produced on Get Currencies Conversion Rates or so.

Other changes

  • flow changes: some guard against "missing leagues" state

Steps taken to verify a working solution:

  • "works here"™
  • ran docker tests

Link to a build that showcases this PR:

n/a

Before screenshot:

n/a

After screenshot:

n/a

@vaisest

vaisest commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Superceded by #9812

@vaisest vaisest closed this Jul 20, 2026
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

Successfully merging this pull request may close these issues.

Error in "Trade for these items" menu

2 participants