Problems doing a 'balena push' (free tier)

I’m using the Balena free tier to develop an app which uses a RPi to present a web UI for sending commands over USB to modelling guitar amplifiers from the Fender Mustang LT series (project outline page is work in progress but visible at https://docs.google.com/document/d/16ZGsf0yGLheq5xF0jEiFNVfTS9s3KD7a81lxxmo3TtA/edit?usp=sharing).

For the last couple of weeks I’ve had some problems running the ‘balena push’ command - to send updates of the project for building - its been failing about 30-50% of the time, but usually works on a second or third attempt, especially if I add –debug to the command line.

Today, since about for about an hour before sending this post, it just wasn’t working at all for about an hour (just came back as I finished writing this up).

With the –debug command line, the balena CLI output typically looks like this:

balena push --debug --draft --source deployment/balena fhau-staging
[debug] new argv=[/home/tim/Applications/balena/bin/node,/home/tim/Applications/balena/bin/run,push,–draft,–source,deployment/balena,fhau-staging] length=7
[debug] Deprecation check: 6.08736 days since last npm registry query for next major version release date.
[debug] Will not query the registry again until at least 7 days have passed.
[Debug] Using build source directory: deployment/balena
[Debug] Pushing to cloud for fleet: fhau-staging
[debug] Event tracking error: Timeout awaiting ‘response’ for 0ms
| Packaging the project source…[Debug] Tarring all non-ignored files…
/ Packaging the project source…[Debug] docker-compose.yml file found at “/home/tim/github/maneline/deployment/balena”
Packaging the project source…[Debug] Tarring complete in 221 ms
[debug] Connecting to builder at https://builder.balena-cloud.com/v3/build?slug=gh_tim_littlefair%2Ffhau-staging&dockerfilePath=&emulated=false&nocache=false&headless=false&isdraft=true
Oops something went wrong, please check your connection and try again.

RequestError
at ClientRequest. (/home/tim/Applications/balena/node_modules/got/dist/source/core/index.js:970:111)
at Object.onceWrapper (node:events:633:26)
at ClientRequest.emit (node:events:530:35)
at origin.emit (/home/tim/Applications/balena/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
at emitErrorEvent (node:_http_client:104:11)
at TLSSocket.socketErrorListener (node:_http_client:518:5)
at TLSSocket.emit (node:events:518:28)
at emitErrorNT (node:internal/streams/destroy:170:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21)AggregateError [ETIMEDOUT]:
at internalConnectMultiple (node:net:1139:18)
at internalConnectMultiple (node:net:1215:5)
at Timeout.internalConnectMultipleTimeout (node:net:1741:5)
at listOnTimeout (node:internal/timers:590:11)
at process.processTimers (node:internal/timers:523:7)

I am conscious that I’ve been using Balena’s services fairly intensively (3-20 pushes per day over the recent period), and as a free tier user working on an hobby-related app which is never going to give rise to a fleet of tens or hundreds of devices or evolve into a product/service for which Balena’s paid tiers would be relevant, I understand that there may be some degree of throttling in place to prevent excessive use, but if my experience is due to CPU cycle rationing it would be good to have a hint of how long I should pause for before trying again.

I’ve enabled support access to the fleet in case anyone within Balena wants to look at it, but for now it seems to be working again.

Hello @tim-littlefair,

We opened Incident: Builder partially degraded service. It’s current status is Monitoring: A fix has been implemented and we are monitoring the results. So it is not fully resolved. But it would be helpful to know - are you still experiencing the issue?

Thanks for looking at this.
I’ve broken my deploy script at the moment, but once I’ve fixed it I’ll
do a test push, and a couple more later in the (Australian, UTC+8) day.

I’ll let you know how I go.

My first attempt after (hopefully) fixing the deploy script failed a few seconds ago like the ones I’ve had over the last week or two:

balena push --debug --draft --source _work/balena_fakeroot-0.2.0+beta0026.33f6945.2 fhau-staging
[debug] new argv=[/home/tim/Applications/balena/bin/node,/home/tim/Applications/balena/bin/run,push,--draft,--source,_work/balena_fakeroot-0.2.0+beta0026.33f6945.2,fhau-staging] length=7
[debug] Deprecation check: 0.72311 days since last npm registry query for next major version release date.
[debug] Will not query the registry again until at least 7 days have passed.
[Debug]   Using build source directory: _work/balena_fakeroot-0.2.0+beta0026.33f6945.2 
[Debug]   Pushing to cloud for fleet: fhau-staging
[debug] Event tracking error: Timeout awaiting 'response' for 0ms
| Packaging the project source...[Debug]   Tarring all non-ignored files...
/ Packaging the project source...[Debug]   docker-compose.yml file found at "/home/tim/github/maneline/_work/balena_fakeroot-0.2.0+beta0026.33f6945.2"
- Packaging the project source...[Debug]   Tarring complete in 227 ms
[debug] Connecting to builder at https://builder.balena-cloud.com/v3/build?slug=gh_tim_littlefair%2Ffhau-staging&dockerfilePath=&emulated=false&nocache=false&headless=false&isdraft=true
Oops something went wrong, please check your connection and try again.

RequestError
    at ClientRequest.<anonymous> (/home/tim/Applications/balena/node_modules/got/dist/source/core/index.js:970:111)
    at Object.onceWrapper (node:events:633:26)
    at ClientRequest.emit (node:events:530:35)
    at origin.emit (/home/tim/Applications/balena/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
    at emitErrorEvent (node:_http_client:104:11)
    at TLSSocket.socketErrorListener (node:_http_client:518:5)
    at TLSSocket.emit (node:events:518:28)
    at emitErrorNT (node:internal/streams/destroy:170:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)AggregateError [ETIMEDOUT]: 
    at internalConnectMultiple (node:net:1139:18)
    at internalConnectMultiple (node:net:1215:5)
    at Timeout.internalConnectMultipleTimeout (node:net:1741:5)
    at listOnTimeout (node:internal/timers:590:11)
    at process.processTimers (node:internal/timers:523:7)

For further help or support, visit:
https://www.balena.io/docs/reference/balena-cli/#support-faq-and-troubleshooting


It could be a problem with the state of the directory I’m deploying from - I’ve been modifying the script to gather subdirectories and files scattered across a repo where balena is sharing resources with other deployment styles and I don’t want to tar the whole thing, before yesterday it was using symlinks instead of gathering a disposable root. But the changes to the script are only yesterday and today and it has been working about 50% of the time over the last week or so.

4th attempt is working - this time I left the –debug flag off.

Failed due to an error on my part in the Dockerfile will fix that and try again.

After fixing the Dockerfile, the first attempt failed, then the second completed.

[maneline-web]  Successfully built 10563eee0d58
[Info]          Uploading images
[Success]       Successfully uploaded images
[Info]          Built on 4b2d7d0
[Success]       Release successfully created!
[Info]          Release: bc6d4646a39691d1568207ab1c2ff566 (id: 3669717)

The failed run doesn’t have any useful diagnostic as I didn’t have –debug turned on.

Anyway, thanks for looking at this, I’ll do a few more pushes later in the day (when the repo is in a better state than it is right now), and I’ll report back with a summary of successes and failures.

I should note that I’m running with outdated version 22.1.1 of the Balena CLI, so I’ll update that too before doing any more pushes.

I’ve updated CLI and done a few more pushes, no luck.

This is the log for the most recent (with timestamps before and after in case that helps)

tim@tim-OptiPlex-7450-AIO:~/github/maneline$ date --utc
Wed 17 Sep 2025 14:52:40 UTC
tim@tim-OptiPlex-7450-AIO:~/github/maneline$ time scripts/build_release.sh --deploy-balena-beta --remove-stale-fakeroot --fhau-staging --debug 
buildString=0.2.0+beta0027.204c009.2
buildGitRef=#204c009 + changes to: build_release.sh rebuild_sdk.sh
buildAndroidVersionCode=2000027
Balena already logged in
Removing stale directory _work/balena_fakeroot-0.2.0+beta0027.204c009.2
Stale directory removed
Building deployment root at _work/balena_fakeroot-0.2.0+beta0027.204c009.2
Files copied to _work/balena_fakeroot-0.2.0+beta0027.204c009.2
Remaining arguments: --fhau-staging --debug
Will deploy to fhau-staging
balena push --debug --draft --source _work/balena_fakeroot-0.2.0+beta0027.204c009.2 fhau-staging
[debug] new argv=[/home/tim/github/maneline-sdk-250917m/balena-v22.4.4-linux/bin/node,/home/tim/github/maneline-sdk-250917m/balena-v22.4.4-linux/bin/run,push,--draft,--source,_work/balena_fakeroot-0.2.0+beta0027.204c009.2,fhau-staging] length=7
[debug] Deprecation check: 1.28519 days since last npm registry query for next major version release date.
[debug] Will not query the registry again until at least 7 days have passed.
[Debug]   Using build source directory: _work/balena_fakeroot-0.2.0+beta0027.204c009.2 
[Debug]   Pushing to cloud for fleet: fhau-staging
[debug] Event tracking error: Timeout awaiting 'response' for 0ms
| Packaging the project source...[Debug]   Tarring all non-ignored files...
/ Packaging the project source...[Debug]   docker-compose.yml file found at "/home/tim/github/maneline/_work/balena_fakeroot-0.2.0+beta0027.204c009.2"
- Packaging the project source...[Debug]   Tarring complete in 265 ms
[debug] Connecting to builder at https://builder.balena-cloud.com/v3/build?slug=gh_tim_littlefair%2Ffhau-staging&dockerfilePath=&emulated=false&nocache=false&headless=false&isdraft=true
Oops something went wrong, please check your connection and try again.

RequestError
    at ClientRequest.<anonymous> (/home/tim/github/maneline-sdk-250917m/balena-v22.4.4-linux/node_modules/got/dist/source/core/index.js:970:111)
    at Object.onceWrapper (node:events:634:26)
    at ClientRequest.emit (node:events:531:35)
    at origin.emit (/home/tim/github/maneline-sdk-250917m/balena-v22.4.4-linux/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
    at emitErrorEvent (node:_http_client:105:11)
    at TLSSocket.socketErrorListener (node:_http_client:518:5)
    at TLSSocket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:170:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)AggregateError [ETIMEDOUT]: 
    at internalConnectMultiple (node:net:1134:18)
    at internalConnectMultiple (node:net:1210:5)
    at Timeout.internalConnectMultipleTimeout (node:net:1742:5)
    at listOnTimeout (node:internal/timers:590:11)
    at process.processTimers (node:internal/timers:523:7)

For further help or support, visit:
https://www.balena.io/docs/reference/balena-cli/#support-faq-and-troubleshooting



real    0m2.786s
user    0m0.960s
sys     0m0.214s
tim@tim-OptiPlex-7450-AIO:~/github/maneline$ date --utc
Wed 17 Sep 2025 14:52:54 UTC
tim@tim-OptiPlex-7450-AIO:~/github/maneline$ 

Apologies for not reporting back on this earlier. I got 4 successful pushes in a row on Friday (2 with CLI version 22.4.4, 2 more with 22.4.6). I had one failed build today, but I noticed that the CLI had been updated again and when I came up to 22.4.7 the push worked first time. I’ll leave it a couple of days before doing the ‘my question has been answered’ workflow, but providing I don’t get any more runs of failures I’ll do that before the end of the week.

I’m having problems again, and this time they seem to be occurring 100% of the time.

I’ve upgraded to to CLI 2.4.15, this didn’t fix the problem, but it did give me a debug stack trace which contained file/line number in the JS/node module source where the error was raised and handled - not sure if this change is intended or raises security concerns for Balena, but with the extra information I hacked in a small change to the Javascript to see if more detail helps.

The first push after I installed the new CLI returned this error trace:

balena push --debug --source _work/balena_fakeroot-0.2.0+beta0051.9646bea.2 fhau-staging
[debug] new argv=[/home/tim/github/ml-sdk-251022a/balena-22.4.15/bin/node,/home/tim/github/ml-sdk-251022a/balena-22.4.15/bin/run,push,--source,_work/balena_fakeroot-0.2.0+beta0051.9646bea.2,fhau-staging] length=6
[debug] Deprecation check: 6.24772 days since last npm registry query for next major version release date.
[debug] Will not query the registry again until at least 7 days have passed.
[Debug]   Using build source directory: _work/balena_fakeroot-0.2.0+beta0051.9646bea.2 
[Debug]   Pushing to cloud for fleet: fhau-staging
[debug] Event tracking error: Timeout awaiting 'response' for 0ms
| Packaging the project source...[Debug]   Tarring all non-ignored files...
/ Packaging the project source...[Debug]   docker-compose.yml file found at "/home/tim/github/maneline/_work/balena_fakeroot-0.2.0+beta0051.9646bea.2"
| Packaging the project source...[Debug]   Tarring complete in 452 ms
[debug] Connecting to builder at https://builder.balena-cloud.com/v3/build?slug=gh_tim_littlefair%2Ffhau-staging&dockerfilePath=&emulated=false&nocache=false&headless=false&isdraft=false
Oops something went wrong, please check your connection and try again.

RequestError
    at ClientRequest.<anonymous> (/home/tim/github/ml-sdk-251022a/balena-22.4.15/node_modules/got/dist/source/core/index.js:970:111)
    at Object.onceWrapper (node:events:634:26)
    at ClientRequest.emit (node:events:531:35)
    at origin.emit (/home/tim/github/ml-sdk-251022a/balena-22.4.15/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
    at emitErrorEvent (node:_http_client:107:11)
    at TLSSocket.socketErrorListener (node:_http_client:574:5)
    at TLSSocket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:170:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)AggregateError [ETIMEDOUT]: 
    at internalConnectMultiple (node:net:1134:18)
    at internalConnectMultiple (node:net:1210:5)
    at Timeout.internalConnectMultipleTimeout (node:net:1742:5)
    at listOnTimeout (node:internal/timers:590:11)
    at process.processTimers (node:internal/timers:523:7)

I modified the file /home/tim/github/ml-sdk-251022a/balena-22.4.15/node_modules/@szmarczak/http-timer/dist/source/index.js around line 43 so it looks like this:

    const handleError = (origin) => {
        const emit = origin.emit.bind(origin);
        origin.emit = (event, ...args) => {
            console.log("in origin.emit"); //TL
            // Catches the `error` event
            if (event === 'error') {
                console.log("event==='error'"); //TL
                timings.error = Date.now();
                timings.phases.total = timings.error - timings.start;
                origin.emit = emit;
                console.log("timings:"); //TL
                console.log(timings); //TL
                console.log("origin:"); //TL
                console.log(origin); //TL                
            }
            console.log("returning 'emit'"); //TL
            // Saves the original behavior
            return emit(event, ...args);
        };
    };

With this version, I can see the content of the ‘timings’ and ‘origin’ objects. ‘origin’ contains about 1k lines of data including multiple mentions of authorization data from my balena CLI login session so I’ve redacted it but I’m happy to email a copy to anyone at Balena who wants to see it. The redacted output with the hacked javascript looks like this:

tim@tim-OptiPlex-7450-AIO:~/github/maneline$ time scripts/build_release.sh --deploy-balena-beta --remove-stale-fakeroot --fhau-staging --debug
buildString=0.2.0+beta0051.9646bea.2
buildGitRef=#9646bea + changes to: build_release.sh rebuild_sdk.sh
buildAndroidVersionCode=2000051
Balena already logged in
Removing stale directory _work/balena_fakeroot-0.2.0+beta0051.9646bea.2
Stale directory removed
Building deployment root at _work/balena_fakeroot-0.2.0+beta0051.9646bea.2
Files copied to _work/balena_fakeroot-0.2.0+beta0051.9646bea.2
Remaining arguments: --fhau-staging --debug
Will deploy to fhau-staging
balena push --debug --source _work/balena_fakeroot-0.2.0+beta0051.9646bea.2 fhau-staging
[debug] new argv=[/home/tim/github/ml-sdk-251022a/balena-22.4.15/bin/node,/home/tim/github/ml-sdk-251022a/balena-22.4.15/bin/run,push,--source,_work/balena_fakeroot-0.2.0+beta0051.9646bea.2,fhau-staging] length=6
[debug] Deprecation check: 6.27001 days since last npm registry query for next major version release date.
[debug] Will not query the registry again until at least 7 days have passed.
[Debug]   Using build source directory: _work/balena_fakeroot-0.2.0+beta0051.9646bea.2 
in origin.emit
returning 'emit'
in origin.emit
returning 'emit'
[Debug]   Pushing to cloud for fleet: fhau-staging
in origin.emit
returning 'emit'
in origin.emit
returning 'emit'
in origin.emit
event==='error'
timings:
{
  start: 1761120149057,
  socket: 1761120149060,
  lookup: 1761120149090,
  connect: 1761120149098,
  secureConnect: 1761120149109,
  upload: 1761120149110,
  response: undefined,
  end: undefined,
  error: 1761120149114,
  abort: undefined,
  phases: {
    wait: 3,
    dns: 30,
    tcp: 8,
    tls: 11,
    request: 1,
    firstByte: undefined,
    download: undefined,
    total: 57
  }
}
origin:
** redacted **
returning 'emit'
Oops something went wrong, please check your connection and try again.

RequestError
    at ClientRequest.<anonymous> (/home/tim/github/ml-sdk-251022a/balena-22.4.15/node_modules/got/dist/source/core/index.js:970:111)
    at Object.onceWrapper (node:events:634:26)
    at ClientRequest.emit (node:events:531:35)
    at origin.emit (/home/tim/github/ml-sdk-251022a/balena-22.4.15/node_modules/@szmarczak/http-timer/dist/source/index.js:50:20)
    at emitErrorEvent (node:_http_client:107:11)
    at TLSSocket.socketErrorListener (node:_http_client:574:5)
    at TLSSocket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:170:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)AggregateError [ETIMEDOUT]: 
    at internalConnectMultiple (node:net:1134:18)
    at internalConnectMultiple (node:net:1210:5)
    at Timeout.internalConnectMultipleTimeout (node:net:1742:5)
    at listOnTimeout (node:internal/timers:590:11)
    at process.processTimers (node:internal/timers:523:7)

For further help or support, visit:
https://www.balena.io/docs/reference/balena-cli/#support-faq-and-troubleshooting

If I comment out the line which dumps the ‘origin’ object, it looks like there are two separate errors being handled with different combinations of populated items in the ‘timings’ object


buildString=0.2.0+beta0051.9646bea.2
buildGitRef=#9646bea + changes to: build_release.sh rebuild_sdk.sh
buildAndroidVersionCode=2000051
Balena already logged in
Removing stale directory _work/balena_fakeroot-0.2.0+beta0051.9646bea.2
Stale directory removed
Building deployment root at _work/balena_fakeroot-0.2.0+beta0051.9646bea.2
Files copied to _work/balena_fakeroot-0.2.0+beta0051.9646bea.2
Remaining arguments: --fhau-staging --debug
Will deploy to fhau-staging
balena push --debug --source _work/balena_fakeroot-0.2.0+beta0051.9646bea.2 fhau-staging
[debug] new argv=[/home/tim/github/ml-sdk-251022a/balena-22.4.15/bin/node,/home/tim/github/ml-sdk-251022a/balena-22.4.15/bin/run,push,--source,_work/balena_fakeroot-0.2.0+beta0051.9646bea.2,fhau-staging] length=6
[debug] Deprecation check: 6.28456 days since last npm registry query for next major version release date.
[debug] Will not query the registry again until at least 7 days have passed.
[Debug]   Using build source directory: _work/balena_fakeroot-0.2.0+beta0051.9646bea.2 
in origin.emit
returning 'emit'
in origin.emit
returning 'emit'
[Debug]   Pushing to cloud for fleet: fhau-staging
in origin.emit
returning 'emit'
in origin.emit
returning 'emit'
in origin.emit
event==='error'
timings:
{
  start: 1761121406140,
  socket: 1761121406143,
  lookup: 1761121406166,
  connect: 1761121406173,
  secureConnect: 1761121406186,
  upload: 1761121406187,
  response: undefined,
  end: undefined,
  error: 1761121406191,
  abort: undefined,
  phases: {
    wait: 3,
    dns: 23,
    tcp: 7,
    tls: 13,
    request: 1,
    firstByte: undefined,
    download: undefined,
    total: 51
  }
}
origin:
returning 'emit'
[debug] Event tracking error: Timeout awaiting 'response' for 0ms
| Packaging the project source...[Debug]   Tarring all non-ignored files...
/ Packaging the project source...[Debug]   docker-compose.yml file found at "/home/tim/github/maneline/_work/balena_fakeroot-0.2.0+beta0051.9646bea.2"
| Packaging the project source...[Debug]   Tarring complete in 465 ms
[debug] Connecting to builder at https://builder.balena-cloud.com/v3/build?slug=gh_tim_littlefair%2Ffhau-staging&dockerfilePath=&emulated=false&nocache=false&headless=false&isdraft=false
in origin.emit
returning 'emit'
/ Uploading source package to https://builder.balena-cloud.comin origin.emit
event==='error'
timings:
{
  start: 1761121407552,
  socket: 1761121407554,
  lookup: 1761121407623,
  connect: undefined,
  secureConnect: undefined,
  upload: undefined,
  response: undefined,
  end: undefined,
  error: 1761121408128,
  abort: undefined,
  phases: {
    wait: 2,
    dns: 69,
    tcp: undefined,
    tls: undefined,
    request: undefined,
    firstByte: undefined,
    download: undefined,
    total: 576
  }
}
origin:
returning 'emit'
Oops something went wrong, please check your connection and try again.

RequestError
    at ClientRequest.<anonymous> (/home/tim/github/ml-sdk-251022a/balena-22.4.15/node_modules/got/dist/source/core/index.js:970:111)
    at Object.onceWrapper (node:events:634:26)
    at ClientRequest.emit (node:events:531:35)
    at origin.emit (/home/tim/github/ml-sdk-251022a/balena-22.4.15/node_modules/@szmarczak/http-timer/dist/source/index.js:50:20)
    at emitErrorEvent (node:_http_client:107:11)
    at TLSSocket.socketErrorListener (node:_http_client:574:5)
    at TLSSocket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:170:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)AggregateError [ETIMEDOUT]: 
    at internalConnectMultiple (node:net:1134:18)
    at internalConnectMultiple (node:net:1210:5)
    at Timeout.internalConnectMultipleTimeout (node:net:1742:5)
    at listOnTimeout (node:internal/timers:590:11)
    at process.processTimers (node:internal/timers:523:7)

For further help or support, visit:
https://www.balena.io/docs/reference/balena-cli/#support-faq-and-troubleshooting



real    0m3.555s
user    0m1.391s
sys     0m0.407s
tim@tim-OptiPlex-7450-AIO:~/github/maneline$ 



I’d be very grateful if someone could take a look at this, as presently I can’t push by project using the CLI at all (going to have a try using the git method when I finish this comment).

Should just comment that I am based in Perth, Western Australia, in case this is a resource/timing issue related to how much CPU capacity is provisioned in different cloud regions.

I’m having problems again, and this time they seem to be occurring 100% of the time.

I’ve upgraded to to CLI 2.4.15, this didn’t fix the problem, but it did give me a debug stack trace which contained file/line number in the JS/node module source where the error was raised and handled - not sure if this change is intended or raises security concerns for Balena, but with the extra information I hacked in a small change to the Javascript to see if more detail helps.

The first push after I installed the new CLI returned this error trace:

balena push --debug --source _work/balena_fakeroot-0.2.0+beta0051.9646bea.2 fhau-staging
[debug] new argv=[/home/tim/github/ml-sdk-251022a/balena-22.4.15/bin/node,/home/tim/github/ml-sdk-251022a/balena-22.4.15/bin/run,push,--source,_work/balena_fakeroot-0.2.0+beta0051.9646bea.2,fhau-staging] length=6
[debug] Deprecation check: 6.24772 days since last npm registry query for next major version release date.
[debug] Will not query the registry again until at least 7 days have passed.
[Debug]   Using build source directory: _work/balena_fakeroot-0.2.0+beta0051.9646bea.2 
[Debug]   Pushing to cloud for fleet: fhau-staging
[debug] Event tracking error: Timeout awaiting 'response' for 0ms
| Packaging the project source...[Debug]   Tarring all non-ignored files...
/ Packaging the project source...[Debug]   docker-compose.yml file found at "/home/tim/github/maneline/_work/balena_fakeroot-0.2.0+beta0051.9646bea.2"
| Packaging the project source...[Debug]   Tarring complete in 452 ms
[debug] Connecting to builder at https://builder.balena-cloud.com/v3/build?slug=gh_tim_littlefair%2Ffhau-staging&dockerfilePath=&emulated=false&nocache=false&headless=false&isdraft=false
Oops something went wrong, please check your connection and try again.

RequestError
    at ClientRequest.<anonymous> (/home/tim/github/ml-sdk-251022a/balena-22.4.15/node_modules/got/dist/source/core/index.js:970:111)
    at Object.onceWrapper (node:events:634:26)
    at ClientRequest.emit (node:events:531:35)
    at origin.emit (/home/tim/github/ml-sdk-251022a/balena-22.4.15/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
    at emitErrorEvent (node:_http_client:107:11)
    at TLSSocket.socketErrorListener (node:_http_client:574:5)
    at TLSSocket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:170:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)AggregateError [ETIMEDOUT]: 
    at internalConnectMultiple (node:net:1134:18)
    at internalConnectMultiple (node:net:1210:5)
    at Timeout.internalConnectMultipleTimeout (node:net:1742:5)
    at listOnTimeout (node:internal/timers:590:11)
    at process.processTimers (node:internal/timers:523:7)

I modified the file /home/tim/github/ml-sdk-251022a/balena-22.4.15/node_modules/@szmarczakszmarczakszmarczakszmarczakszmarczakszmarczakszmarczakszmarczak/http-timer/dist/source/index.js around line 43 so it looks like this:

    const handleError = (origin) => {
        const emit = origin.emit.bind(origin);
        origin.emit = (event, ...args) => {
            console.log("in origin.emit"); //TL
            // Catches the `error` event
            if (event === 'error') {
                console.log("event==='error'"); //TL
                timings.error = Date.now();
                timings.phases.total = timings.error - timings.start;
                origin.emit = emit;
                console.log("timings:"); //TL
                console.log(timings); //TL
                console.log("origin:"); //TL
                console.log(origin); //TL                
            }
            console.log("returning 'emit'"); //TL
            // Saves the original behavior
            return emit(event, ...args);
        };
    };

With this version, I can see the content of the ‘timings’ and ‘origin’ objects. ‘origin’ contains about 1k lines of data including multiple mentions of authorization data from my balena CLI login session so I’ve redacted it but I’m happy to email a copy to anyone at Balena who wants to see it. The redacted output with the hacked javascript looks like this:

tim@tim-OptiPlex-7450-AIO:~/github/maneline$ time scripts/build_release.sh --deploy-balena-beta --remove-stale-fakeroot --fhau-staging --debug
buildString=0.2.0+beta0051.9646bea.2
buildGitRef=#9646bea + changes to: build_release.sh rebuild_sdk.sh
buildAndroidVersionCode=2000051
Balena already logged in
Removing stale directory _work/balena_fakeroot-0.2.0+beta0051.9646bea.2
Stale directory removed
Building deployment root at _work/balena_fakeroot-0.2.0+beta0051.9646bea.2
Files copied to _work/balena_fakeroot-0.2.0+beta0051.9646bea.2
Remaining arguments: --fhau-staging --debug
Will deploy to fhau-staging
balena push --debug --source _work/balena_fakeroot-0.2.0+beta0051.9646bea.2 fhau-staging
[debug] new argv=[/home/tim/github/ml-sdk-251022a/balena-22.4.15/bin/node,/home/tim/github/ml-sdk-251022a/balena-22.4.15/bin/run,push,--source,_work/balena_fakeroot-0.2.0+beta0051.9646bea.2,fhau-staging] length=6
[debug] Deprecation check: 6.27001 days since last npm registry query for next major version release date.
[debug] Will not query the registry again until at least 7 days have passed.
[Debug]   Using build source directory: _work/balena_fakeroot-0.2.0+beta0051.9646bea.2 
in origin.emit
returning 'emit'
in origin.emit
returning 'emit'
[Debug]   Pushing to cloud for fleet: fhau-staging
in origin.emit
returning 'emit'
in origin.emit
returning 'emit'
in origin.emit
event==='error'
timings:
{
  start: 1761120149057,
  socket: 1761120149060,
  lookup: 1761120149090,
  connect: 1761120149098,
  secureConnect: 1761120149109,
  upload: 1761120149110,
  response: undefined,
  end: undefined,
  error: 1761120149114,
  abort: undefined,
  phases: {
    wait: 3,
    dns: 30,
    tcp: 8,
    tls: 11,
    request: 1,
    firstByte: undefined,
    download: undefined,
    total: 57
  }
}
origin:
** redacted **
returning 'emit'
Oops something went wrong, please check your connection and try again.

RequestError
    at ClientRequest.<anonymous> (/home/tim/github/ml-sdk-251022a/balena-22.4.15/node_modules/got/dist/source/core/index.js:970:111)
    at Object.onceWrapper (node:events:634:26)
    at ClientRequest.emit (node:events:531:35)
    at origin.emit (/home/tim/github/ml-sdk-251022a/balena-22.4.15/node_modules/@szmarczak/http-timer/dist/source/index.js:50:20)
    at emitErrorEvent (node:_http_client:107:11)
    at TLSSocket.socketErrorListener (node:_http_client:574:5)
    at TLSSocket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:170:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)AggregateError [ETIMEDOUT]: 
    at internalConnectMultiple (node:net:1134:18)
    at internalConnectMultiple (node:net:1210:5)
    at Timeout.internalConnectMultipleTimeout (node:net:1742:5)
    at listOnTimeout (node:internal/timers:590:11)
    at process.processTimers (node:internal/timers:523:7)

