whoami
whoami2y ago

Internal error for getting blob from storageId in node runtime

I was trying langchain/document_loaders with javascript runtime, that didn't work out so I turned myself to the node runtime, this time I got
Transient error during storage get url: {"code":"InternalServerError","message":"Your request couldn't be completed. Try again later."}
at async get [as get] (../node_modules/.pnpm/convex@0.14.1_biqbaboplfbrettd7655fr4n2y/node_modules/convex/src/server/impl/storage_impl.ts:68:8)
at async handler (../convex/action.ts:16:16)
at async invokeAction (../node_modules/.pnpm/convex@0.14.1_biqbaboplfbrettd7655fr4n2y/node_modules/convex/src/server/impl/registration_impl.ts:249:14)
Transient error during storage get url: {"code":"InternalServerError","message":"Your request couldn't be completed. Try again later."}
at async get [as get] (../node_modules/.pnpm/convex@0.14.1_biqbaboplfbrettd7655fr4n2y/node_modules/convex/src/server/impl/storage_impl.ts:68:8)
at async handler (../convex/action.ts:16:16)
at async invokeAction (../node_modules/.pnpm/convex@0.14.1_biqbaboplfbrettd7655fr4n2y/node_modules/convex/src/server/impl/registration_impl.ts:249:14)
"use node"

import { v } from "convex/values"
import { PDFLoader } from "langchain/document_loaders"

import { action } from "./_generated/server"

export const save = action({
args: {
storageId: v.string(),
},
handler: async ({ runMutation, storage }, { storageId }) => {
console.log("storageId", storageId)

// I think this is where things go wrong
const blob = await storage.get(storageId)
...
},
})
"use node"

import { v } from "convex/values"
import { PDFLoader } from "langchain/document_loaders"

import { action } from "./_generated/server"

export const save = action({
args: {
storageId: v.string(),
},
handler: async ({ runMutation, storage }, { storageId }) => {
console.log("storageId", storageId)

// I think this is where things go wrong
const blob = await storage.get(storageId)
...
},
})
2 Replies
sshader
sshader2y ago
Hmm this is supposed to be supported. What does your storage ID look like? One of mine looks something like this: c91920b2-cfcb-4ecf-a638-1c7a91fd9a95
ian
ian2y ago
Also, how big is this object you're fetching?

Did you find this page helpful?