Fossil Forum

fossil import creates invalid marks file
Login

fossil import creates invalid marks file

fossil import creates invalid marks file

(1) By Michael Durian (durian) on 2022-04-13 16:06:17 [link] [source]

I'm new to fossil, so this might be an obvious error on my part.

I'm trying to set up a bi-directional git / fossil relationship as documented on the Import and Export page. When I export git to fossil, it works - once. On a second attempt, the fossil import fails with a "error importing marks from file" error. When I check the marks file, I see the following suspicious line:

c3623 :3623 6f102f65ee3ed088cfda534c58f2139a2458c466ff3d8ba7d0dde770a27c45ac
c4022 996753550ad95048690703e7813935458b9da3da2523d09dbaccc57ed317fa45 996753550ad95048690703e7813935458b9da3da2523d09dbaccc57ed317fa45
c2825 :2825 caf10cd6185ee9dcbc9f86d0a0dad05265077e3fe715af7204617e3cf5de8242

If I delete the line starting C4022, the import works.

Is using the marks file required, or is just an optimization to allow fossil to quickly skip data that has already been imported?

(2) By Richard Hipp (drh) on 2022-04-13 16:40:30 in reply to 1 [link] [source]

I think using the marks file is required. But I'm not an authority on Git so I could easily be wrong.

If you are thinking that I need to spend some time and simplify the Git-to-Fossil import process, as I previously did for Fossil-to-Git export process, then I concur. It's just a matter of freeing up some time for me to work on it...

(3) By Michael Durian (durian) on 2022-04-13 16:59:09 in reply to 2 [link] [source]

I really don't know what the marks files are, so I'm not sure if I was clear. The file with the invalid line is the fossil.marks file. The one used for import and export on the fossil command side of the pipe. Does the fossil.marks file contain git's marks?

If I do (no marks)

git fast-export --all | fossil import --git --incremental project.fossil

repeatedly, will the imports work, or will I get duplicate entries or something?

(4) By Richard Hipp (drh) on 2022-04-13 17:12:02 in reply to 3 [link] [source]

I'm sorry, but I don't know. I never do Git imports, and I didn't write that particular module of Fossil (or, at least, I don't remember writing it).

Perhaps somebody else who has done this recently can give a better answer.

(5) By Michael Durian (durian) on 2022-04-13 18:17:12 in reply to 4 [source]

Thanks. Hopefully someone will know.

Taking a quick look at import.c and export.c, I see a potential problem. export_mark() in export.c calls mark_name_from_rid() to retrieve a mark before writing it out. It does not check that return value against NULL before using it.

The comment for mark_name_from_rid() says NULL is returned if the rid does not have an associated UUID (i.e. is not valid). Determining why that might be the case is a bit beyond me.

(6) By John Rouillard (rouilj) on 2022-04-13 18:35:04 in reply to 5 [link] [source]

Do you have any shunned artifacts in your fossil repo?

(7) By Michael Durian (durian) on 2022-04-13 18:52:40 in reply to 6 [link] [source]

I don't know what shunned artifacts are. How do I check?

This project has been a git project for all its life. I'm experimenting to see if fossil might be a better option. I exported git into fossil once. Made a change in the git version and then did the incremental import into fossil. That's when the marks file with the bad entry was created.

I have not initiated any changes from the fossil version.

(8) By Martin Gagnon (mgagnon) on 2022-04-13 19:04:54 in reply to 7 [link] [source]

I have not initiated any changes from the fossil version.

So it's not likely to be the problem then. Artifact can be shunned on fossil side, but it's a kind of last resort weapon and it's not something that you will do by mistake without noticing it.

To see if you have shunned artifacts, just fire up the web ui (fossil ui) and go on the /shun page (or navigate to: admin --> shunned)

(9) By Michael Durian (durian) on 2022-04-13 19:11:38 in reply to 8 [link] [source]

I checked to confirm. There are no shunned artifacts.