Tropy Freezes after Switching Windows

I am working with Tropy version 1.12.0 and my operating system is macOS Monterey 12.4.

I’ve noticed that in the last three to four months, Tropy freezes somewhat inconsistently when I switch windows. The entire program does not freeze, but rather I am unable to add metadata or make notes to pictures; when I type no text appears and I cannot click the ‘Add Tag’ button. This behavior occurs when I switch windows, and then attempt to add notes, tags, or metadata to a picture in my Project directory I have double-clicked on. Typically, the behavior I’m observing occurs only after I switch windows: I will, for example, add a note to an item, then use the Alt + Tab shortcut to switch to a different open window on my desktop. When I switch back to Tropy and attempt to make notes, add tags, etc. to an item I am unable to do so.

This error takes two different forms. In the first form, no error message occurs but I am unable to make changes to an item. I then exit Tropy and an error message briefly flashes in front of the screen but I’m unable to read it before the program closes. In the second form, an error message appears and stays open that says “SQLITE_READONLY: attempt to write a readonly database.” The copied error is “{“msg”:“unhandled error: SQLITE_READONLY: attempt to write a readonly database”,“stack”:“Error: SQLITE_READONLY: attempt to write a readonly database”,“system”:“Darwin 21.5.0 (x64)”,“time”:1665600036790,“version”:“1.12.0”}” The only way to resolve these errors and restore functionality to Tropy is to exit the program and re-enter.

I should mention that I currently keep all the pictures I have loaded into my Tropy Project on an external hard drive due to a lack of space on my computer.

Below is a reproduction of the log files I retrieved after the error described above occurred. The log text below was recorded after I received the error message mentioned above.

{“level”:30,“time”:1665598451264,“type”:“browser”,“name”:“main”,“args”:[“file:///Users/josephvandernaald/Documents/Dissertation/van%20der%20Naald%20Dissertation,%20Archival%20Material.tpy”],“opts”:{“env”:“production”,“autoUpdates”:true,“contextIsolation”:true,“webgl”:false,“debug”:false,“trace”:false,“data”:"/Users/josephvandernaald/Library/Application Support/Tropy",“cache”:"/Users/josephvandernaald/Library/Caches/Tropy",“logs”:"/Users/josephvandernaald/Library/Logs/Tropy"},“version”:“1.12.0”,“msg”:“main.init 1.12.0 Darwin 21.5.0 (x64)”}
{“level”:30,“time”:1665598451451,“type”:“browser”,“name”:“main”,“msg”:“plugins scanned: 0”}
{“level”:30,“time”:1665598451455,“type”:“browser”,“name”:“main”,“msg”:“app state restored”}
{“level”:30,“time”:1665598451458,“type”:“browser”,“name”:“main”,“file”:"/Users/josephvandernaald/Documents/Dissertation/van der Naald Dissertation, Archival Material.tpy",“msg”:“open new project window”}
{“level”:30,“time”:1665598451599,“type”:“browser”,“name”:“main”,“msg”:“switch to “system” theme”}
{“level”:30,“time”:1665598451599,“type”:“browser”,“name”:“main”,“msg”:“checking for updates…”}
{“level”:30,“time”:1665598451895,“type”:“browser”,“name”:“main”,“msg”:“no updates available”}
{“level”:30,“time”:1665598451975,“type”:“renderer”,“name”:“project”,“dpx”:1,“opts”:{“env”:“production”,“documents”:"/Users/josephvandernaald/Documents",“pictures”:"/Users/josephvandernaald/Pictures",“theme”:“system”,“aqua”:“graphite”,“contrast”:false,“dark”:true,“scrollbars”:true,“vibrancy”:false,“file”:"/Users/josephvandernaald/Documents/Dissertation/van der Naald Dissertation, Archival Material.tpy",“recent”:["/Users/josephvandernaald/Documents/Dissertation/van der Naald Dissertation, Archival Material.tpy","/Volumes/TOSHIBA EXT/Dissertation Data/Tropy Files/van der Naald Dissertation, Archival Material.tpy","/Users/josephvandernaald/Library/Mobile Documents/com~apple~CloudDocs/Documents/Dissertation/van der Naald Dissertation, Archival Material.tpy","/Users/josephvandernaald/Documents/van der Naald Dissertation, Archival Material.tpy"],“data”:"/Users/josephvandernaald/Library/Application Support/Tropy",“debug”:false,“dev”:false,“cache”:"/Users/josephvandernaald/Library/Caches/Tropy",“plugins”:"/Users/josephvandernaald/Library/Application Support/Tropy/plugins",“fontSize”:“13px”,“frameless”:true,“level”:“info”,“locale”:“en”,“log”:"/Users/josephvandernaald/Library/Logs/Tropy/tropy.log",“uuid”:“3141d900-d942-11eb-ad02-17b5e2c311c6”,“update”:{},“version”:“1.12.0”,“webgl”:true,“zoom”:1,“maximizable”:true,“minimizable”:true},“msg”:“project.init”}
{“level”:30,“time”:1665598452255,“type”:“renderer”,“name”:“project”,“msg”:“plugins scanned: 0”}
{“level”:30,“time”:1665598452256,“type”:“renderer”,“name”:“project”,“msg”:“plugins loaded: 0”}
{“level”:30,“time”:1665598452293,“type”:“browser”,“name”:“main”,“msg”:“ready after 836.7099609375ms”}
{“level”:30,“time”:1665598452883,“type”:“renderer”,“name”:“project”,“msg”:“restoring recent@tropy”}
{“level”:30,“time”:1665598452887,“type”:“renderer”,“name”:“project”,“msg”:“restoring settings@tropy”}
{“level”:30,“time”:1665598452887,“type”:“renderer”,“name”:“project”,“msg”:“restoring ui@tropy”}
{“level”:30,“time”:1665598452903,“type”:“renderer”,“name”:“project”,“mode”:“w+”,“msg”:“open db /Users/josephvandernaald/Library/Application Support/Tropy/ontology.db”}
{“level”:30,“time”:1665598452927,“type”:“renderer”,“name”:“project”,“msg”:“project ready 1399ms [dom:709ms win:260ms req:382ms]”}
{“level”:30,“time”:1665598453235,“type”:“renderer”,“name”:“project”,“msg”:“Esper.instance created using webgl renderer”}
{“level”:30,“time”:1665598453398,“type”:“renderer”,“name”:“project”,“mode”:“w”,“msg”:“open db /Users/josephvandernaald/Documents/Dissertation/van der Naald Dissertation, Archival Material.tpy”}
{“level”:30,“time”:1665598453467,“type”:“renderer”,“name”:“project”,“msg”:“restoring project.watch@6f15745c-302a-4b62-a747-a5fd0f9c8ede”}
{“level”:30,“time”:1665598453531,“type”:“renderer”,“name”:“project”,“msg”:“restoring nav@6f15745c-302a-4b62-a747-a5fd0f9c8ede”}
{“level”:30,“time”:1665598453531,“type”:“renderer”,“name”:“project”,“msg”:“restoring notepad@6f15745c-302a-4b62-a747-a5fd0f9c8ede”}
{“level”:30,“time”:1665598453531,“type”:“renderer”,“name”:“project”,“msg”:“restoring esper@6f15745c-302a-4b62-a747-a5fd0f9c8ede”}
{“level”:30,“time”:1665598453532,“type”:“renderer”,“name”:“project”,“msg”:“restoring imports@6f15745c-302a-4b62-a747-a5fd0f9c8ede”}
{“level”:30,“time”:1665598453532,“type”:“renderer”,“name”:“project”,“msg”:“restoring sidebar@6f15745c-302a-4b62-a747-a5fd0f9c8ede”}
{“level”:30,“time”:1665598453533,“type”:“renderer”,“name”:“project”,“msg”:“restoring panel@6f15745c-302a-4b62-a747-a5fd0f9c8ede”}
{“level”:30,“time”:1665598453569,“type”:“renderer”,“name”:“project”,“mode”:“w”,“msg”:“open db /Users/josephvandernaald/Documents/Dissertation/van der Naald Dissertation, Archival Material.tpy”}
{“level”:30,“time”:1665598453572,“type”:“renderer”,“name”:“project”,“mode”:“w”,“msg”:“open db /Users/josephvandernaald/Documents/Dissertation/van der Naald Dissertation, Archival Material.tpy”}
{“level”:40,“time”:1665598454806,“type”:“renderer”,“name”:“project”,“ms”:1231,“list”:true,“query”:"",“tags”:false,“trash”:null,“msg”:“SLOW: *search query “” took 1231ms”}
{“level”:40,“time”:1665598604304,“type”:“renderer”,“name”:“project”,“action”:“note.create”,“meta”:{“done”:true,“rel”:36,“was”:1665598604160,“seq”:38,“now”:1665598604300},“msg”:“note.create failed: SQLITE_READONLY: attempt to write a readonly database”,“stack”:“Error: SQLITE_READONLY: attempt to write a readonly database”}
{“level”:60,“time”:1665598604684,“type”:“browser”,“name”:“main”,“message”:“SQLITE_READONLY: attempt to write a readonly database”,“stack”:“Error: SQLITE_READONLY: attempt to write a readonly database”}

Another manifestation of this error produced the following log file:

{“level”:30,“time”:1665596182315,“type”:“browser”,“name”:“main”,“args”:[“file:///Users/josephvandernaald/Documents/Dissertation/van%20der%20Naald%20Dissertation,%20Archival%20Material.tpy”],“opts”:{“env”:“production”,“autoUpdates”:true,“contextIsolation”:true,“webgl”:false,“debug”:false,“trace”:false,“data”:"/Users/josephvandernaald/Library/Application Support/Tropy",“cache”:"/Users/josephvandernaald/Library/Caches/Tropy",“logs”:"/Users/josephvandernaald/Library/Logs/Tropy"},“version”:“1.12.0”,“msg”:“main.init 1.12.0 Darwin 21.5.0 (x64)”}
{“level”:30,“time”:1665596182579,“type”:“browser”,“name”:“main”,“msg”:“plugins scanned: 0”}
{“level”:30,“time”:1665596182600,“type”:“browser”,“name”:“main”,“msg”:“app state restored”}
{“level”:30,“time”:1665596182614,“type”:“browser”,“name”:“main”,“file”:"/Users/josephvandernaald/Documents/Dissertation/van der Naald Dissertation, Archival Material.tpy",“msg”:“open new project window”}
{“level”:30,“time”:1665596182980,“type”:“browser”,“name”:“main”,“msg”:“switch to “system” theme”}
{“level”:30,“time”:1665596182999,“type”:“browser”,“name”:“main”,“msg”:“checking for updates…”}
{“level”:30,“time”:1665596183558,“type”:“renderer”,“name”:“project”,“dpx”:1,“opts”:{“env”:“production”,“documents”:"/Users/josephvandernaald/Documents",“pictures”:"/Users/josephvandernaald/Pictures",“theme”:“system”,“aqua”:“graphite”,“contrast”:false,“dark”:true,“scrollbars”:true,“vibrancy”:false,“file”:"/Users/josephvandernaald/Documents/Dissertation/van der Naald Dissertation, Archival Material.tpy",“recent”:["/Users/josephvandernaald/Documents/Dissertation/van der Naald Dissertation, Archival Material.tpy","/Volumes/TOSHIBA EXT/Dissertation Data/Tropy Files/van der Naald Dissertation, Archival Material.tpy","/Users/josephvandernaald/Library/Mobile Documents/com~apple~CloudDocs/Documents/Dissertation/van der Naald Dissertation, Archival Material.tpy","/Users/josephvandernaald/Documents/van der Naald Dissertation, Archival Material.tpy"],“data”:"/Users/josephvandernaald/Library/Application Support/Tropy",“debug”:false,“dev”:false,“cache”:"/Users/josephvandernaald/Library/Caches/Tropy",“plugins”:"/Users/josephvandernaald/Library/Application Support/Tropy/plugins",“fontSize”:“13px”,“frameless”:true,“level”:“info”,“locale”:“en”,“log”:"/Users/josephvandernaald/Library/Logs/Tropy/tropy.log",“uuid”:“3141d900-d942-11eb-ad02-17b5e2c311c6”,“update”:{},“version”:“1.12.0”,“webgl”:true,“zoom”:1,“maximizable”:true,“minimizable”:true},“msg”:“project.init”}
{“level”:30,“time”:1665596183636,“type”:“renderer”,“name”:“project”,“msg”:“plugins scanned: 0”}
{“level”:30,“time”:1665596183636,“type”:“renderer”,“name”:“project”,“msg”:“plugins loaded: 0”}
{“level”:30,“time”:1665596183672,“type”:“browser”,“name”:“main”,“msg”:“ready after 1586.4951171875ms”}
{“level”:30,“time”:1665596183698,“type”:“browser”,“name”:“main”,“msg”:“no updates available”}
{“level”:30,“time”:1665596184300,“type”:“renderer”,“name”:“project”,“msg”:“restoring recent@tropy”}
{“level”:30,“time”:1665596184304,“type”:“renderer”,“name”:“project”,“msg”:“restoring settings@tropy”}
{“level”:30,“time”:1665596184304,“type”:“renderer”,“name”:“project”,“msg”:“restoring ui@tropy”}
{“level”:30,“time”:1665596184331,“type”:“renderer”,“name”:“project”,“mode”:“w+”,“msg”:“open db /Users/josephvandernaald/Library/Application Support/Tropy/ontology.db”}
{“level”:30,“time”:1665596184365,“type”:“renderer”,“name”:“project”,“msg”:“project ready 1501ms [dom:705ms win:272ms req:456ms]”}
{“level”:30,“time”:1665596184930,“type”:“renderer”,“name”:“project”,“msg”:“Esper.instance created using webgl renderer”}
{“level”:30,“time”:1665596185191,“type”:“renderer”,“name”:“project”,“mode”:“w”,“msg”:“open db /Users/josephvandernaald/Documents/Dissertation/van der Naald Dissertation, Archival Material.tpy”}
{“level”:30,“time”:1665596185316,“type”:“renderer”,“name”:“project”,“msg”:“restoring project.watch@6f15745c-302a-4b62-a747-a5fd0f9c8ede”}
{“level”:30,“time”:1665596185439,“type”:“renderer”,“name”:“project”,“msg”:“db query took 119ms”,“query”:“PRAGMA integrity_check(10)”,“ms”:119}
{“level”:30,“time”:1665596185444,“type”:“renderer”,“name”:“project”,“msg”:“restoring nav@6f15745c-302a-4b62-a747-a5fd0f9c8ede”}
{“level”:30,“time”:1665596185462,“type”:“renderer”,“name”:“project”,“msg”:“restoring notepad@6f15745c-302a-4b62-a747-a5fd0f9c8ede”}
{“level”:30,“time”:1665596185462,“type”:“renderer”,“name”:“project”,“msg”:“restoring esper@6f15745c-302a-4b62-a747-a5fd0f9c8ede”}
{“level”:30,“time”:1665596185463,“type”:“renderer”,“name”:“project”,“msg”:“restoring imports@6f15745c-302a-4b62-a747-a5fd0f9c8ede”}
{“level”:30,“time”:1665596185463,“type”:“renderer”,“name”:“project”,“msg”:“restoring sidebar@6f15745c-302a-4b62-a747-a5fd0f9c8ede”}
{“level”:30,“time”:1665596185464,“type”:“renderer”,“name”:“project”,“msg”:“restoring panel@6f15745c-302a-4b62-a747-a5fd0f9c8ede”}
{“level”:30,“time”:1665596185552,“type”:“renderer”,“name”:“project”,“mode”:“w”,“msg”:“open db /Users/josephvandernaald/Documents/Dissertation/van der Naald Dissertation, Archival Material.tpy”}
{“level”:30,“time”:1665596185553,“type”:“renderer”,“name”:“project”,“mode”:“w”,“msg”:“open db /Users/josephvandernaald/Documents/Dissertation/van der Naald Dissertation, Archival Material.tpy”}
{“level”:40,“time”:1665596187168,“type”:“renderer”,“name”:“project”,“ms”:1612,“list”:true,“query”:"",“tags”:false,“trash”:null,“msg”:“SLOW: *search query “” took 1612ms”}
{“level”:30,“time”:1665596197948,“type”:“renderer”,“name”:“project”,“msg”:“db query took 124ms”,“query”:"\n INSERT INTO taggings (tag_id, id) VALUES (262, 1038)",“ms”:124}
{“level”:30,“time”:1665596497782,“type”:“renderer”,“name”:“project”,“msg”:“pruning cache 6f15745c-302a-4b62-a747-a5fd0f9c8ede”}
{“level”:30,“time”:1665596497788,“type”:“renderer”,“name”:“project”,“msg”:“purging cache /Users/josephvandernaald/Library/Caches/Tropy”}
{“level”:40,“time”:1665596726683,“type”:“renderer”,“name”:“project”,“action”:“note.save”,“meta”:{“done”:true,“rel”:153,“was”:1665596726633,“seq”:157,“now”:1665596726683},“msg”:“note.save failed: SQLITE_READONLY: attempt to write a readonly database”,“stack”:“Error: SQLITE_READONLY: attempt to write a readonly database”}
{“level”:30,“time”:1665596741031,“type”:“renderer”,“name”:“project”,“msg”:“persisting nav@6f15745c-302a-4b62-a747-a5fd0f9c8ede”}
{“level”:30,“time”:1665596741031,“type”:“renderer”,“name”:“project”,“msg”:“persisting notepad@6f15745c-302a-4b62-a747-a5fd0f9c8ede”}
{“level”:30,“time”:1665596741031,“type”:“renderer”,“name”:“project”,“msg”:“persisting esper@6f15745c-302a-4b62-a747-a5fd0f9c8ede”}
{“level”:30,“time”:1665596741032,“type”:“renderer”,“name”:“project”,“msg”:“persisting imports@6f15745c-302a-4b62-a747-a5fd0f9c8ede”}
{“level”:30,“time”:1665596741032,“type”:“renderer”,“name”:“project”,“msg”:“persisting sidebar@6f15745c-302a-4b62-a747-a5fd0f9c8ede”}
{“level”:30,“time”:1665596741032,“type”:“renderer”,“name”:“project”,“msg”:“persisting panel@6f15745c-302a-4b62-a747-a5fd0f9c8ede”}
{“level”:40,“time”:1665596741074,“type”:“renderer”,“name”:“project”,“stack”:“Error: SQLITE_READONLY: attempt to write a readonly database”,“msg”:“unexpected error in *project.open”}
{“level”:30,“time”:1665596741106,“type”:“renderer”,“name”:“project”,“msg”:“persisting recent@tropy”}
{“level”:30,“time”:1665596741106,“type”:“renderer”,“name”:“project”,“msg”:“persisting settings@tropy”}
{“level”:30,“time”:1665596741106,“type”:“renderer”,“name”:“project”,“msg”:“persisting ui@tropy”}
{“level”:60,“time”:1665596741445,“type”:“browser”,“name”:“main”,“message”:“Cannot read properties of null (reading ‘next’)”,“stack”:“TypeError: Cannot read properties of null (reading ‘next’)\n at /Applications/Tropy.app/Contents/Resources/app.asar/lib/bootstrap-a4d58a43.js:7578:18\n at new Promise ()\n at show (/Applications/Tropy.app/Contents/Resources/app.asar/lib/bootstrap-a4d58a43.js:7577:10)\n at notify (/Applications/Tropy.app/Contents/Resources/app.asar/lib/bootstrap-a4d58a43.js:7591:10)\n at fail (/Applications/Tropy.app/Contents/Resources/app.asar/lib/bootstrap-a4d58a43.js:7599:10)\n at runCallEffect (/Applications/Tropy.app/Contents/Resources/app.asar/lib/project-c4b6f903.js:3568:21)\n at runEffect (/Applications/Tropy.app/Contents/Resources/app.asar/lib/project-c4b6f903.js:4034:7)\n at digestEffect (/Applications/Tropy.app/Contents/Resources/app.asar/lib/project-c4b6f903.js:4079:5)\n at next (/Applications/Tropy.app/Contents/Resources/app.asar/lib/project-c4b6f903.js:4011:9)\n at Object.currCb [as cont] (/Applications/Tropy.app/Contents/Resources/app.asar/lib/project-c4b6f903.js:4067:7)\n at end (/Applications/Tropy.app/Contents/Resources/app.asar/lib/project-c4b6f903.js:3932:10)\n at abort (/Applications/Tropy.app/Contents/Resources/app.asar/lib/project-c4b6f903.js:3790:5)\n at Object.task.cont (/Applications/Tropy.app/Contents/Resources/app.asar/lib/project-c4b6f903.js:3801:9)\n at next (/Applications/Tropy.app/Contents/Resources/app.asar/lib/project-c4b6f903.js:4023:16)\n at currCb (/Applications/Tropy.app/Contents/Resources/app.asar/lib/project-c4b6f903.js:4067:7)\n at /Applications/Tropy.app/Contents/Resources/app.asar/lib/project-c4b6f903.js:3472:5”}
{“level”:30,“time”:1665596741847,“type”:“browser”,“name”:“main”,“msg”:“saving app state”}
{“level”:30,“time”:1665596741875,“type”:“browser”,“name”:“main”,“quit”:true,“code”:0,“msg”:“quit with exit code 0”}

Thanks for reporting!

This is rather curious. When Tropy first opens the project file, it ensures it has write access to the file; if it not, the project should open but you should see a padlock symbol next to the project name and creating notes etc. should not be possible. So when you open the project file, we have write access for sure. Yet, when you create the note later on, we get the read only error which suggests that the file permissions change. Note that after the error occurs, Tropy should switch to read-only mode so that explains the behavior you describe (for example that you can’t click ‘Add Tag’ etc.).

Just to confirm, this does not happen all the time, right? That is, you can normally work on the project when you start Tropy and then sometimes you will run into this error but other times it’s fine? But every time it does happen, you observed that you switched windows prior to the error?

It looks like your project file sits on the main drive, so I don’t think this has anything to do with your photos being stored on an external drive. The logs seem to suggest that the file really switches to read-only mode intermittently. This could point to an issue with the file system or with the hard drive itself, although that’s doubtful. Is it possible that there is another application or process which accesses the file or temporarily changes its permissions? For example, something like a backup service or malware scanner?

You could try opening a Terminal window and running lsof -r 1 path/to/your/project.tpy with your project file. This should list all processes which access the file in one second intervals. At first there should be nothing. When you open the project there should be 1-3 Tropy processes. It would be interesting to know if there’s any other process in that list.