ej52 / proxmox-scripts

MIT License
587 stars 308 forks source link

Line 105 in alpine.sh gives error ssl_client: write: Broken pipe #59

Closed Wolfensteijn closed 2 years ago

Wolfensteijn commented 2 years ago

Script nginx-proxy-manager

Describe the bug Following the information as posted in https://github.com/ej52/proxmox-scripts/issues/29 you run "wget --no-cache -qO - https://raw.githubusercontent.com/ej52/proxmox/main/lxc/nginx-proxy-manager/setup.sh | sh" and get a failed NPM install with the following error message:

[success] Checking for latest NPM release
[error] Downloading NPM v.tar.gz
/tmp/npm_install.sh: line 110: 'wget $WGETOPT -c $_npm_url/archive/v$_latest_version.tar.gz -O - | tar -xz'
Broken pipe
Broken pipe
HTTP/1.1 404 Not Found
invalid magic
short read

Digging a bit further and finding the lines of bash code responsible, it fails at line 105 when it tries to check the latest NPM version number. Getting all the variables used and creating the command as it is being run gives:

wget -t 1 -T 15 -q -O ./_latest_release https://github.com/NginxProxyManager/nginx-proxy-manager/releases/latest
ssl_client: write: Broken pipe

Running the same command from a WSL Ubuntu install gives no errors.

System info:

Screenshots If applicable, add screenshots to help explain your problem.

Additional context After a bit more digging, it seems to be a shortcoming of the busybox wget version that is default in Alpine containers. Doing an "apk add wget" installs the GNU wget version, and that one works fine with downloading the latest_release data from Github.

Though using that wget probably requires different options because it is giving me errors with setting up Python.

tworth04 commented 2 years ago

as a workaround, you can clone this repo and update the alpine.sh script. i'd have to go back and look at all i did, but the biggest thing is the url for NPM has been updated. Instead of originally pointing to the jc21 repo, it's now https://github.com/NginxProxyManager/nginx-proxy-manager.

edited to add:

i've slept since i did this so apologies if i miss something. But the short term fix until ej52 has a chance to update is something like this:

clone repo copy alpine.sh (or ubuntu.sh....whichever you use) to /tmp/npm_install.sh

i copied the setup.sh to ~/setup.sh and commented out the following lines:

rm -rf $TMP

wget -O MP" "$URL/$DISTRO.sh"

vi /tmp/npm_install.sh

:%s/jc21/NginxProxyManager/g

write quit an run the setup.sh and all should work.

Again sorry if i missed anything and i only did this with alpine. can't speak to Ubuntu