External sync freeze

I’m not the first to encounter this problem, but syncing with an external folder (to allow collaboration) freezes on a file and requires you to force-quit Scrivener, rather than allowing you to cancel the sync (or I should say, rather than working as it should, but since it doesn’t, it should allow you to cancel). This problem seems to go back a decade. I am trying to allow a coauthor to work on certain sections without facing the dreaded issue of one of us opening a project that the other already has open.

I initially tried syncing the entire project, but that always froze at the same number (x of y). So I just put the current chapter in the sync folder, and that worked for several days, but now it freezes (“Syncing 229 of 418”). I don’t know what there are 418 of and have no way to track down what bit (#229) is causing the freezing. Nothing significant changed between when it was working and when it started freezing. And I now must force-quit. When I reopen it rebuilds the search indices and then gives a message about how “this project seems to have been syncing–do you want to do that?” and if I say yes, I get the sync setup pane again, then it tries to sync, and freezes.

This is the only way I’ve found to collaborate with someone, and it doesn’t work.

Any advice on how to do collaborative editing, since this doesn’t work, appreciated.

There is a known problem with this, but it doesn’t go back a decade—rather I think it cropped up in the past update or two. The main trigger is style usage, though not every style will trigger it. In some cases we’ve found that removing the HTML header level setting (found in the Format ▸ Paragraph ▸ HTML Header Level submenu, where selecting “Body” removes the special declaration from the style when it is redefined from a sample with it removed) helps, but that isn’t the only trigger. In some cases it is mysterious.

I would try identifying which document is causing the hang, and checking for any style usage in it. To play it safe I would create a new project from “Blank”, and use the Format ▸ Style ▸ Import Styles... command to import from the main project. After doing that, drag the trigger document into the test project’s binder and try syncing with it. If it hangs, then you can go through that and look for the culprit style.

  1. I made a new project with the chapter that is freezing on sync, tried to sync, it froze.
  2. Set everything to “No style”, and sync worked.
  3. Reloaded project; went through and deleted defined styles one by one. Froze every time until…
  4. …I deleted Heading 1. Then sync worked.
  5. Tried importing styles (including Heading 1) into a fresh copy of the project, overwriting my redefinitions. Sync failed.

So this worked for a while, with plenty of style definitions in use, then started failing. No new styles were defined when it started failing. I have character styles in other chapters, but not this one. Styles are needed because this project has to end up in Word.

Okay, I would try, as suggested, removing the HTML Header Level setting from this style in that case, and see if it works that way. There is no need for this setting in Word anyway, it is mainly for ebook output.

I have traced the problem to one short section of the chapter. This section has a Heading 1 style on the first line, as do all the other sections. If I remove the style from that line, it syncs; if I leave it, or make it Heading 2, it hangs on syncing. There is nothing I can see that makes this section different from any other.

I do not understand suggestion regarding HTML Header Level. That is set to Body Text throughout.

Very strange, how it is only that one section even though the context and style usage is similar to other areas. Maybe try the Edit ▸ Text Tidying ▸ Zap Gremlins command on that document and see if that helps. Showing invisible characters may also help, to see if there are any differences around the styled text, such as using a line break instead of a paragraph break.

I do not understand suggestion regarding HTML Header Level. That is set to Body Text throughout.

Okay, if you made your own heading styles from scratch that is probably how they are set to be. The examples we ship with the software do have H1 and H2 assigned to them.

In a new copy of the project I made that problematic header No Style and successfully synced. I then chose all the text in the synced folder, did a zap gremlins, changed the header to Header 1, and synced successfully. So perhaps there was a gremlin in there. Thanks for the tip!

Very interesting! It may well be what you ran into didn’t have much to do with styles in that case. “Gremlins” (ancient control codes from the days of dot matrix printers and such) can foul things up elsewhere as well—such as halting the compiler. So it’s good you found it one way or another.