Openshot-qt: Help! Christmas Vid "'NoneType object is not subscriptable" error

Created on 24 Dec 2017  ·  30Comments  ·  Source: OpenShot/openshot-qt

System Details:
Windows 10
OpenShot 2.4.1
When opening a project I get the "noneType object is not subscriptable" error. I tried uninstalling/installing. Also tried creating a new project and receive same error. Help!\

openshot-qt.log

bug

Most helpful comment

Same problem here on Linux, using the AppImage of Openshot 2.4.2.

I "fixed" it by editing the .osp file with a text editor (vim) and removing all entries with null values (there were 3 of them). I still have the broken file if it is needed.

All 30 comments

@DylanC - This one even has a log file attached.

@peanutbutterandcrackers

Lots of errors here but hard to know what is the cause. Must all be related to the same issue. Seems to be a 2D array doesn't have objects but an int instead or some other value.

Eg: Normally it should be this:
[0][i] = {"object":"obVal"}
but it seems be to something like this:
[0][i] = 1

Error 1
project_data:ERROR Error while converting relative paths to absolute paths: 'NoneType' object is not subscriptable
main_window:ERROR Couldn't open project C:/Users/I823147/SapWorkDir/Personal/2017 Vid/XMAS 2017.osp

Error 2
project_data:ERROR Error while moving temp files into project folder: 'NoneType' object is not subscriptable
project_data:ERROR Error while converting absolute paths to relative paths: 'NoneType' object is not subscriptable
project_data:ERROR Error while converting relative paths to absolute paths: 'NoneType' object is not subscriptable

Error 3
Traceback (most recent call last):
File "C:\Program Files\OpenShot Video Editor\windows\views\timeline_webview.py", line 2522, in dragEnterEvent
self.addClip(data, pos)
File "C:\Program Files\OpenShot Video Editor\windows\views\timeline_webview.py", line 2612, in addClip
self.update_clip_data(new_clip, only_basic_props=False)
File "C:\Program Files\OpenShot Video Editor\windows\views\timeline_webview.py", line 214, in update_clip_data
existing_clip = Clip.get(id=clip_data["id"])
File "C:\Program Files\OpenShot Video Editor\classes\query.py", line 162, in get
return QueryObject.get(Clip, *kwargs)
File "C:\Program Files\OpenShot Video Editor\classes\query.py", line 135, in get
matching_objects = QueryObject.filter(OBJECT_TYPE, *
kwargs)
File "C:\Program Files\OpenShot Video Editor\classes\query.py", line 110, in filter
if key in child and not child[key] == value:
TypeError: argument of type 'NoneType' is not iterable

@DylanC - Pretty sure that if you only spend an afternoon on this bug, you'll squash it easily.
_Morpheus voice_ I beleive in you, Dylaneo 👆👍

@peanutbutterandcrackers - I don't know how to produce this one. It just doesn't show that pop up error for me.

@rspruitt - Could you please also attach the log, good sir? Or, give any other ideas as to how we can reproduce this error? o.O

Yikes! I didn't see that. lol
sorry

I don't think I can deduce much from the log (I have yet to reach that level of proficiency with my debugging/inferencing skills...) but I think @N3WWN could give us some insight regarding this...

Ran into the same issue. I entered a typo when entering a number in the scale field when trying to trying to fine-tune transform, and now I get "noneType object is not subscriptable" error when opening the project.

How do I recover my work? Is this due to malformed project file or software installation?

Attached project file and log below

Proposal-JeanCut.zip
openshot-qt.log

@jturn08 - Which OpenShot version were/are you using, good sir? I am using OpenShot v2.4.1 on a Linux machine, and just tried to enter bad values in the likes of scale field but OpenShot wouldn't allow me to make such typos. It changed the invalid value into 0. Perhaps use the latest version of OpenShot to open that file? Hopefully, that'll help...

@jturn08 - I'll mark as a bug since it affects multiple people. Still I will try to reproduce this to confirm how to reproduce.

@jturn08 - What did you enter as a typo? I tried so many different things into scale and it turns into 0.00. I'm not able to get this error so far. Also on Win10 and v2.4.1