For further help or support, visit:
https://www.balena.io/docs/reference/balena-cli/#support-faq-and-troubleshooting

If I comment out the line which dumps the ‘origin’ object, it looks like there are two separate errors being handled with different combinations of populated items in the ‘timings’ object


buildString=0.2.0+beta0051.9646bea.2
buildGitRef=#9646bea + changes to: build_release.sh rebuild_sdk.sh
buildAndroidVersionCode=2000051
Balena already logged in
Removing stale directory _work/balena_fakeroot-0.2.0+beta0051.9646bea.2
Stale directory removed
Building deployment root at _work/balena_fakeroot-0.2.0+beta0051.9646bea.2
Files copied to _work/balena_fakeroot-0.2.0+beta0051.9646bea.2
Remaining arguments: --fhau-staging --debug
Will deploy to fhau-staging
balena push --debug --source _work/balena_fakeroot-0.2.0+beta0051.9646bea.2 fhau-staging
[debug] new argv=[/home/tim/github/ml-sdk-251022a/balena-22.4.15/bin/node,/home/tim/github/ml-sdk-251022a/balena-22.4.15/bin/run,push,--source,_work/balena_fakeroot-0.2.0+beta0051.9646bea.2,fhau-staging] length=6
[debug] Deprecation check: 6.28456 days since last npm registry query for next major version release date.
[debug] Will not query the registry again until at least 7 days have passed.
[Debug]   Using build source directory: _work/balena_fakeroot-0.2.0+beta0051.9646bea.2 
in origin.emit
returning 'emit'
in origin.emit
returning 'emit'
[Debug]   Pushing to cloud for fleet: fhau-staging
in origin.emit
returning 'emit'
in origin.emit
returning 'emit'
in origin.emit
event==='error'
timings:
{
  start: 1761121406140,
  socket: 1761121406143,
  lookup: 1761121406166,
  connect: 1761121406173,
  secureConnect: 1761121406186,
  upload: 1761121406187,
  response: undefined,
  end: undefined,
  error: 1761121406191,
  abort: undefined,
  phases: {
    wait: 3,
    dns: 23,
    tcp: 7,
    tls: 13,
    request: 1,
    firstByte: undefined,
    download: undefined,
    total: 51
  }
}
origin:
returning 'emit'
[debug] Event tracking error: Timeout awaiting 'response' for 0ms
| Packaging the project source...[Debug]   Tarring all non-ignored files...
/ Packaging the project source...[Debug]   docker-compose.yml file found at "/home/tim/github/maneline/_work/balena_fakeroot-0.2.0+beta0051.9646bea.2"
| Packaging the project source...[Debug]   Tarring complete in 465 ms
[debug] Connecting to builder at https://builder.balena-cloud.com/v3/build?slug=gh_tim_littlefair%2Ffhau-staging&dockerfilePath=&emulated=false&nocache=false&headless=false&isdraft=false
in origin.emit
returning 'emit'
/ Uploading source package to https://builder.balena-cloud.comin origin.emit
event==='error'
timings:
{
  start: 1761121407552,
  socket: 1761121407554,
  lookup: 1761121407623,
  connect: undefined,
  secureConnect: undefined,
  upload: undefined,
  response: undefined,
  end: undefined,
  error: 1761121408128,
  abort: undefined,
  phases: {
    wait: 2,
    dns: 69,
    tcp: undefined,
    tls: undefined,
    request: undefined,
    firstByte: undefined,
    download: undefined,
    total: 576
  }
}
origin:
returning 'emit'
Oops something went wrong, please check your connection and try again.

