Error
Docker for Mac 2.1.2.0(38030)
unison
version: '2'
syncs:
sync-app:
src: './backend/'
sync_strategy: unison
OSX Version: 10.14.6
0.5.11
Running docker-sync start result in "error during unmarshaling (input_value: ill-formed message)"
Full log:
$ docker-sync start
ok Starting unison for sync sync-app
error Error starting sync, exit code 0
message Warning: No archive files were found for these roots, whose canonical names are:
{docker-sync.yml root dir}/backend
//4bd40753d696//app_sync
This can happen either
because this is the first time you have synchronized these roots,
or because you have upgraded Unison to a new version with a different
archive format.
Update detection may take a while on this run if the replicas are
large.
Unison will assume that the 'last synchronized state' of both replicas
was completely empty. This means that any files that are different
will be reported as conflicts, and any files that exist only on one
replica will be judged as new and propagated to the other replica.
If the two replicas are identical, then no changes will be reported.
If you see this message repeatedly, it may be because one of your machines
is getting its address from DHCP, which is causing its host name to change
between synchronizations. See the documentation for the UNISONLOCALHOSTNAME
environment variable for advice on how to correct this.
Donations to the Unison project are gratefully accepted:
http://www.cis.upenn.edu/~bcpierce/unison
message Unison 2.51.2 (ocaml 4.08.1): Contacting server...
Connected [//4bd40753d696//app_sync -> //K0529-171219.local/{docker-sync.yml root dir}/backend]
Looking for changes
Waiting for changes from server
Reconciling changes
Fatal error: Server: Fatal error during unmarshaling (input_value: ill-formed message),
possibly because client and server have been compiled with differentversions of the OCaml compiler.
success Unison server started
error Error starting sync, exit code 0
message Warning: No archive files were found for these roots, whose canonical names are:
{docker-sync.yml root dir}/backend
//4bd40753d696//app_sync
This can happen either
because this is the first time you have synchronized these roots,
or because you have upgraded Unison to a new version with a different
archive format.
Update detection may take a while on this run if the replicas are
large.
Unison will assume that the 'last synchronized state' of both replicas
was completely empty. This means that any files that are different
will be reported as conflicts, and any files that exist only on one
replica will be judged as new and propagated to the other replica.
If the two replicas are identical, then no changes will be reported.
If you see this message repeatedly, it may be because one of your machines
is getting its address from DHCP, which is causing its host name to change
between synchronizations. See the documentation for the UNISONLOCALHOSTNAME
environment variable for advice on how to correct this.
Donations to the Unison project are gratefully accepted:
http://www.cis.upenn.edu/~bcpierce/unison
message Unison 2.51.2 (ocaml 4.08.1): Contacting server...
Connected [//4bd40753d696//app_sync -> //K0529-171219.local/{docker-sync.yml root dir}/backend]
Looking for changes
Waiting for changes from server
Reconciling changes
Fatal error: Server: Fatal error during unmarshaling (input_value: ill-formed message),
possibly because client and server have been compiled with differentversions of the OCaml compiler.
success Starting Docker-Sync in the background
unison was installed with homebrew.
I would appreciate it very much if you could point out anything to me.
Fatal error: Server: Fatal error during unmarshaling (input_value: ill-formed message),
possibly because client and server have been compiled with differentversions of the OCaml compiler
https://unix.stackexchange.com/questions/309669/unison-fatal-error-during-unmarshaling
Most probably either the wrong unison package installed or the current one in homebrew is not compatible.
The release was adjusted very recently https://github.com/Homebrew/homebrew-core/blob/master/Formula/unison.rb
And there might be already an fix for that https://github.com/Homebrew/homebrew-core/blob/master/Formula/unison.rb#L18
maybe brew upgrade and test again.
Thanks, but the same error happened after even brew upgrade or downgrade....
I gave up unison at once and will switch to another sync strategy.
@endam well i cannot do anything about that right now - unison strategy being depenend on the "hosts unison" ( not dockerized ) and that adds an extra layer of complexity - this is one reason why we have chosen native_osx as the default ( there are more ). Unison and unox under OSX / brew tend to break more then once. Once it is some OCALM, then it's python madness, then something else.
I keep this issue open for anybody running into this issue with unison. I expect this to be resolved by homebrew "auotmatically" by fixing the build
Also experiencing the same problem. #688
Just to clear things up, is it docker-sync using 4.06.1 to compile? and brew using 4.08.1 to compile?
Edit: by docker-sync i mean the eugenmayer/unison Dockerfile
@JParkinson1991 docker sync does use the unison docker image at https://github.com/EugenMayer/docker-image-unison
https://github.com/EugenMayer/docker-image-unison/blob/master/Dockerfile#L5 and the unison version https://github.com/EugenMayer/docker-image-unison/blob/master/Dockerfile#L3
OCALM is picked from testing, so could be anything - but it is not rebuild all the time.
You can just try to rebuild the docker image locally using the right tag https://github.com/EugenMayer/docker-sync/blob/master/lib/docker-sync/sync_strategy/unison.rb#L25
eugenmayer/unison:2.51.2.1
docker build . -t eugenmayer/unison:2.51.2.1
And then test again. If that works we need to do that officially, release .2.51.2.2 with the updated OCALM version
I'll have a dig around today @EugenMayer
Im hoping doing a quick update of the ocaml version used to compile in the unison image should fix this. Looking at alpine packages it seems there default ocaml version is 4.08.1https://pkgs.alpinelinux.org/packages?name=ocaml&branch=edge so that should match the brew version.
Question though, why does this not affect native_osx? Both native_osx and unison syn strategies build ontop of the docker-image-unsion right?
native_osx does not use unison on the host ( OSX ) but rather osxfs and has no dependencies - unison is just used inside the container locally and thus is consistent in its build
I see, explains why there is no error. I wonder if it's worth (assuming the ocaml version bump fixes this) maintain both the unison image and the required host binary.
Bringing both 'in house' would eliminate these compiler mismatch errors etc.
Either way, ill take a look at rebuilding the image locally today and see where that gets me.
@EugenMayer
Managed to update the docker-image-unsion Dockefile to compile Unison with OCaml 4.08.1.
As suggested, tagged this locally with 2.51.2.2 and updated the unison.rb file in docker-sync gem to reference and all works absolutely fine!
Opened up a pull request for you to have a look at.
thank you for your work!
You do not need to match the unison.rb file yet in terms of using a custom image version, use the docker-sync.yml setting for that:
https://github.com/EugenMayer/docker-sync/blob/master/lib/docker-sync/sync_strategy/unison.rb#L23
https://docker-sync.readthedocs.io/en/latest/getting-started/configuration.html#references
options:
unison_image: 'eugenmayer/unison:2.51.2.2'
Beside that, it would make sense to patch the unsion.rb file for the next release - could you open a PR here to? Would be great!
I already build and published eugenmayer/unison:2.51.2.2 - would need some more testers before i can merge in the unison.rb PR though
That unsion_image configuration makes things alot easier for me and other mac users for the time being. Thanks for publishing the newly tagged image so quickly!
Ive opened the PR for the update to the default unison image, defeinitely needs more tests. https://github.com/EugenMayer/docker-sync/pull/689
Obviously the big one here is that Unison needs patching to be compiled with ocaml 4.08.1 but that shouldnt cause any problems for other operating systems.
will be fixed with 0.5.12
Guys this is great, thanks a lot for the time you put in docker-sync. But really, how should I upgrade please ? It's not clear to me... sorry!
@Benew
The updated unison image (OCAML 4.08.1 compatible) is now used by default in docker-sync core from version 0.5.13
Theres no need to change any options as detailed above, all you need to do is update the docker-sync gem.
gem update docker-sync
Hope that helps
@JParkinson1991 The update command didnt work with for me. I'm on macOS Catalina 10.15.3.

@inPhoenix working fine here, on same OS, can only assume this is a problem at your end and not with this package.
@inPhoenix - A coworker and I hit this today: on 10.15.3, unison up to date, all of that jazz. What we eventually found was unison in the existing sync containers was still on the old OCaml compiler.
Destroying the containers and letting docker-sync re-create them brought everything into unison (pun intended) and much joy was had.
I have same problem.
I get a temporary measure.
unison -version # => unison version 2.51.3.70 (ocaml 4.12.0)
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
git log unison.rb
git checkout 0edb12c144c6f64e6c35bdd4f6afb7d56d10bf60
brew uninstall unison
HOMEBREW_NO_AUTO_UPDATE=1 brew install unison
unison -version # => unison version 2.51.3 (ocaml 4.10.0)
it's worked docker-sync after executing the command.
@hibikiosawa4388 Thanks bro! You made my day!!!
@hibikiosawa4388 trying it today, but it not working anymore
$ HOMEBREW_NO_AUTO_UPDATE=1 brew install unison
Warning: Treating unison as a formula. For the cask, use homebrew/cask/unison
==> Downloading https://ghcr.io/v2/homebrew/core/unison/manifests/2.51.3
curl: (22) The requested URL returned error: 404
Error: Failed to download resource "unison_bottle_manifest"
Download failed: https://ghcr.io/v2/homebrew/core/unison/manifests/2.51.3
For temporary solution, I download unison v2.51.3 with ocaml-4.08.1 from https://github.com/bcpierce00/unison/releases/tag/v2.51.3 extract the content, and put the unison executable into bin folder in my home and use it for docker-sync.
For temporary solution, I download unison v2.51.3 with ocaml-4.08.1 from https://github.com/bcpierce00/unison/releases/tag/v2.51.3 extract the content, and put the unison executable into bin folder in my home and use it for docker-sync.
I did the process but still has the same issue when runnig "brew install Elixir" on Mac
@hanie21 I'm not using elixir so I guess that's is a different issues.
@EugenMayer Can you please provide new version for OCAML 4.12.0?
@artemsheludko1 if you like, run a PR for https://github.com/EugenMayer/docker-image-unison/issues/18 for that purpose - i cannot currently work on this myself but i can maintain PRs
@EugenMayer Unfortunately I am not very familiar with this stuff.
Most helpful comment
@endam well i cannot do anything about that right now - unison strategy being depenend on the "hosts unison" ( not dockerized ) and that adds an extra layer of complexity - this is one reason why we have chosen native_osx as the default ( there are more ). Unison and unox under OSX / brew tend to break more then once. Once it is some OCALM, then it's python madness, then something else.
I keep this issue open for anybody running into this issue with unison. I expect this to be resolved by homebrew "auotmatically" by fixing the build