Signbank / Global-signbank

An online sign dictionary and sign database management system for research purposes. Developed originally by Steve Cassidy/ This repo is a fork for the Dutch version, previously called 'NGT-Signbank'.
http://signbank.cls.ru.nl
BSD 3-Clause "New" or "Revised" License
19 stars 12 forks source link

Error uploading recorded video #1022

Closed ocrasborn closed 4 months ago

ocrasborn commented 1 year ago

I'm playing around with the senses/translations, finding that Safari & DuckDuckGo on Mac won't upload a video at all (nothing knew), but now Chrome on Mac also gives an error:

TransactionManagementError at /video/upload/ An error occurred in the current transaction. You can't execute queries until the end of the 'atomic' block.

susanodd commented 1 year ago

We might need to debug this on the iMac on @vanlummelhuizen 's desk.

My mac computers are running MacOS 10.15.7 (very old but all the implementation stuff works fine) All the native video software is quite old so I can't test videos.

On my giant iPad, Signbank almost works well. Although the video previews don't move on the Gloss Search page. I tried Signbank there because my iPad runs the most recent Apple software. Probably after #988 it will all improve.

susanodd commented 1 year ago

This may be related to #1014.

susanodd commented 1 year ago

UPDATE: This has been modified.

It's probably related to this:

https://github.com/Signbank/Global-signbank/blob/9c15fbc28218d4420826adfbd05b38185cafc3b5/signbank/video/views.py#L32-L35

I think this is going to cause problems with control flow since if the object isn't found it generates a 404 not found and breaks the code, basically. Checking the object existence should be done before the form is processed (actually somehow from the template to this code.)

susanodd commented 1 year ago

Here are some uploaded videos in sensevideo

-rwxrwx--- 1 ubuntu www-data     444914 Jul 28 10:18 1.mp4
-rw-r--r-- 1 ubuntu www-data      34643 Jul 28 10:18 1_small.mp4
-rwxrwx--- 1 ubuntu www-data    2106909 Aug  1 16:12 2.mp4
-rw-r--r-- 1 ubuntu www-data    2106909 Aug  1 16:12 2_DJ72n6X.mp4
-rw-r--r-- 1 ubuntu www-data     344397 Aug  1 16:12 2_small.mp4
-rwxrwx--- 1 ubuntu wwwsignbank  444914 Aug  3 12:42 4.mp4
-rwxrwx--- 1 ubuntu wwwsignbank  444914 Aug  3 12:41 4.mp4.bak3
-rw-r--r-- 1 ubuntu www-data      34643 Aug  3 12:42 4_small.mp4
Woseseltops commented 1 year ago

Summary of discussion with @susanodd and @Jetske :

susanodd commented 1 year ago

@ocrasborn can you try this again? @Jetske and @susanodd made some repairs to the code.

susanodd commented 1 year ago

@Woseseltops:

  • We don't know what the problem exactly, but @susanodd is thinking about database problems we're Django is trying to access something that has already been deleted

I'm thinking that the video hasn't been completely uploaded prior to the "create a sentence video object and put it into the database" has finished.

And perhaps the transaction doesn't extend to the scope of uploading a large file as part of the transaction.

susanodd commented 1 year ago

@Jetske this is wrong:

https://github.com/Signbank/Global-signbank/blob/0448bdd42bafe97453ee90c9f4a0a72c5ea91be4/signbank/dictionary/templates/dictionary/gloss_detail.html#L652

In the gloss I'm debugging now, the request.path ends up set as follows:

` value="/dictionary/gloss/44048/8822?edit"

susanodd commented 1 year ago

Here's something still wrong. I put the similar senses into a context variable, but here, as you see, it has not been evaluated:

        sense_to_similar_senses = dict()
        for sense in context['senses']:
            sense_to_similar_senses[sense] = sense.get_senses_with_similar_sensetranslations_dict

        context['sense_to_similar_senses'] = sense_to_similar_senses
        print(sense_to_similar_senses)

{<Sense: over hoofd aaien, aai krijgen, hoofd strelen | >: <bound method Sense.get_senses_with_similar_sensetranslations_dict of <Sense: over hoofd aaien, aai krijgen, hoofd strelen | >>}

It's a bound method.

When I actually apply the method as

sense.get_senses_with_similar_sensetranslations_dict()

it does not complete.

Nevertheless, the detail view still does not appear in the browser. There are probably other such methods applied in the template that do not complete.

susanodd commented 1 year ago

I'm able to upload a recorded video and sentence video on mac now. This is not live yet.

susanodd commented 1 year ago

@ocrasborn is this still broken?

susanodd commented 1 year ago

@ocrasborn can this be closed? Is it working for you now?

Some of the ids in the template elements had spaces (problem for Safari) and some urls had a spurious id element at the end (the ones for where to go after uploading, so the link was not correct.) Safari / Mac is more strict on these things.

If it still does not work (e.g., if you get a broken transaction because the video is too big) please give some more details of what went wrong.

susanodd commented 1 year ago

Is this still a problem, @ocrasborn ?

susanodd commented 1 year ago

See #627

susanodd commented 9 months ago

@Jetske On Safari, it works, but in the error log (in PyCharm while running the server) it shows this message:

[Errno 2] No such file or directory: '/uprobe'

It also displays a complaint in the browser (whether to throw away the file). I just clicked dismiss.

But the error message, it's looking for something that's not there. Is a path set wrong?

Jetske commented 9 months ago

@susanodd is that live or when you run it locally?

susanodd commented 9 months ago

That's locally. Using the most recent code. I can see the logs in PyCharm so that's how I see it. I can't really test the live server. We'd need to use the Mac on @vanlummelhuizen 's desk. It's kind of difficult to look through the logs on the server. I suspect it's on Apple/Safari. It uploads okay, but during upload, there is a modal (from Safari) about the video software not having permission. (I can't make a screenshot of splash things.)

Is the folder uprobe part of the CNGT scripts? It doesn't appear anywhere in the code. It must be used in one of the packages. I vaguely recall something to do with getting the splash image.

Jetske commented 9 months ago

That doesn't ring a bell. I do also get errors locally (a package problem) but then it uploads nonetheless. So yes, it might be part of CNGT scripts.

susanodd commented 9 months ago

I found uprobe referenced in some github repositories. Yeah, I'd guess it's used in the CNGT scripts for videos.

susanodd commented 6 months ago

Is this still a problem?