RequestError
    at ClientRequest.<anonymous> (/home/tim/github/ml-sdk-251022a/balena-22.4.15/node_modules/got/dist/source/core/index.js:970:111)
    at Object.onceWrapper (node:events:634:26)
    at ClientRequest.emit (node:events:531:35)
    at origin.emit (/home/tim/github/ml-sdk-251022a/balena-22.4.15/node_modules/@szmarczak/http-timer/dist/source/index.js:50:20)
    at emitErrorEvent (node:_http_client:107:11)
    at TLSSocket.socketErrorListener (node:_http_client:574:5)
    at TLSSocket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:170:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)AggregateError [ETIMEDOUT]: 
    at internalConnectMultiple (node:net:1134:18)
    at internalConnectMultiple (node:net:1210:5)
    at Timeout.internalConnectMultipleTimeout (node:net:1742:5)
    at listOnTimeout (node:internal/timers:590:11)
    at process.processTimers (node:internal/timers:523:7)

For further help or support, visit:
https://www.balena.io/docs/reference/balena-cli/#support-faq-and-troubleshooting



real    0m3.555s
user    0m1.391s
sys     0m0.407s
tim@tim-OptiPlex-7450-AIO:~/github/maneline$ 



I’d be very grateful if someone could take a look at this, as presently I can’t push by project using the CLI at all (going to have a try using the git method when I finish this comment).

Should just comment that I am based in Perth, Western Australia, in case this is a resource/timing issue related to how much CPU capacity is provisioned in different cloud regions.

EDIT: The git push workflow won’t work for this project because I have build steps in my CI which need to run before the Dockerfile is processed,

Updates to my private message to @rosswesleyporter earlier today, I switched the device in the affected fleet available with support access from rpi4 to rpi02w-gpio as I needed the rpi4 for other testing.

I’ve run into similar problems to those described in the private message with that testing, and I’ve now enabled support access on the device again, as well as on the newly created fleet ‘muddy-hail’, to which rpi4 is now attached.

The first push via git to muddy-hail was successful and has given me a release baseline which was usable for demos. I ran the script a second time - the script failed to push the updated commits, but I was able to complete a ‘git push’ in the sandbox created after manually doing ‘git fetch’ and ‘git pull’. Attempting the workflow using the script a third time is hanging during the clone stage with the following output:

Before clone
Cloning into ‘_work/balena_fakeroot-0.2.0+beta0054’…
remote: Enumerating objects: 165, done.
remote: Counting objects: 100% (165/165), done.
remote: Compressing objects: 100% (93/93), done.
remote: Total 165 (delta 69), reused 165 (delta 69), pack-reused 0 (from 0)
Receiving objects: 100% (165/165), 13.78 MiB | 276.00 KiB/s, done.
Resolving deltas: 100% (69/69), done.

(as this is a scripted build in my continuous integration mode I need to create a fresh git sandbox for every push rather than being able to push repeatedly from the same sandbox).

I’m wondering whether Balena’s git servers have git LFS enabled - because of the way the CI works I need to push versions of a 9MB pre-tested .jar file into the git repo, maybe that isn’t something Balena’s Git infrastructure can support.

I’m happy to report that a push I did a few minutes ago using the Balena CLI succeeded. Support access for that fleet is still enabled and the release created by this is here if anyone wants to compare it with failed sessions:

On the muddy-hail fleet I created yesterday to experiment with the legacy git push workflow, the workflow is still hanging before completing the git clone step as described yesterday. But for today I’m back on the road with one working push method, so thanks to anyone at the Balena end who contributed to the resolution of this.