zid
zid12mo ago

✖ Error: Unable to build indexes and run schema validation on...

While running convex npx convex dev, I'm starting to get the following error on a seemingly frequent basis.
AxiosError: maxContentLength size of -1 exceeded
Failed due to network error, retrying in 262.72ms...
✖ Error: Unable to build indexes and run schema validation on [instance url]
AxiosError: maxContentLength size of -1 exceeded
Failed due to network error, retrying in 262.72ms...
✖ Error: Unable to build indexes and run schema validation on [instance url]
I see that it logs a network error, but does it have anything to do with how ive setup my schema? This is purely from speculation, but I'm wondering if it's because I have some long-winded indexes (char length). Not sure what the limitations are around naming indexes (aside from accept only letters, numbers, and underscores).
4 Replies
ian
ian12mo ago
Does your schema import very large packages? I wonder if it's trying to upload too large of a bundle for schema validation
zid
zidOP12mo ago
import packages? Not sure if we're talking about the same thing but my guess is that in my schema.ts file, i may have too many nested and chained indexes. Here's an example of the indexes for a table
.index("by_districtsId", ["districtsId"])
.index("by_districtsId_status", ["districtsId","status"])
.index("by_points", ["points"])
.index("by_districtsId_points", ["districtsId", "points"])
.index("by_districtsId_laughs", ["districtsId", "laughs"])
.index("by_districtsId_hearts", ["districtsId", "hearts"])
.index("by_districtsId_likes", ["districtsId", "likes"])
.index("by_districtsId_dislikes", ["districtsId", "dislikes"])
.index("by_districtsId_postDate_points", ["districtsId", "postDate", "points"])
.index("by_districtsId_postDate_laughs", ["districtsId", "postDate", "laughs"])
.index("by_districtsId_postDate_hearts", ["districtsId", "postDate", "hearts"])
.index("by_districtsId_postDate_likes", ["districtsId", "postDate", "likes"])
.index("by_districtsId_postDate_dislikes", ["districtsId", "postDate", "dislikes"])
.index("by_districtsId_userElementalAvatarId_status", ["districtsId", "userElementalAvatarId", "status"])
.index("by_userElementalAvatarId", ["userElementalAvatarId"]),
.index("by_districtsId", ["districtsId"])
.index("by_districtsId_status", ["districtsId","status"])
.index("by_points", ["points"])
.index("by_districtsId_points", ["districtsId", "points"])
.index("by_districtsId_laughs", ["districtsId", "laughs"])
.index("by_districtsId_hearts", ["districtsId", "hearts"])
.index("by_districtsId_likes", ["districtsId", "likes"])
.index("by_districtsId_dislikes", ["districtsId", "dislikes"])
.index("by_districtsId_postDate_points", ["districtsId", "postDate", "points"])
.index("by_districtsId_postDate_laughs", ["districtsId", "postDate", "laughs"])
.index("by_districtsId_postDate_hearts", ["districtsId", "postDate", "hearts"])
.index("by_districtsId_postDate_likes", ["districtsId", "postDate", "likes"])
.index("by_districtsId_postDate_dislikes", ["districtsId", "postDate", "dislikes"])
.index("by_districtsId_userElementalAvatarId_status", ["districtsId", "userElementalAvatarId", "status"])
.index("by_userElementalAvatarId", ["userElementalAvatarId"]),
i have about 1400 lines in my schema.ts file by lines, i mean everything, not just the index definitions the only imports in the file are
import { defineSchema, defineTable } from "convex/server";
import { v } from "convex/values";
import { defineSchema, defineTable } from "convex/server";
import { v } from "convex/values";
lee
lee12mo ago
That error isn't something we've seen before. How many indexes do you have? That may help repro. And if you share the instance url (generally not sensitive but you can DM if you want) that could help us look into it
zid
zidOP12mo ago
interesting, i will dm you

Did you find this page helpful?