Build-frontend.sh returning npm ERR timeout

1. What is the issue? Please be detailed.
When installing odk central, i am facing an issue when I run docker compose build. It goes smoothly until it reach nginx service, there it goes until the line RUN files/prebuild/build-frontend.sh and returns the following error.

=> ERROR [nginx intermediate 4/4] RUN files/prebuild/build-frontend.sh 148.5s

[nginx intermediate 4/4] RUN files/prebuild/build-frontend.sh:
147.0 npm ERR! code ERR_SOCKET_TIMEOUT
147.2 npm ERR! network Socket timeout
147.3 npm ERR! network This is a problem related to network connectivity.
147.3 npm ERR! network In most cases you are behind a proxy or have bad network settings.
147.3 npm ERR! network
147.3 npm ERR! network If you are behind a proxy, please make sure that the
147.3 npm ERR! network 'proxy' config is set properly. See: 'npm help config'
147.9
147.9 npm ERR! A complete log of this run can be found in:
147.9 npm ERR! /root/.npm/_logs/2023-09-17T18_38_33_131Z-debug-0.log


failed to solve: process "/bin/sh -c files/prebuild/build-frontend.sh" did not complete successfully: exit code: 1

2. What steps can we take to reproduce this issue?
Trying to install odk central at a vps.
Specs:
ubuntu 20.04 LTS
10 GB Storage
512 RAM

3. What have you tried to fix the issue?

Tried running the docker compose build command multiple times, if maybe it was a network issue. Also tried build the nginx server alone; same result.

4. Upload any forms or screenshots you can share publicly below.

Hi @Yoseph_Tenaw
When you get a chance, please introduce yourself here. I'd also encourage you to add a real picture as your avatar because it helps build community!

Are you behind a proxy as the logs say?
Have you tried anything from https://stackoverflow.com/questions/18419144/npm-not-working-read-econnreset?
It seems like there might be more about the issue in:

147.9 npm ERR! A complete log of this run can be found in:
147.9 npm ERR! /root/.npm/_logs/2023-09-17T18_38_33_131Z-debug-0.log

Could you attach those logs too?

Hey Grzesiek2010,

Thank you for responding to my issue, but fortunately I found what the problem was; And it was not network related.

The issue was the my small storage space of 10 GB, I upgrade my server to 25 GB storage and the error on build-frontend.sh was solved.

It would be great if the odk team included in the instruction that a certain storage space requirement is need, like minimum 25 GB of storage.

Either way, Thank you

1 Like

I am also running into similar issues; I receive the error message if I try upgrading and hosting a new one.

@Yakub How much RAM does your server have? If it's less than 1 GB, we recommend you add swap.

I added swap, then after executing compose pull, I get this.

This looks like a network issue. Make sure you have a good connection and try again.

I am seeing this problem too, today. Repeatedly. I did a "Rebuild" of my droplet using Ubuntu 22.04 LTS, installed docker following Digital Ocean's guide, and then followed instructions for installing Central on ODK docs.

failed to solve: process "/bin/sh -c OIDC_ENABLED=\"$OIDC_ENABLED\" files/prebuild/build-frontend.sh" did not complete successfully: exit code: 134

I have 1GB RAM, 25GB disk. I have added 2GB swap as @yanokwa and the docs recommends. From the profile graphs, memory doesn't seem to have max'd out, CPU got closer to 100%.


This issue got fixed for me just now.

After docker compose build kept giving me the above error all day long (I kept trying it again and again), it ran to completion just now, and I confirmed that Central is loading successfully.

@pklgeez Did you also increase the memory allocation when you were trying this? I doubt you did because our docs are unclear on this, but I wanted to confirm.

@yanokwa No, I did not, we currently have 1GB RAM. And 2GB swap as recommended in the docs.

Is it now generally recommended to have more memory even for starters? Because I see the section in the docs you linked to (and somewhere else too in the docs possibly, although I can't recall now) sounds like more, at least 2GB, is recommended for even basic steady-state operations like upgrades.

Rebuilds and fresh installs (which I've done several times these past few weeks as I'm learning) didn't gave me any trouble with 1GB, until yesterday. But we are planning to stay with this for some months at least while we trial it out, so we are definitely already thinking about steady-state.

Has Anyone come accross this nmp issue while trying to rebuild the odk docker-compose file . I am running Ubuntu 22.04.03 LTS. The server has 10GB of Ram and 500GB hhd.

=> ERROR [nginx intermediate 5/5] RUN OIDC_ENABLED="false" files/prebuild/build-frontend.sh 236.7s
=> [nginx stage-1 2/8] RUN apt-get update && apt-get install -y netcat-openbsd 13.3s
=> [nginx stage-1 3/8] RUN mkdir -p /usr/share/odk/nginx/ 0.3s
=> [nginx stage-1 4/8] COPY files/nginx/setup-odk.sh /scripts/ 0.0s
=> [nginx stage-1 5/8] COPY files/local/customssl/.pem /etc/customssl/live/local/ 0.1s
=> [nginx stage-1 6/8] COPY files/nginx/
.conf* /usr/share/odk/nginx/ 0.0s

[nginx intermediate 5/5] RUN OIDC_ENABLED="false" files/prebuild/build-frontend.sh:
32.89 npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
236.6 npm ERR! code ETIMEDOUT
236.6 npm ERR! syscall read
236.6 npm ERR! errno -110
236.6 npm ERR! network read ETIMEDOUT
236.6 npm ERR! network This is a problem related to network connectivity.
236.6 npm ERR! network In most cases you are behind a proxy or have bad network settings.
236.6 npm ERR! network
236.6 npm ERR! network If you are behind a proxy, please make sure that the
236.6 npm ERR! network 'proxy' config is set properly. See: 'npm help config'
236.6
236.6 npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-12-20T23_43_51_862Z-debug-0.log


failed to solve: process "/bin/sh -c OIDC_ENABLED="$OIDC_ENABLED" files/prebuild/build-frontend.sh" did not complete successfully: exit code: 146
root@odk:/home/odksurvey/central#