I don't have the .osp file from @rspruitt , but I do have the one from @jturn08 .

I'm not sure if the following items are normal or not, but they are the only things that jump out at me as possibly being odd. I did not have any of these null values in any of the 114 .osp files presently on my system. The only null values I see is in my undo history.

Proposal-JeanCut.osp contains:

  • "3": null, on line 4 (between the height and duration parameters)
  • "history": null, on line 58
  • 3x null, on lines 7738, 7739 and 7740 (at the end of the clips section)

FYI, I ran the .osp file through json_reformat in order to "beautify" it and cat -n to add line numbers : cat Proposal-JeanCut.osp | json_reformat | cat -n | less

I didn't see anything else that appeared to have values which, just based on the contents of the .osp file, were likely to cause issues.

There's another possibility that I can think of, too: perhaps the openshot.settings file was corrupted somehow? Try renaming the C:\Users\<YourUser>\.openshot_qt\openshot.settings file to something else (for instance, add .bak) and see if OpenShot will launch at that point.

I just grabbed the openshot.log from @rspruitt 's original post and saw complaints about the lines with nulls:

  • timeline:INFO Error applying JSON to timeline object in libopenshot: JSON is invalid (missing keys or invalid data types). [{"type": "insert", "value": null, "partial": false, "old_values": null, "key": ["clips"]}] on line 939

  • timeline_webview:ERROR TimelineWebView::eval_js() called before document ready event. Script queued: $('body').scope().LoadJson({"type": "load", "value": {"channels": 2, "clips": [], "duration": 300, "width": 1280, "height": 720, "progress": [], "layers": [{"lock": false, "label": "", "y": 0, "number": 0, "id": "L0"}, {"lock": false, "label": "", "y": 0, "number": 1, "id": "L1"}, {"lock": false, "label": "", "y": 0, "number": 2, "id": "L2"}, {"lock": false, "label": "", "y": 0, "number": 3, "id": "L3"}, {"lock": false, "label": "", "y": 0, "number": 4, "id": "L4"}], "settings": {}, "profile": "HDV 720 24p", "effects": [], "scale": 16, "export_path": "", "sample_rate": 44100, "history": {"undo": [], "redo": []}, "version": {"openshot-qt": "0.0.0", "libopenshot": "0.0.0"}, "files": [], "markers": [], "fps": {"den": 1, "num": 24}, "playhead_position": 0, "channel_layout": 3, "tick_pixels": 100, "id": "T0"}, "key": "", "old_values": null, "partial": false}); on line 1358 (not only nulls, but lots of empty values)

  • timeline_webview:ERROR TimelineWebView::eval_js() called before document ready event. Script queued: $('body').scope().LoadJson({"type": "load", "value": {"playhead_position": 0, "tick_pixels": 100, "progress": [], "height": 720, "clips": [], "channels": 2, "scale": 16, "history": {"redo": [], "undo": []}, "profile": "HDV 720 24p", "id": "T0", "layers": [{"label": "", "y": 0, "number": 0, "id": "L0", "lock": false}, {"label": "", "y": 0, "number": 1, "id": "L1", "lock": false}, {"label": "", "y": 0, "number": 2, "id": "L2", "lock": false}, {"label": "", "y": 0, "number": 3, "id": "L3", "lock": false}, {"label": "", "y": 0, "number": 4, "id": "L4", "lock": false}], "version": {"libopenshot": "0.0.0", "openshot-qt": "0.0.0"}, "width": 1280, "export_path": "", "markers": [], "channel_layout": 3, "sample_rate": 44100, "duration": 300, "files": [], "fps": {"num": 24, "den": 1}, "effects": [], "settings": {}}, "old_values": null, "key": "", "partial": false}); on line 1684 (again, empty values)

  • timeline_webview:ERROR TimelineWebView::eval_js() called before document ready event. Script queued: $('body').scope().LoadJson({"old_values": null, "partial": false, "key": "", "value": {"sample_rate": 44100, "tick_pixels": 100, "profile": "HDV 720 24p", "markers": [], "files": [], "playhead_position": 0, "history": {"redo": [], "undo": []}, "id": "T0", "width": 1280, "layers": [{"number": 0, "y": 0, "id": "L0", "lock": false, "label": ""}, {"number": 1, "y": 0, "id": "L1", "lock": false, "label": ""}, {"number": 2, "y": 0, "id": "L2", "lock": false, "label": ""}, {"number": 3, "y": 0, "id": "L3", "lock": false, "label": ""}, {"number": 4, "y": 0, "id": "L4", "lock": false, "label": ""}], "version": {"openshot-qt": "0.0.0", "libopenshot": "0.0.0"}, "scale": 16, "clips": [], "channel_layout": 3, "duration": 300, "channels": 2, "settings": {}, "export_path": "", "effects": [], "fps": {"den": 1, "num": 24}, "height": 720, "progress": []}, "type": "load"}); on line 2392 (again, empty values)

  • timeline_webview:ERROR TimelineWebView::eval_js() called before document ready event. Script queued: $('body').scope().LoadJson({"value": {"layers": [{"id": "L0", "y": 0, "lock": false, "number": 0, "label": ""}, {"id": "L1", "y": 0, "lock": false, "number": 1, "label": ""}, {"id": "L2", "y": 0, "lock": false, "number": 2, "label": ""}, {"id": "L3", "y": 0, "lock": false, "number": 3, "label": ""}, {"id": "L4", "y": 0, "lock": false, "number": 4, "label": ""}], "version": {"openshot-qt": "0.0.0", "libopenshot": "0.0.0"}, "files": [], "fps": {"den": 1, "num": 24}, "channels": 2, "profile": "HDV 720 24p", "export_path": "", "playhead_position": 0, "scale": 16, "effects": [], "duration": 300, "height": 720, "tick_pixels": 100, "sample_rate": 44100, "history": {"redo": [], "undo": []}, "id": "T0", "settings": {}, "progress": [], "markers": [], "clips": [], "channel_layout": 3, "width": 1280}, "key": "", "old_values": null, "type": "load", "partial": false}); on line 2411 (again, empty values)

  • timeline_webview:ERROR TimelineWebView::eval_js() called before document ready event. Script queued: $('body').scope().LoadJson({"type": "load", "value": {"files": [], "clips": [], "height": 720, "fps": {"num": 24, "den": 1}, "scale": 16, "layers": [{"y": 0, "id": "L0", "lock": false, "number": 0, "label": ""}, {"y": 0, "id": "L1", "lock": false, "number": 1, "label": ""}, {"y": 0, "id": "L2", "lock": false, "number": 2, "label": ""}, {"y": 0, "id" : "L3", "lock": false, "number": 3, "label": ""}, {"y": 0, "id": "L4", "lock": false, "number": 4, "label": ""}], "channels": 2, "tick_pixels": 100, "channel_layout": 3, "playhead_position": 0, "profile": "HDV 720 24p", "settings" : {}, "history": {"redo": [], "undo": []}, "duration": 300, "id": "T0", "sample_rate": 44100, "effects": [], "export_path": "", "width": 1280, "progress": [], "markers": [], "version": {"libopenshot": "0.0.0", "openshot-qt": "0.0. 0"}}, "key": "", "old_values": null, "partial": false}); on line 2610 (again, empty values)

  • timeline_webview:ERROR TimelineWebView::eval_js() called before document ready event. Script queued: $('body').scope().LoadJson({"value": {"duration": 300, "scale": 16, "history": {"redo": [], "undo": []}, "settings": {}, "markers": [], "layers": [{"label": "", "number": 0, "y": 0, "id": "L0", "lock": false}, {"label": "", "number": 1, "y": 0, "id": "L1", "lock": false}, {"label": "", "number": 2, "y": 0, "id": "L2", "lock": false}, {"label": "", " number": 3, "y": 0, "id": "L3", "lock": false}, {"label": "", "number": 4, "y": 0, "id": "L4", "lock": false}], "effects": [], "id": "T0", "sample_rate": 44100, "tick_pixels": 100, "files": [], "height": 720, "playhead_position": 0, "version": {"libopenshot": "0.0.0", "openshot-qt": "0.0.0"}, "fps": {"num": 24, "den": 1}, "profile": "HDV 720 24p", "progress": [], "export_path": "", "width": 1280, "channels": 2, "channel_layout": 3, "clips": []}, "type": "l oad", "key": "", "old_values": null, "partial": false}); on line 2833 (again empty values)

  • timeline_webview:ERROR TimelineWebView::eval_js() called before document ready event. Script queued: $('body').scope().LoadJson({"partial": false, "old_values": null, "key": "", "type": "load", "value": {"tick_pixels": 100, "version": {"openshot-qt": "0.0.0", "libopenshot": "0.0.0"}, "settings": {}, "fps": {"den": 1, "num": 24}, "scale": 16, "layers": [{"id": "L0", "lock": false, "number": 0, "y": 0, "label": ""}, {"id": "L1", "lock": false, "number": 1, "y": 0, "label": ""}, {"id": "L2", "lock": false, "number": 2, "y": 0, "label": ""}, {"id": "L3", "lock": false, "number": 3, "y": 0, "label": ""}, {"id": "L4", "lock": false, "number": 4, "y": 0, "label": ""}], "playhead_position": 0, "duration": 300, "history": {"redo": [], "undo": []}, "height": 720, "progress": [], "clips": [], "profile": "HDV 720 24p", "effects": [], "width": 1280, "sample_rate": 44100, "files": [], "channel_layout": 3, "id": "T0", "channels": 2, "markers": [], "export_path": ""}}); on line 40029 (again, empty values)

  • timeline_webview:ERROR TimelineWebView::eval_js() called before document ready event. Script queued: $('body').scope().LoadJson({"old_values": null, "type": "load", "value": {"history": {"redo": [], "undo": []}, "export_path": "", "channels": 2, "version": {"openshot-qt": "0.0.0", "libopenshot": "0.0.0"}, "tick_pixels": 100, "fps": {"den": 1, "num": 24}, "progress": [], "settings": {}, "files": [], "effects": [], "layers": [{"lock": false, "id": "L0", "label": "", "y": 0, "number": 0}, {"lock": false, "id": "L1", "label": "", "y": 0, "number": 1}, {"lock": false, "id": "L2", "label": "", "y": 0, "number": 2}, {"lock": false, "id": "L3", "label": "", "y": 0, "number": 3}, {"lock": false, "id": "L4", "label": "", "y": 0, "number": 4}], "clips": [], "channel_layout": 3, "markers": [], "sample_rate": 44100, "width": 1280, "id": "T0", "playhead_position": 0, "height": 720, "profile": "HDV 720 24p", "scale": 16, "duration": 300}, "key": "", "partial": false}); on line 40299 (again, empty values)

  • timeline_webview:ERROR TimelineWebView::eval_js() called before document ready event. Script queued: $('body').scope().LoadJson({"key": "", "value": {"layers": [{"label": "", "number": 0, "id": "L0", "lock": false, "y": 0}, {"label": "", "number": 1, "id": "L1", "lock": false, "y": 0}, {"label": "", "number": 2, "id": "L2", "lock": false, "y": 0}, {"label": "", "number": 3, "id": "L3", "lock": false, "y": 0}, {"label": "", "number": 4, "id": "L4", "lock": false, "y": 0}], "export_path": "", "profile": "HDV 720 24p", "scale": 16, "height": 720, "version": {"openshot-qt": "0.0.0", "libopenshot": "0.0.0"}, "effects": [], "clips": [], "history": {"undo": [], "redo": []}, "fps": {"den": 1, "num": 24}, "id": "T0", "files": [], "sample_rate": 44100, "playhead_position": 0, "settings": {}, "duration": 300, "channels": 2, "tick_pixels": 100, "width": 1280, "progress": [], "channel_layout": 3, "markers": []}, "partial": false, "type": "load", "old_values": null}); on line 41293 (again, empty values)

