1

I am using the Mgt Development Environment (mgtcommerce/mgt-development-environment-5.6) on Windows 8.1. & DockerToolbox for Windows.

I also downloaded the proposed versions of OpenSSH & Unison from https://www.mgt-commerce.com/documentation/mgt-development-windows-file-synchronization and created the sync.bat as described.

Unfortunately Unison chrashes with the following error message:

Uncaught exception Failure("input_value: bad bigarray kind")
Raised by primitive operation at file "./remote.ml", line 453, characters 18-45
Called from file "./remote.ml", line 459, characters 23-61
Called from file "./lwt/lwt.ml", line 75, characters 20-23
Re-raised at file "./lwt/lwt.ml", line 135, characters 12-13
Called from file "list.ml", line 73, characters 12-15
Called from file "./lwt/lwt.ml", line 31, characters 2-37
Called from file "./lwt/lwt.ml", line 83, characters 17-46
Called from file "./lwt/win/lwt_unix_impl.ml", line 239, characters 6-40
Called from file "./uitext.ml", line 490, characters 2-113
Called from file "./uitext.ml", line 556, characters 38-66
Called from file "./uitext.ml", line 718, characters 6-47
Called from file "./uitext.ml", line 756, characters 6-125
Called from file "./uitext.ml", line 804, characters 8-47
Called from file "./uitext.ml", line 870, characters 21-43

It does work without problems:

  1. the first time unison is used for a docker image
  2. when using unison with the flag -ignorearchives

I read several articles and most of them come to the conclusion that this is an OCaml incompatibility problem.

How to fix this? Did someone else experience that error as well?

3
  • Yeah, I've seen this error with Unison before. And yeah there have been problems caused by using two different versions of OCaml to compile the Unison binaries on the syncing machines. Can you recompile Unison with matching versions of OCaml to see if this fixes the problem? Commented Jan 30, 2017 at 0:49
  • I was not able to fix this problem. It would be interesting if other users of above-mentioned docker image have the same problem as the author gives a good documentation what unison versions to use and I can't believe that they used wrong / different versions of OCaml. Btw: I can't even find out the OCaml-Version on above-mentioned docker-image
    – toasty
    Commented May 2, 2017 at 11:48
  • (the only reason could be that I use Windows 8.1. instead of Windows 10)
    – toasty
    Commented May 2, 2017 at 11:54

2 Answers 2

3

The error message "input_value: bad bigarray kind" indicates you're hitting a somewhat well-known bug in Unison.

Not only do the major versions of two Unison processes involved in a synchronization need to match (as you probably know), there was also an internal change in the OCaml libraries somewhere between OCaml versions 4.01 and 4.02, related to the marshaling of data. It's hard to give you a precise link, as some of Google's most promising results return an empty page, but I hope these will do:

https://github.com/bcpierce00/unison/issues/32 http://unison-users.yahoogroups.narkive.com/7FOa6VCg/re-unison-failed-uncaught-exception-failure-input-value-bad-bigarray-kind

Note especially on the page in the last link:

[...] this is a known issue, and happens because Unison wasn't compiled against the same OCaml versions [...]. The marshaling in OCaml 4.01 and 4.02 uses a different format... You will have to compile Unison 2.48.3 against the same versions of OCaml [...]

I sometimes run into this problem myself, and I circumvent it by compiling my own OCaml, Lablgtk for the graphical (GTK) interface, and Unison. I found compiling those to be quite straightforward under Linux (haven't tried on other operating systems).

1
  • Update: with more recent releases of Unison, it is possible to grab precompiled packages of Unison with a specific version of Ocaml built in, so there is no need to compile your own Ocaml.
    – Edward
    Commented Aug 14 at 7:18
1

At the end I was able to get the sync up & running with the following setup:

  • On Windows 10: use the unison-files provided by mgt-commerce.com - it is version 2.48.3 (but I don't know the OCaml-version used)
  • Within the docker image recompile unison with unison-sources 2.48.4 and OCaml version 4.01.0

Commands used within Dockerfile for this:

RUN apt-get update && apt-get install -y \
    ocaml \
    && curl -L https://github.com/bcpierce00/unison/archive/2.48.4.tar.gz | tar zxv -C /tmp && \
         cd /tmp/unison-2.48.4 && \
         sed -i -e 's/GLIBC_SUPPORT_INOTIFY 0/GLIBC_SUPPORT_INOTIFY 1/' src/fsmonitor/linux/inotify_stubs.c && \
         make && \
         cp src/unison src/unison-fsmonitor /usr/bin && \
         cd /root && rm -rf /tmp/unison-2.48.4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.