Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in example sentence upload #1326

Open
Jetske opened this issue Sep 17, 2024 · 6 comments
Open

Error in example sentence upload #1326

Jetske opened this issue Sep 17, 2024 · 6 comments
Assignees

Comments

@Jetske
Copy link
Collaborator

Jetske commented Sep 17, 2024

A user reported an error:
image

It only seems to happen with one file.

@Jetske Jetske self-assigned this Sep 17, 2024
@susanodd
Copy link
Collaborator

I know this error. Sometimes a save is in the middle of other commands that need its result.
I think it's also the file system. When you see those weird characters added to the filename.
If you come up with a good solution, please share!

@Woseseltops
Copy link
Collaborator

I have also seen this error; I thought it happened at random (the browser fighting with Django or something), but it seems like you can reproduce at will with a particular file, is that correct?

@susanodd
Copy link
Collaborator

Yesterday the entire server was blocking. I think it's the atomic things that cause this. Sqlite locks the entire database.

@susanodd
Copy link
Collaborator

susanodd commented Sep 24, 2024

@Jetske can you post an example of the filenames that didn't work because of extra dots?
Or of this file?

Which routine is it in the code that does this? (Where the atomic block breaks.)

[CODING]
I had to move a save to the end of the block. It happened once because of nested saves. It's kind of a problem because some objects need to be created and used by other objects.
You could also try creating the object using the e.g., newgloss = Gloss(...) instead of Gloss.objects.get_or_create(...)
The constructor does not put the object in a table yet, until you do save on it (at the end).
It seems it can be used in other code that also uses constructors that isn't saved yet. Then save them inside out nesting.

The lemmas sometimes cause problems because those need to be created before a gloss is created.
The video saving gets the first two characters from the lemma for the folder.
I needed to duplicate the code that retrieves the two characters so it is in the same python file.
(The code was causing problems when it was in a different file and retrieved. That was in the video model/app/folder)
(I think because all the models are importing from other models. The imports in dictionary/models.py are inline imports rather than at the top of the file to avoid recursion. I say this because the atomic blocks, I don't think they can cross python files. Esp. if it's trying to create folders or files. If you put a try-except, that might help, in order to force it to retrieve a result - the exception - so it completes the code in the try. We probably need quite a lot of except feedback in order to fix mysterious errors about files.)

@susanodd
Copy link
Collaborator

susanodd commented Sep 24, 2024

@Jetske I'm having a different error.

The id videoplayer is duplicate in Gloss Detail.
The sentence video has the same id as the gloss video and it can't run the javascript to load the video.

    function reloadVideo() {
        var video_player = document.getElementById("videoplayer");
        video_player_src = video_player.src;
        video_player_src = "";
        video_player.src = video_player_src;
        video_player.type = "video/mp4";
        video_player.load();
    }

I'm not able to upload a new video for a gloss because it has a bug with this and the javascript isn't completing.

@Jetske
Copy link
Collaborator Author

Jetske commented Sep 26, 2024

@Woseseltops No I have the file that gave this error, but can't reproduce it myself.
@susanodd in the end I don't think the dot in the filename caused it (although better avoid it I guess). And yeah if there are duplicate id's that could be a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants