Hook 1.7 fails to launch: uncaught exception 'Cannot create table link.', reason: '(null)'

Hi,

I’m seeing a crash with Hook v1.7. The app doesn’t launch:

Process: Hook [1110]
Path: /Applications/Hook.app/Contents/MacOS/Hook
Identifier: Hook
Version: 1.7 (3391)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Hook [1110]
User ID: 501

Date/Time: 2020-06-12 13:35:51.403 -0400
OS Version: Mac OS X 10.14.6 (18G5033)
Report Version: 12
Bridge OS Version: 3.0 (14Y906)
Anonymous UUID: DA1FDDA7-D94F-7F24-CE08-7356E1524539

Time Awake Since Boot: 160 seconds

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: fmdb.<FMDatabaseQueue: 0x600001d257d0>

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Application Specific Information:
*** Terminating app due to uncaught exception ‘Cannot create table link.’, reason: ‘(null)’
terminating with uncaught exception of type NSException
abort() called

(removed rest of report)

Could you please try this from command line (/Applications/Utilities/Terminal.app):

touch ~/Library/Application\ Support/com.cogsciapps.hook/hook.sqlite

and let us know if it returns a permission error?

2:23 PM: edited to add “touch” command.

Do you have a script , app or other process that manipulates the hook.sqlite apart from Hook itself?

I tried this. The permissions were fine before, didn’t make a difference.

No, I’m a pretty regular user of hook. I haven’t set up anything outside of the regular features that come with the app.

Just to make sure that there is not another Hook instance, then, dealing with this DB (which there should not be), I would recommend doing this from command line:

% ps -ax |grep Hook

or logout/log back in; or reboot. (or have you tried that already?)

We recommend trying this:

  1. while Hook is not running, In Finder, go to ~/Library/Application Support/com.cogsciapps.hook/ folder.
  2. Rename file 1.1 to something else like 1.1_old
  3. Rename file hook.sqlite to something else like hook_old.sqlite_old.
  4. Try to launch Hook.
  5. Once Hook is launched, quit Hook.
  6. Delete newly created 1.1 and Hook.sqlite.
  7. Rename 1.1_old and hook_old.sqlite_old back to 1.1 and hook.sqlite, respectively.

also, I wasn’t clear from your PIM whether you also experienced this with 1.6. Did you?

Our crash analytics only show one such report. So unless others are not sending crash reports, it looks like the issue is not widespread. (Crash reports are handled by Microsoft App Center and only sent if users consent.)

Hi @LucB,

I followed your instructions. Once I renamed 1.1 and hook.sqlite, Hook did start. It complained about the license, and I re-activated.

However, once I deleted the newly-created folder/file and moved the _old versions back, hook started crashing again.

To answer your other question, I did see the problem starting with 1.6, and I decided to download/reinstall to see if that would solve the problem. No luck!

I’m not sure what’s in the sqlite file, but if it’s only the info on what’s linked, I’m happy to provide that file for you.

Best,
Carlos

we were able to ascertain that the problem was a corrupted hook.sqlite database. Recovery from backup and via tools each, independently, proved to be viable solutions.

There’s a technical background here: SQLiteException “database disk image is malformed” - Sergei Dorogin’s technical blog.

We will publish some of our documentation on using those tools with Hook.

more generally

Fortunately, this is the first report we’ve had of such an issue since Hook was launched (beta Jan 2019). However, it is possible for apps’ databases to be corrupted for some reasons (e.g., system crash). So it’s always good idea to have a backup of your library folder. We provide instructions here:

How to Backup and Restore Hook Data – Hook.

We note that some Mac apps automatically back up their DB for users. OmniGroup’s excellent OmniFocus app is an example: Lost database after update on IOS and OF - The Omni Group Forums. I don’t even see an option to switch OmniFocus DB backups off (I think it was there before), so it looks like OmniGroup has decided to make backups mandatory (though maybe there’s a Terminal command line for it).

We’re considering adding auto-backups data backups to Hook.

Given that our crash analytics (via Microsoft App Center, and which are anonymous, optional) don’t show any other such crash, and it’s the first report on the subject, we’ll probably move this topic into Discussion rather than bug reports unless we get data otherwise.

Thanks, again, @raghos for notifying us and working through it with us.