There are also a lot of entries of recovering and clearing backups:

$ cat openshot-qt.log | cat -n | egrep -i 'backup' | grep -v WARNING
1348 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
1353 main_window:INFO recover_backup
1376 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
1383 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
1390 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
1398 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
1412 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
1474 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
1674 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
1679 main_window:INFO recover_backup
1701 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
1708 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
1902 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
1907 main_window:INFO recover_backup
1924 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
1931 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
1969 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
2381 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
2386 main_window:INFO recover_backup
2399 main_window:ERROR Unhandled crash detected... will attempt to recover backup project: C:\Users\I823147.openshot_qt\backup
2406 main_window:INFO recover_backup
2600 main_window:ERROR Unhandled crash detected... will attempt to recover backup project: C:\Users\I823147.openshot_qt\backup
2605 main_window:INFO recover_backup
2627 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
2823 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
2828 main_window:INFO recover_backup
2851 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
3045 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
3050 main_window:INFO recover_backup
3067 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
3086 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
3113 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
40019 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
40024 main_window:INFO recover_backup
40045 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
40098 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
40289 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
40294 main_window:INFO recover_backup
40317 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
40326 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
40526 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
40531 main_window:INFO recover_backup
40564 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
40571 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
40832 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
40837 main_window:INFO recover_backup
40854 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
41053 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
41058 main_window:INFO recover_backup
41076 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
41085 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
41283 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup
41288 main_window:INFO recover_backup
41311 main_window:INFO Clear all backups: C:\Users\I823147.openshot_qt\backup

