Closed Bug 1866772 Opened 6 months ago Closed 5 months ago

Importing Safari history stalls forever when certain problematic entries are present

Categories

(Firefox :: Migration, defect, P1)

Firefox 120
defect

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: kiwan17083, Assigned: mconley)

Details

Attachments

(2 files)

Steps to reproduce:

Tried to import Safari browsing history using the built-in import tool.

Actual results:

Importing Safari history on macos which is located at ~/Library/Safari/History.db silently hangs forever in case some problematic entries are present inside Safari's "history_items" table. Specifically, those items are slightly unusual, and below is a list of example entries that cause a problem.

http://-z((((((((((())))})sszz/
http://<country-code>.archive.ubuntu.com/ubuntu/
http://The Summarit performance is of a very high level and certainly equal to that of the Summicron.
http://q3_us_knob_v1.5.bin.zip/
http://www.195.19.96.179/

Removing those lines from Safari database manually allows the import to finish successfully. I could only find problems with http:// entries and not https://

A sample problematic History.db file is attached. It has just one problematic line from the list above.

Expected results:

Firefox definitely mustn't just stall on import. Problematic lines should either be quietly discarded or a comprehensive error report outlining the necessary steps to remedy the problem should be presented to the user.

The Bugbug bot thinks this bug should belong to the 'Firefox::Bookmarks & History' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Bookmarks & History
Component: Bookmarks & History → Migration

Kiwan17083, can you please add the Mac version from your side and the Firefox version used? Thank you.
Also I am not able to reproduce the issue on Mac14 using FF build 121.0b4. I used import from File->Import from Another Browser, it imported history but not the http://-z((((((((((())))})sszz/ and http://www.195.19.96.179/, and it did not hang.

Flags: needinfo?(kiwan17083)

macos version 14.1 (Sonoma), but I believe I've had this issue on v.13 (Ventura) as well.
Firefox version is 120.0.1, but I believe I've stated that in the report. I've been trying to import history for at least 6 months or more, using Firefox versions that were current at the time. I've also been trying Nightly versions all that time, and all of them exhibited the same problem.

Really don't know what else to add because it's freezing for me, and by freezing I mean the spinning ring just spins endlessly. I decided to get to the root of the problem, took my history file that has about 90k entries in "history_items" and started deleting rows and re-importing until I found the lines that would cause the freeze. In my case if I put that problematic History.db file into ~/Library/Safari, restart Firefox and try to do the import, it would freeze. Then it's as simple as deleting that particular row, re-starting Firefox and importing finishes without issue. So on my end it's a reproducible issue with predictable set of requirements to trigger the bug. If there's anything else I could try, like for example trying to import exactly the same History.db with problematic entries that works for you, I'm all for it. It's just a shame that there's no debug info for importing or I don't know how to output it. I've tried looking at console logs after enabling some verbose logging and couldn't find anything of interest there.

Flags: needinfo?(kiwan17083)

Thank you so much, kiwan17083 for the detailed steps to reproduce, and the history database! This should make it much simpler to produce a fix.

Assignee: nobody → mconley
Severity: -- → S3
Priority: -- → P1

I'm happy to help in any way I can, Mike. If you need me to do more testing to provide additional data, just let me know. I've preserved my original 69 megabyte history file so it should be easy to do.

Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7272d706196d
Be more resilient against malformed URLs when importing from Safari. r=mstriemer
Status: UNCONFIRMED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: