balena cli unable to delpoy

Having issues with the CLI.
i’m with the latest CLI.
balena --version

12.43.2
obviously i have no connection issues.
PS D:\Dev\mobile-hardware\device> balena deploy milan-dev --debug
[debug] new argv=[C:\Program Files\balena-cli\client\bin\node.exe,C:\Program Files\balena-cli\client\bin\run,deploy,milan-dev] length=4
[Debug] Parsing input…
[Debug] Loading project…
[Debug] Resolving project…
[Debug] docker-compose.yml file found at “D:\Dev\mobile-hardware\device”
[Debug] Creating project…
[Info] Everything is up to date (use --build to force a rebuild)
[Info] Creating release…
[Error] Deploy failed
Oops something went wrong, please check your connection and try again.

Error: connect ETIMEDOUT 52.202.238.221:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16)
From previous event:
at processImmediate (internal/timers.js:461:21)
From previous event:
at Object.create (C:\Program Files\balena-cli\client\node_modules\balena-release\build\api.js:35:20)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async exports.createRelease (C:\Program Files\balena-cli\client\build\utils\compose.js:113:40)
at async deployProject (C:\Program Files\balena-cli\client\build\utils\compose_ts.js:722:20)
at async DeployCmd.deployProject (C:\Program Files\balena-cli\client\build\commands\deploy.js:142:27)
at async DeployCmd.run (C:\Program Files\balena-cli\client\build\commands\deploy.js:46:25)
at async DeployCmd._run (C:\Program Files\balena-cli\client\node_modules@oclif\command\lib\command.js:43:20)
at async Config.runCommand (C:\Program Files\balena-cli\client\node_modules@oclif\config\lib\config.js:175:24)
at async CustomMain.run (C:\Program Files\balena-cli\client\node_modules@oclif\command\lib\main.js:27:9)
at async CustomMain._run (C:\Program Files\balena-cli\client\node_modules@oclif\command\lib\command.js:43:20)
at async Promise.all (index 1)
at async oclifRun (C:\Program Files\balena-cli\client\build\app.js:75:5)
at async Object.run (C:\Program Files\balena-cli\client\build\app.js:88:9)

For further help or support, visit:

Hello, It looks like this problem is originating with either the network or our cloud builders. Is this still occurring?

yes it happens, sometimes it works when i switches networks but its not consitent.

It seems that the most likely explanation for this is a network issue. I’m not aware of any similar reports from other users. Are you able to try deploying a different application? It would be useful to see if this happens regardless of app, in order to rule out possibilities.

Unable to upload to different apps - tried to four other apps (test,dev,stage,prod)

Are those four apps all sharing the same project code? If so, I suggest creating a new app using a very simple project (e.g. linked below), and try deploying to that, to ensure that the issue is unrelated to the project.

my mistake, i did manage to deploy to stage now - and yes, they share same project code.

Right, in that case it would be good to test the control case (the simple project) to assist with diagnosis.

i’m not sure why now its working, but now same app that wasnt working before, is working now, i didnt change anythihg… even didnt close the powershell window that i was deploying from.

Everything seems to point to some kind of intermittent network issue. Let’s keep an eye on it. It might be worth trying the deploy from a different network (and maybe also a different computer), to rule out issues with local network, interfaces etc.

is there a way to reset things ? clear cache? i’m working most of the time on the same network and it really bothers the workflow.

Hi there, there are a couple CLI flags and commands you can try and see if it alleviates the problem (however based on the conversation so far the problem seems to be more related to a flaky network).

For your balena deploy command you can try:

  • adding the --no-cache flag, this will instruct docker to not use layer caching when building
  • adding the --build flag, this will force a rebuild before deploying

Another thing worth trying is to use balena push instead of balena deploy. This will build your project using our cloud builders (which are usually much faster). Push also accepts the --no-cache flag.