My upload button receives the presignedUrls from the server but when fetching the url it hangs.
Its odd because the image goes to upload thing and i can see it in my dashboard but the request on my client never recieves a response.
Here is my upload button component:
20 Replies
This seems like a UploadThing backend issue?
failed in 25.6minutes
usually it's because you have some middleware blocking requests to your server. can you enable debug logs and try again
I kept trying to fix it until i gave up striped out my current implementation and redid and it worked I dont know exactly what went wrong but I believe it was the middleware
Hi, were you able to fix this? I am getting this issue now on a live server. Local dev works but not in production server. It worked before in v6.
//not getting here also
onClientUploadComplete={(res) => {
console.log("UPLOAD DONE! ", res);
Hi @julius can you clarify this? I didn't have this problem in v6. Aside from upgrading to v7, the only other change is moving the Nextjs app out of Azure container as it's too slow to an Azure Ubuntu VM. What could possibly block it?
The file is actually uploaded to UploadThing.
global middleware, some reverse proxy maybe. the callback should be treated like a webhook. it doesn't come from an authenticated user (unlike the request that hits the
.middleware()
function) so you cannot put /api/uploadthing behind authOk thanks, I'll check again.
Hi @julius please bear with this. I still can't find any solution. I noticed in the browser for the live website it displays a "pending" on xhr. Is that the one being "blocked?"
In my local dev, the xhr points to uploadthing client index.js.
Yes it’s blocking until your server has acknowledged the upload complete (I.e your server’s onUploadComplete has finished) - can you see any network request (POST /api/uploadthing) coming into your prod server? In total there should be 2, one from the client when they request the upload and you generate the signed url, and then one from the uploadthing server after the upload has finished that will trigger onUploadComoletr callback
I have this post /api/uploadthing?actionType=upload&slug=docAnalyzeFileUpload ... also the presigned
https://sea1.ingest.uploadthing.com/xEVowJainSDGSKXuCJI8R7KOIQwAMjmzxcP9no5ET2LUVFpg?expires=1731497365430&x-ut-identifier=xmurrfld3n&x-ut-file-name=user_2lL1jFWlzieExut2Gep6KQySdA7-350KB.pdf&x-ut-file-size=359075&x-ut-file-type=application%252Fpdf&x-ut-slug=docAnalyzeFileUpload&x-ut-content-disposition=inline&signature=hmac-sha256%3D9db1ea5f92fa933cc330bb1fcb969bdc8a5570dba23fba45b2bb2c277b6c2ce3
I don't have the onUploadComplete. It doesn't get to that. I put a log on so and it's not registering in the browser.
.onUploadComplete(async ({ metadata }) => {
log.debug("Upload Complete Metadata: ", metadata); console.log("Upload Complete Metadata: ", metadata); return { uploadedBy: metadata.userId };
log.debug("Upload Complete Metadata: ", metadata); console.log("Upload Complete Metadata: ", metadata); return { uploadedBy: metadata.userId };
I local dev, I can see that
I meant that's the log in the dropzone on uploade complete. The other log is in the core.ts:
@julius so I don't see coming into the server.
Yea I was thinking if you could see it entering your network at all, and that way could tell if it was blocked somewhere on the way to the uploadthing handler (eg by a reverse proxy or somthing)
Next thing you can do is enable debug logs and inspecting the request body of the request going to
REGION.ingest.uploadthing.com/route-metadata
- see what callbackUrl it’s sending and verifying that that url is matching your server. Sometimes the auto-detection isn’t 100% accurate if the right headers aren’t presentOk I will do that. Hopefully I can find a solution soon.
Sorry that I can’t be more helpful. Not at home so can’t check our logs
It's fine. You've been helpful. Thanks.