mail-in-a-box / mailinabox

Mail-in-a-Box helps individuals take back control of their email by defining a one-click, easy-to-deploy SMTP+everything else server: a mail server in a box.
https://mailinabox.email/
Creative Commons Zero v1.0 Universal
13.91k stars 1.43k forks source link

Fetching jquery fails in current setup script. #2195

Open SchmalzTech opened 1 year ago

SchmalzTech commented 1 year ago

It looks like this is caused by upstream vendor, but it seems to be a show stopper and it put my installation in an unstable state.

Posted below is what I am seeing. If I put that URL in my browser, I am getting the jquery code. I am getting the same issue with redirects when I repeat the wget from the command line. I was able to download it if I used curl instead, so perhaps that is a solution:

### THIS COMMAND WORKS FOR ME ###
curl https://code.jquery.com/jquery-2.1.4.min.js >~/jquery.min.js
### THIS IS THE ERROR OUTPUT FROM RUNNING sudo mailinabox ###
Installing Mail-in-a-Box system management daemon...

FAILED: wget -O /usr/local/lib/mailinabox/vendor/assets/jquery.min.js https://code.jquery.com/jquery-2.1.4.min.js
-----------------------------------------
--2022-11-05 11:26:29--  https://code.jquery.com/jquery-2.1.4.min.js
Resolving code.jquery.com (code.jquery.com)... 69.16.175.42, 69.16.175.10, 2001:4de0:ac18::1:a:3a, ...
Connecting to code.jquery.com (code.jquery.com)|69.16.175.42|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
--2022-11-05 11:26:30--  https://code.jquery.com/jquery-2.1.4.min.js
Reusing existing connection to code.jquery.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
--2022-11-05 11:26:30--  https://code.jquery.com/jquery-2.1.4.min.js
Reusing existing connection to code.jquery.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
--2022-11-05 11:26:30--  https://code.jquery.com/jquery-2.1.4.min.js
Reusing existing connection to code.jquery.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
--2022-11-05 11:26:30--  https://code.jquery.com/jquery-2.1.4.min.js
Reusing existing connection to code.jquery.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
--2022-11-05 11:26:31--  https://code.jquery.com/jquery-2.1.4.min.js
Reusing existing connection to code.jquery.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
--2022-11-05 11:26:31--  https://code.jquery.com/jquery-2.1.4.min.js
Reusing existing connection to code.jquery.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
--2022-11-05 11:26:31--  https://code.jquery.com/jquery-2.1.4.min.js
Reusing existing connection to code.jquery.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
--2022-11-05 11:26:31--  https://code.jquery.com/jquery-2.1.4.min.js
Reusing existing connection to code.jquery.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
--2022-11-05 11:26:32--  https://code.jquery.com/jquery-2.1.4.min.js
Reusing existing connection to code.jquery.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
--2022-11-05 11:26:32--  https://code.jquery.com/jquery-2.1.4.min.js
Reusing existing connection to code.jquery.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
--2022-11-05 11:26:32--  https://code.jquery.com/jquery-2.1.4.min.js
Reusing existing connection to code.jquery.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
--2022-11-05 11:26:32--  https://code.jquery.com/jquery-2.1.4.min.js
Reusing existing connection to code.jquery.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
--2022-11-05 11:26:33--  https://code.jquery.com/jquery-2.1.4.min.js
Reusing existing connection to code.jquery.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
--2022-11-05 11:26:33--  https://code.jquery.com/jquery-2.1.4.min.js
Reusing existing connection to code.jquery.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
--2022-11-05 11:26:33--  https://code.jquery.com/jquery-2.1.4.min.js
Reusing existing connection to code.jquery.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
--2022-11-05 11:26:34--  https://code.jquery.com/jquery-2.1.4.min.js
Reusing existing connection to code.jquery.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
--2022-11-05 11:26:34--  https://code.jquery.com/jquery-2.1.4.min.js
Reusing existing connection to code.jquery.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
--2022-11-05 11:26:34--  https://code.jquery.com/jquery-2.1.4.min.js
Reusing existing connection to code.jquery.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
--2022-11-05 11:26:35--  https://code.jquery.com/jquery-2.1.4.min.js
Reusing existing connection to code.jquery.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
--2022-11-05 11:26:35--  https://code.jquery.com/jquery-2.1.4.min.js
Reusing existing connection to code.jquery.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
20 redirections exceeded.
SchmalzTech commented 1 year ago

When I tried to run wget from the shell, I increased the max redirects to 100, and it still didn't go, so there is some sort of loop on their server when using wget.

SchmalzTech commented 1 year ago

Additional note:

I first saw this while trying to run an update on my existing v5x installation, but I also spun up a new Ubuntu 22.04 instance for v60 and I get it there as well.

downtownallday commented 1 year ago

I had success adding --compression=auto to the wget command line in setup/functions.sh::wget_verify

before:

wget -O /tmp/jquery.min.js https://code.jquery.com/jquery-2.1.4.min.js
--2022-11-05 18:57:04--  https://code.jquery.com/jquery-2.1.4.min.js
Resolving code.jquery.com (code.jquery.com)... 69.16.175.10, 69.16.175.42, 2001:4de0:ac18::1:a:2a, ...
Connecting to code.jquery.com (code.jquery.com)|69.16.175.10|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://code.jquery.com/jquery-2.1.4.min.js [following]
--2022-11-05 18:57:05--  https://code.jquery.com/jquery-2.1.4.min.js
Reusing existing connection to code.jquery.com:443.
HTTP request sent, awaiting response... 302 Found
...
20 redirections exceeded.

vs:

wget --compression=auto -O /tmp/jquery.min.js https://code.jquery.com/jquery-2.1.4.min.js
--2022-11-05 18:57:22--  https://code.jquery.com/jquery-2.1.4.min.js
Resolving code.jquery.com (code.jquery.com)... 69.16.175.10, 69.16.175.42, 2001:4de0:ac18::1:a:1a, ...
Connecting to code.jquery.com (code.jquery.com)|69.16.175.10|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 29519 (29K) [application/javascript]
Saving to: ‘/tmp/jquery.min.js’

/tmp/jquery.min.js  100%[===================>]  28.83K  --.-KB/s    in 0.02s   

2022-11-05 18:57:22 (1.48 MB/s) - ‘/tmp/jquery.min.js’ saved [84345]