While this additional info doesn't fix the problem, perhaps it will help someone else identify the root cause and offer a fix.

@N3WWN - Thanks for the detective work here!

I've faced the same issue. I've been trying to "undo" something, but then I noticed nothing happens when I click the button and I've closed the whole window. Now trying to open my project I get the same error. How could I recover my project? Here is the file. Here is a reformatted version for convinience.

Upd: recovered removing lines number 25575 and 25576 in my file.

@sprnza - So, has this been resolved for you, good sir?

Ah! So basically there's two null values there and that is what was causing the problems?

I checked a few .osp projects that I had and they only have null values assigned to some property inside braces. Maybe it's just that somehow these two null values ended up outside that is causing the trouble?

@N3WWN - Could you perhaps take this new data into account in your detective work here, Mr. Holmes? :)

Hi
I have the same problem . Did you find a solution ?

Hello I'm new to coding and OpenShot in general, and I'm having the same error can someone explain the fix?

@DylanC

I advise you to test Videopad. Very handly and it allowed me to remake the work within 60% less time.

@Wrussell44 - What version of OpenShot do you have?

@DylanC I have version 2.4.2

Same problem here on Linux, using the AppImage of Openshot 2.4.2.

I "fixed" it by editing the .osp file with a text editor (vim) and removing all entries with null values (there were 3 of them). I still have the broken file if it is needed.

