-
Notifications
You must be signed in to change notification settings - Fork 210
Description
Description
When running a gateway and making a text-to-image request, if no orchestrators are available in the pool for the requested AI capability, the server panics instead of returning a graceful error response.
Version
Livepeer Node version: 0.8.9
Steps to Reproduce
- Run gateway: ./livepeer --network arbitrum-one-mainnet --ethUrl --gateway -aiServiceRegistry
- Make a text-to-image request when no orchestrators are serving the model:
curl -X POST http://localhost:9935/text-to-image
-H "Content-Type: application/json"
-d '{"prompt": "a beautiful cyberpunk city at night", "width": 1024, "height": 576}'
Expected Behavior
Return an HTTP error response (e.g., 503 Service Unavailable) with a message indicating no orchestrators are available for the requested capability.
Actual Behavior
Server panics with nil pointer dereference:
refreshing sessions, no orchestrators in pools
http: panic serving 127.0.0.1:40640: runtime error: invalid memory address or nil pointer dereference
goroutine 2199 [running]:
...
github.com/livepeer/go-livepeer/server.processAIRequest(...)
/__w/go-livepeer/go-livepeer/server/ai_process.go:1567 +0x1fb0
Suggested Fix
Add a nil check after session refresh in ai_process.go around line 1567, returning an appropriate error when no orchestrators are available.