Page 1 of 1 :: Viewing 1-13 of 13
Interrupted upload blocking submission? - Started by: Thorvald
Interrupted upload blocking submission?
Posted: 05 Dec 2022, 08:37 PM

Corollary to the thread on reuploads, I think I just stumbled into an edge case where an interrupted submission is locking out further uploads:

The other day I had prepared an image for submission, only to suspend the final upload to preserve the original gallery order, and some time later I navigated away from the page by mistake. Trying to submit the image now, the file successfully uploads (100% with green outline), but attempting to post prompts a popup error "Your uploaded file seems to be missing. Please try uploading it again."

My best guess is, the file itself is on the server, but because the initial submission wasn't completed, it's orphaned in the database and is preventing uploads with the same filename. tl;dr if you have to abort a submission, cancel the upload first.

For reference, original file is named Catch That Obergruppenführer.gif,

RE: Interrupted upload blocking submission?
Posted: 06 Dec 2022, 12:21 AM

Yikes! Yeah, that needs to be looked into. In the meantime, I'll delete the file and see if that helps.
-- BK

RE: Interrupted upload blocking submission?
Posted: 06 Dec 2022, 09:17 PM

No luck, still getting a 'missing file' error.

RE: Interrupted upload blocking submission?
Posted: 07 Dec 2022, 02:39 AM
This post has been edited 1 time. Last edit on 07 Dec 2022, 01:42 PM.

And this is happening with any kind of file upload, or just image uploads?
-- BK

RE: Interrupted upload blocking submission?
Posted: 07 Dec 2022, 01:51 PM

Can you email me a copy of the file you're trying to upload at badkarma at side7 dot com? I'm having trouble replicating the issue, and want to see if I can do it with your file.
-- BK

RE: Interrupted upload blocking submission?
Posted: 07 Dec 2022, 09:21 PM
This post has been edited 1 time. Last edit on 07 Dec 2022, 09:22 PM.

OK, nevermind on emailing me the file. I just renamed a file to match the name of what you were trying to upload, and boom, I was able to recreate the problem you're having. I now know the why of what's going on. I'm working on the how to fix it part.

Essentially, the problem is the unicode character in the filename.

To be honest, and I should have thought about this, because English is my primary language I don't use or come across filenames with unicode characters in them. It never crossed my mind, nor the minds of any of my beta testers, to check that case. This is fixable, but it'll require some work on multiple portions of the code and database.
-- BK

RE: Interrupted upload blocking submission?
Posted: 07 Dec 2022, 09:57 PM

No worries; blundering into the most absurd contingencies seems to be my specialty. :P

RE: Interrupted upload blocking submission?
Posted: 07 Dec 2022, 11:09 PM

LOL Not absurd. Just poking holes where the light needs to shine on my code. :D
-- BK

RE: Interrupted upload blocking submission?
Posted: 08 Dec 2022, 11:46 PM

TLDR: This problem is fixed and will be deployed in the next update.

So, after much extra digging, it turns out the problem was not my code afterall. It was an issue presented from some 3rd party code during the upload process where the upload would go fine, but the reported filename of the uploaded file would have the unicode characters mangled. I wrestled with several different solutions, including potentially replacing that 3rd party code. Unfortunately, most of the other libraries that did similar things were either grossly out of date, or did not provide the same level of functionality. Finally, I settled on a solution that solves the problem, but presents another challenge. The solution was to rename all uploaded files when they are uploaded. This works, and uses a SHA1 hash to create the new filename to maintain uniqueness of filenames.

The problem presented is that it is now impossible to simply upload an updated file named the same as a pre-existing file in order to replace it. I have ideas on how to "easily" solve that issue. I say "easily", but that's from a user's perspective. It will require some significant additional codework to add this new functionality. But, it's also a feature that is rarely used on the site now, so I'm not too terribly worried about it at the moment.

So, filename containing unicode characters problem fixed, but easy file replacement removed. But, this also removes the possibility of accidentally overwriting a previously uploaded file.
-- BK

RE: Interrupted upload blocking submission?
Posted: 09 Dec 2022, 05:06 PM

Programming's a real Jenga tower, innit? :B

Would the new system allow changing file types in replacements? I haven't crunched the numbers but there's a non-zero probability I'll hit the 1-GB ceiling before completing a full rehost, and one way of freeing up space would be swapping PNGs with JPEGs after the fact.

RE: Interrupted upload blocking submission?
Posted: 10 Dec 2022, 01:48 AM

Big projects certainly are, yeah.

Yes, the goal with the new file replacement system is to be able to completely replace the file in a submission with a completely new one. So, yes, you could exchange .PNGs for .JPGs.
-- BK

RE: Interrupted upload blocking submission?
Posted: 10 Dec 2022, 03:44 PM

P.S.: Success!

RE: Interrupted upload blocking submission?
Posted: 10 Dec 2022, 03:53 PM

\o/

Page 1 of 1 :: Viewing 1-13 of 13