ampp
ampp7mo ago

Uncaught Error: System tables can only be accessed from db.system.normalizeId(). with Ent

I have listScheduledFunctions with table _scheduled_functions that works great, but getScheduledMessage gives that error.
export const listScheduledFunctions = query({
args: {
paginationOpts: paginationOptsValidator,
},
handler: async (ctx, args) =>
{
await hasAdminRole(ctx);

return await ctx.table.system("_scheduled_functions").order("desc").paginate(args.paginationOpts);
},
});

export const getScheduledMessage = query({
args: {
id: v.id("_scheduled_functions"),
},
handler: async (ctx, args) => {
return await ctx.table.system("_scheduled_functions").get(args.id);
},
});
export const listScheduledFunctions = query({
args: {
paginationOpts: paginationOptsValidator,
},
handler: async (ctx, args) =>
{
await hasAdminRole(ctx);

return await ctx.table.system("_scheduled_functions").order("desc").paginate(args.paginationOpts);
},
});

export const getScheduledMessage = query({
args: {
id: v.id("_scheduled_functions"),
},
handler: async (ctx, args) => {
return await ctx.table.system("_scheduled_functions").get(args.id);
},
});
I tried to change .get to .normalizeId but no luck with that. The same error. Any ideas. I did check to maek sure my query is being called from functions.ts etc..
2 Replies
Michal Srb
Michal Srb7mo ago
Hey @ampp thanks for the bug report please upgrade to latest version of convex-ents for the fix.
ampp
amppOP7mo ago
Awesome, thanks for the prompt fix!