Balena preload fails on Windows

Running balena preload with --docker=//./pipe/docker_engine on Windows fails with the following error : Error starting daemon: error initializing graphdriver: driver not supported

Full log:

$ balena -v
11.14.0

$ DEBUG=1 balena preload balena.raspberrypi3-2.43.0+rev1.prod.img --docker=//./pipe/docker_engine -a myApp
[debug] original argv0="C:\Program Files\nodejs\node.exe" argv=[C:\Program Files\nodejs\node.exe,C:\Program Files\nodejs\node_modules\balena-cli\bin\balena,preload,balena.raspberrypi3-2.43.0+rev1.prod.img,--docker=//./pipe/docker_engine,-a,myApp] length=7
Building Docker preloader image. [===                     ] 12%
Step 1/7 : FROM docker:17.10.0-ce-dind
Building Docker preloader image. [======                  ] 25%
Step 2/7 : RUN apk update && apk add --no-cache python3 parted btrfs-progs docker util-linux sfdisk file coreutils sgdisk
 ---> Using cache
Building Docker preloader image. [=========               ] 37%
Step 3/7 : COPY ./requirements.txt /tmp/
 ---> Using cache
Building Docker preloader image. [============            ] 50%
Step 4/7 : RUN pip3 install -r /tmp/requirements.txt
 ---> Using cache
Building Docker preloader image. [===============         ] 62%
Step 5/7 : COPY ./src /usr/src/app
 ---> Using cache
Building Docker preloader image. [==================      ] 75%
Step 6/7 : WORKDIR /usr/src/app
 ---> Using cache
Building Docker preloader image. [=====================   ] 87%
Step 7/7 : CMD ["python3", "/usr/src/app/preload.py"]
 ---> Using cache
 ---> 72069d31b17b
Successfully built 72069d31b17b
Building Docker preloader image. [========================] 100%



| Creating preloader container
- Starting preloader container
| Fetching application myApp
\ Reading image informationWaiting for Docker to start...
- Reading image informationException in thread background thread for pid 113:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.6/site-packages/sh.py", line 1540, in wrap
    fn(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/sh.py", line 2459, in background_thread
    handle_exit_code(exit_code)
  File "/usr/lib/python3.6/site-packages/sh.py", line 2157, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/usr/lib/python3.6/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1:

  RAN: /usr/local/bin/dockerd --storage-driver=aufs --data-root=/tmp/tmp62t242yd/docker --host=tcp://0.0.0.0:52111

  STDOUT:


  STDERR:
time="2019-10-03T19:07:06.362177360Z" level=warning msg="[!] DON'T BIND ON ANY IP ADDRESS WITHOUT setting --tlsverify IF YOU DON'T KNOW WHAT YOU'RE DOING [!]"
time="2019-10-03T19:07:06.362982662Z" level=info msg="libcontainerd: new containerd process, pid: 126"
Error starting daemon: error initializing graphdriver: driver not supported


\ Reading image informationTraceback (most recent call last):
  File "/usr/src/app/preload.py", line 832, in <module>
    result = method(**data.get("parameters", {}))
  File "/usr/src/app/preload.py", line 791, in get_image_info
    images, supervisor_version = get_images_and_supervisor_version()
  File "/usr/src/app/preload.py", line 675, in get_images_and_supervisor_version
    return _get_images_and_supervisor_version()
  File "/usr/src/app/preload.py", line 646, in _get_images_and_supervisor_version
    with docker_context_manager(driver, mountpoint):
  File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__
    return next(self.gen)
  File "/usr/src/app/preload.py", line 513, in docker_context_manager
    running_dockerd = start_docker_daemon(storage_driver, docker_dir)
  File "/usr/src/app/preload.py", line 482, in start_docker_daemon
    running_dockerd.wait()
  File "/usr/lib/python3.6/site-packages/sh.py", line 792, in wait
    self.handle_command_exit_code(exit_code)
  File "/usr/lib/python3.6/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1:

  RAN: /usr/local/bin/dockerd --storage-driver=aufs --data-root=/tmp/tmp62t242yd/docker --host=tcp://0.0.0.0:52111

  STDOUT:


  STDERR:
time="2019-10-03T19:07:06.362177360Z" level=warning msg="[!] DON'T BIND ON ANY IP ADDRESS WITHOUT setting --tlsverify IF YOU DON'T KNOW WHAT YOU'RE DOING [!]"
time="2019-10-03T19:07:06.362982662Z" level=info msg="libcontainerd: new containerd process, pid: 126"
Error starting daemon: error initializing graphdriver: driver not supported

- Reading image information
Error: Step 1/7 : FROM docker:17.10.0-ce-dind
 ---> 9769e0f3f9cb
Step 2/7 : RUN apk update && apk add --no-cache python3 parted btrfs-progs docker util-linux sfdisk file coreutils sgdisk
 ---> Using cache
 ---> 2ce962d15739
Step 3/7 : COPY ./requirements.txt /tmp/
 ---> Using cache
 ---> 7393010a1975
Step 4/7 : RUN pip3 install -r /tmp/requirements.txt
 ---> Using cache
 ---> e06463e70254
Step 5/7 : COPY ./src /usr/src/app
 ---> Using cache
 ---> eda9f7b7fbd9
Step 6/7 : WORKDIR /usr/src/app
 ---> Using cache
 ---> 2b13e688f310
Step 7/7 : CMD ["python3", "/usr/src/app/preload.py"]
 ---> Using cache
 ---> 72069d31b17b
Successfully built 72069d31b17b
Successfully tagged balena/balena-preload:latest
Waiting for Docker to start...
Exception in thread background thread for pid 113:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.6/site-packages/sh.py", line 1540, in wrap
    fn(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/sh.py", line 2459, in background_thread
    handle_exit_code(exit_code)
  File "/usr/lib/python3.6/site-packages/sh.py", line 2157, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/usr/lib/python3.6/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /usr/local/bin/dockerd --storage-driver=aufs --data-root=/tmp/tmp62t242yd/docker --host=tcp://0.0.0.0:52111

  STDOUT:


  STDERR:
time="2019-10-03T19:07:06.362177360Z" level=warning msg="[!] DON'T BIND ON ANY IP ADDRESS WITHOUT setting --tlsverify IF YOU DON'T KNOW WHAT YOU'RE DOING [!]"
time="2019-10-03T19:07:06.362982662Z" level=info msg="libcontainerd: new containerd process, pid: 126"
Error starting daemon: error initializing graphdriver: driver not supported


Traceback (most recent call last):
  File "/usr/src/app/preload.py", line 832, in <module>
    result = method(**data.get("parameters", {}))
  File "/usr/src/app/preload.py", line 791, in get_image_info
    images, supervisor_version = get_images_and_supervisor_version()
  File "/usr/src/app/preload.py", line 675, in get_images_and_supervisor_version
    return _get_images_and_supervisor_version()
  File "/usr/src/app/preload.py", line 646, in _get_images_and_supervisor_version
    with docker_context_manager(driver, mountpoint):
  File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__
    return next(self.gen)
  File "/usr/src/app/preload.py", line 513, in docker_context_manager
    running_dockerd = start_docker_daemon(storage_driver, docker_dir)
  File "/usr/src/app/preload.py", line 482, in start_docker_daemon
    running_dockerd.wait()
  File "/usr/lib/python3.6/site-packages/sh.py", line 792, in wait
    self.handle_command_exit_code(exit_code)
  File "/usr/lib/python3.6/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /usr/local/bin/dockerd --storage-driver=aufs --data-root=/tmp/tmp62t242yd/docker --host=tcp://0.0.0.0:52111

  STDOUT:


  STDERR:
time="2019-10-03T19:07:06.362177360Z" level=warning msg="[!] DON'T BIND ON ANY IP ADDRESS WITHOUT setting --tlsverify IF YOU DON'T KNOW WHAT YOU'RE DOING [!]"
time="2019-10-03T19:07:06.362982662Z" level=info msg="libcontainerd: new containerd process, pid: 126"
Error starting daemon: error initializing graphdriver: driver not supported
    at C:\ProgramData\nvm\v12.7.0\node_modules\balena-cli\node_modules\balena-preload\lib\preload.js:317:19
    at tryCatcher (C:\ProgramData\nvm\v12.7.0\node_modules\balena-cli\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (C:\ProgramData\nvm\v12.7.0\node_modules\balena-cli\node_modules\bluebird\js\release\promise.js:517:31)
    at Promise._settlePromise (C:\ProgramData\nvm\v12.7.0\node_modules\balena-cli\node_modules\bluebird\js\release\promise.js:574:18)
    at Promise._settlePromise0 (C:\ProgramData\nvm\v12.7.0\node_modules\balena-cli\node_modules\bluebird\js\release\promise.js:619:10)
    at Promise._settlePromises (C:\ProgramData\nvm\v12.7.0\node_modules\balena-cli\node_modules\bluebird\js\release\promise.js:699:18)
    at _drainQueueStep (C:\ProgramData\nvm\v12.7.0\node_modules\balena-cli\node_modules\bluebird\js\release\async.js:138:12)
    at _drainQueue (C:\ProgramData\nvm\v12.7.0\node_modules\balena-cli\node_modules\bluebird\js\release\async.js:131:9)
    at Async._drainQueues (C:\ProgramData\nvm\v12.7.0\node_modules\balena-cli\node_modules\bluebird\js\release\async.js:147:5)
    at Immediate.Async.drainQueues [as _onImmediate] (C:\ProgramData\nvm\v12.7.0\node_modules\balena-cli\node_modules\bluebird\js\release\async.js:17:14)
    at processImmediate (internal/timers.js:439:21)
    at process.topLevelDomainCallback (domain.js:126:23)

If you need help, don't hesitate in contacting our support forums at
https://forums.balena.io

For bug reports or feature requests, have a look at the GitHub issues or
create a new one at: https://github.com/balena-io/balena-cli/issues/

| Reading image information(node:57892) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
\ Reading image information
1 Like

Hey @edorgeville,

This seems be because aufs support has been removed in docker for windows: https://github.com/boot2docker/boot2docker/issues/1326

There is an issue with a workaround here: https://github.com/balena-io/balena-cli/issues/1099

Thanks. Let me know if this gets fixed one day :wink: