Stepping Returned Unhandled Result=11

From time to time, Mac OS users will see the following message in the system log.

7/21/15 10:47:44.505 AM nsurlstoraged[444]: Error: stepSQLStatement:toCompletionWithRetry - stepping returned unhandled result=11, DB=/Users/moof/Library/Caches/com.apple.Safari/Cache.db

In this case, unhandled result 11 is SQLite error 11, SQLITE_CORRUPT. That is, the SQLite database /Users/moof/Library/Caches/com.apple.Safari/Cache.db is corrupt. You can see how corrupt by opening a Terminal window and executing the following command.

sqlite3 Library/Caches/com.apple.Safari/Cache.db 'pragma integrity_check;'

The fix is simple enough; delete the bad database and let Safari create a new one.

  • Quit Safari.

  • Open a new Finder window, press shift-cmd-G to get a "Go to the folder" dialog, and enter Library/Caches/com.apple.Safari.

  • Move the following files to the Trash:

    • Cache.db
    • Cache.db-shm
    • Cache.db-wal
  • Restart Safari.