@Wrussell44 - See the response by gapan. This should explain how to fix it.

@ferdnyc - I don't know if you have been pinged here before. But I think this might pique your interest.

Well, the new history-free project-file loader/saver in #2400 should eliminate this for any future saves, because the null values always seem to be in history entries — and history entries won't be saved to the project files anymore, if that PR lands.

However, I'm not _sure_ whether #2400 would actually have solved this for old project files that are already causing problems, since the entire project file (including the history) still has to be read in to memory _first_, before any existing history can be discarded. So, I guess it depends how immediately after (or even during) the file-loading process this error is occuring. (Code-wise, I mean, not in terms of seconds on the clock.)

It'd actually be an interesting experiment, if anyone has a broken project file and the ability to run OpenShot from a cloned branch, and wanted to try it.

@ferdnyc - Perhaps a try except statement will help load older projects with such an issue?

I was just having the same issue. After reading about the possible null fix, I went into the .osp file via Notepad++.

I found 4 null values (not seeming attached to any code) using the find tool. I deleted them along with the extra punctuation. And it saved my file!

null photo

I'm so glad I found this thread, thank you. I hope you all get to recover your projects too!

Closing all remaining open issues regarding "NoneType" error messages, which I believe were all found to be attributable to various project-file data export bugs (like the history corruption), all of which have (AFAIK) since been corrected.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Emma3993 picture Emma3993  ·  3Comments

GrandpaBill3006 picture GrandpaBill3006  ·  3Comments

TavernSenses picture TavernSenses  ·  3Comments

mnally8 picture mnally8  ·  3Comments

CarlBicknell picture CarlBicknell  ·  3Comments