Error deploying on Windows Server 2019

Hello to all,

I’m trying to deploy a balena app using balena-cli on a Windows Server 2021.

This is an already existent TFS build agent, so I cannot change the OS.

I installed docker for windows server and activated the LCOW support and it works.

But then I try to deply using the command:

balena deploy --build NAME

It works fine on windows 10 machines, but on the Windows Server 2019 BuildAgent it fails at the very end on the release creating phase saying:

[Error]   Deploy failed
failed to copy files: lstat /tmp/f5e8c233fd4cec54d2284ecce00cacedd95b6722d2ea7223c4b6c46a6348a79a-mount/src/CoreSystem: not a directory

Error: failed to copy files: lstat /tmp/f5e8c233fd4cec54d2284ecce00cacedd95b6722d2ea7223c4b6c46a6348a79a-mount/src/CoreSystem: not a directory
    at Stream.<anonymous> (C:\Program Files\balena-cli\client\node_modules\resin-docker-build\build\builder.js:181:23)
    at Stream.stream.write (C:\Program Files\balena-cli\client\node_modules\through\index.js:26:11)
    at Stream.ondata (internal/streams/legacy.js:19:31)
    at Stream.emit (events.js:314:20)
    at Stream.EventEmitter.emit (domain.js:483:12)
    at drain (C:\Program Files\balena-cli\client\node_modules\through\index.js:36:16)
    at Stream.stream.queue.stream.push (C:\Program Files\balena-cli\client\node_modules\through\index.js:45:5)
    at Parser.parser.onToken (C:\Program Files\balena-cli\client\node_modules\JSONStream\index.js:132:18)
    at Parser.proto.write (C:\Program Files\balena-cli\client\node_modules\jsonparse\jsonparse.js:135:34)
    at Stream.<anonymous> (C:\Program Files\balena-cli\client\node_modules\JSONStream\index.js:23:12)
    at Stream.stream.write (C:\Program Files\balena-cli\client\node_modules\through\index.js:26:11)
    at IncomingMessage.ondata (_stream_readable.js:718:22)
    at IncomingMessage.emit (events.js:314:20)
    at IncomingMessage.EventEmitter.emit (domain.js:483:12)
    at addChunk (_stream_readable.js:297:12)
    at readableAddChunk (_stream_readable.js:272:9)
From previous event:
    at C:\Program Files\balena-cli\client\node_modules\resin-docker-build\build\builder.js:73:20
    at processImmediate (internal/timers.js:461:21)
From previous event:
    at Builder.createBuildStream (C:\Program Files\balena-cli\client\node_modules\resin-docker-build\build\builder.js:72:97)
    at C:\Program Files\balena-cli\client\node_modules\resin-multibuild\build\build.js:89:21
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

I cannot figure out what’s missing on this system to work, or if are there any critical issue that makes it impossibile to work.

In particular I couldn’t find anything on the “Not a directory” error.

I use docker version 19.03.5 (It seems that later versions broke the LCOW compatibility)

Balena-cli version is 12.50.2

Thank you very much for the support.

Hello @MaxFerretti78 thanks for reporting this, i will ping the balena CLI team to see how we can help you more.

To try to simplify the issue, did you try to do balena deploy on another Windows desktop machine using the same cli/docker versions? Do you get the same result?

at Stream.<anonymous> (C:\Program Files\balena-cli\client\node_modules\resin-docker-build\build\builder.js:181:23)

I gather that builder.js:181 maps to builder.ts:254, the following line: resin-docker-build/builder.ts at v1.1.6 · balena-io-modules/resin-docker-build · GitHub

So the error comes from Docker, after the balena CLI handed over the build context tar stream. I think the balance of probabilities leans towards this being a Docker bug or installation issue, maybe filesystem permissions. How about removing all images and reinstalling Docker?

Another interesting test would be to run docker build --no-cache (or docker-compose build --no-cache) without the balena CLI. Just for debugging purposes, amend your Dockerfile or docker-compose.yml to remove any balena-specific syntax (like % variables – rename Dockerfile.template to Dockerfile). If the error still happens, this would help isolate the issue as being with Docker, or with the balena CLI.

Hello @MaxFerretti78 did this work for you?

Let us know how we can help you more!

Hello,
thank you for the suggestions, I had no luck so far with Windows Server 2019.
But now we agreed to switch to a Windows 10 BuildAgent, so it should be more straight forward.

1 Like

Thanks for the update @MaxFerretti78

Let us know if we can help you more!