Installation script is failing on ubuntu 22.04
LuD1161 opened this issue Β· comments
First of all thanks for the awesome project π
I've previously install MIAB on ubuntu 22.04 LTS, almost 4-5 months back. But now it's failing.
There are multiple issues and some solutions that I did for them -
virtualenv
installation folders, path have changed. Hence now this is failing atsetup/management.sh
line number 34 & 39.
I fixed this by adding the correct path like this -
![image](https://private-user-images.githubusercontent.com/17861054/285737326-45b4c3d4-302b-47b6-addd-ebc89d10ca41.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTcwODExOTIsIm5iZiI6MTcxNzA4MDg5MiwicGF0aCI6Ii8xNzg2MTA1NC8yODU3MzczMjYtNDViNGMzZDQtMzAyYi00N2I2LWFkZGQtZWJjODlkMTBjYTQxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTMwVDE0NTQ1MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRhMTE0MDc1YmM3YTk4ODc0OTQwZDhhOWMyZDkwZjE1Mzg5YzE2MzA3ZGQ3NjAyOTJiZTcyYWRiNGIxNGEyOGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.fePXNHGFU7xUPFS-pcRTNXJ72nBMjrROLWBqXXISLco)
However, I am getting into this error -
DEPRECATION: distro-info 1.1build1 has a non-standard version number. pip 24.0 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of distro-info or contact the author to suggest that they release a version with a conforming version number. Discussion can be found at https://github.com/pypa/pip/issues/12063
Installing collected packages: pypng, expiringdict, exclusiveprocess, rtyaml, qrcode, pyotp, pycparser, psutil, pillow, multidict, MarkupSafe, itsdangerous, gunicorn, frozenlist, click, blinker, attrs, async-timeout, yarl, Werkzeug, Jinja2, cffi, aiosignal, pycares, flask, cryptography, aiohttp, aiodns, postfix-mta-sts-resolver
Attempting uninstall: blinker
Found existing installation: blinker 1.4
ERROR: Cannot uninstall 'blinker'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
Has someone faced a similar issue ?
OS version
![image](https://private-user-images.githubusercontent.com/17861054/285737719-95e4a565-e1d8-4e33-8918-96666565f8e6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTcwODExOTIsIm5iZiI6MTcxNzA4MDg5MiwicGF0aCI6Ii8xNzg2MTA1NC8yODU3Mzc3MTktOTVlNGE1NjUtZTFkOC00ZTMzLTg5MTgtOTY2NjY1NjVmOGU2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTMwVDE0NTQ1MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk5ZGMzOTMyMjk0Yjk2YWRhYzY1MDAyZTZjMGZjYmIyM2Q5ZGNmZDU4OTA3YTZjOTNhZTE5YTM4OGM3ZDI5NmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.qVXyi-Z5DBc9yXkKQ5qwPNsOSbdI9ajk4hH6dqWgGCI)
+1 breaking here with the exact steps and errors. Seems the same as in #2272 but with no solution so no clues
There is some discussion here that seems to describe the same issue. However, I would first like to get some additional information, like:
- Did you get a fresh Ubuntu 22.04 VPS? Or upgrade an existing one?
- How did you install the system, which command are you using?
- There might be a VPS specific issue. Which provider are you using?
Instead of changing code, could you post the original issues (errors, messages, installation output etc) you're facing?
Exactly same problem for me:
- Fresh 22.04 install using ubuntu-22.04.3-live-server-amd64.iso
- command launched: curl -s https://mailinabox.email/setup.sh | sudo -E bash
- output:
...
Successfully uninstalled click-8.0.3
Attempting uninstall: blinker
Found existing installation: blinker 1.4
ERROR: Cannot uninstall 'blinker'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
- I'm providing VPS, so not a provider problem
There is some discussion here that seems to describe the same issue. However, I would first like to get some additional information, like:
* Did you get a fresh Ubuntu 22.04 VPS? Or upgrade an existing one? * How did you install the system, which command are you using? * There might be a VPS specific issue. Which provider are you using?
Instead of changing code, could you post the original issues (errors, messages, installation output etc) you're facing?
Hey @kiekerjan π
Thanks for the reply. It's a fresh install on contabo ( vps host ). Contabo is the one that allows for SMTP. hence using that, if anyone has any other better alternatives, I am all ears π
To make things work quickly I removed blinker (dpkg -r python3-blinker) and its associated packages, and it worked. Definitively not the ideal method, but good enough for now and for my needs.
The code in management.sh hasn't changed in many years, and I've confirmed that the paths are correct on my MiaB Ubuntu 22.04. So, I believe the issue is, why did virtualenv
create the python venv with everything under local/bin
instead of bin
on the affected systems?
I found this with a quick google search, maybe it will help you to resolve the issue:
https://askubuntu.com/questions/1406304/virtualenv-installs-envs-into-local-bin-instead-of-bin
Okay, after a quick review, the tl;dr version is, if you add this to your environment it should fix how the venv is being built:
export DEB_PYTHON_INSTALL_LAYOUT='deb'
The setup script only appears to build the virtualenv if the directory is missing, so you will need to first remove that venv directory, /usr/local/lib/mailinabox/venv
, before re-running the install. And if you're using sudo
to run mailinabox, make sure that the environment variable is being preserved by using the --preserve-env
option.
This worked for me, adding the env var as per @dms00
export DEB_PYTHON_INSTALL_LAYOUT='deb'
Thanks for the feedback. Glad it worked.
I didn't have any way to test this fix because I cannot reproduce this problem on my MiaB server. So, there's more going on here than I understand at this point.
My bad luck, tonight I decided to test installing mailinabox on a fresh Ubuntu 22.04 (LTS) x64 Digital Ocean instance and have run into the above error. Python3-distutils version 3.10.8-1~22.04 does appear to be installed:
sudo apt-get install python3-distutils
python3-distutils is already the newest version (3.10.8-1~22.04).
dpkg -S python3-distutils
python3-distutils: /usr/share/lintian/overrides/python3-distutils
python3-distutils: /usr/share/doc/python3-distutils/copyright
python3-distutils: /usr/share/doc/python3-distutils
python3-distutils: /usr/share/doc/python3-distutils/changelog.Debian.gz
python3-distutils: /usr/share/doc/python3-distutils/README.Debian
Edit: the instructions to "export DEB_PYTHON_INSTALL_LAYOUT='deb'" fixed the crash.
Hey Everyone π
Thanks for helping resolve the issue.
@kiekerjan I had a look at your fork, I see a lot of improvements there. Thanks for maintaining it.
I've just set the env var on a fresh machine ( didn't even run apt update
or apt upgrade
) and it worked π
export DEB_PYTHON_INSTALL_LAYOUT='deb'
Thanks @dms00 for the suggestion π
@dms00 suggestion worked like a charm, thanks mate !
export DEB_PYTHON_INSTALL_LAYOUT='deb'
Closing this issue for now.
But maybe it should be at least documented somehow? I yesterday also stuck with it and the above solution worked. But it looks like a workaround and not a robust solution.
And depending on the cause we might want to include a code change to management.sh
Great sleuthing! We'll set this environment variable automatically in the next Mail-in-a-Box update (see 371f5bc).
I tried everything I could think of last night.
This morning, I tried a bare metal install, no updates, ran
#export DEB_PYTHON_INSTALL_LAYOUT='deb'
prior to any command, then ran the install,
#sudo apt install curl locales -y
#sudo dpkg-reconfigure locales
#sudo curl -L https://power-mailinabox.net/setup.sh | sudo bash
and this happens...still....
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Installing nsd (DNS server)...
Generating DNSSEC signing keys...
No keypair found. Generating daemon's PGP keypair...
Generated key with fingerprint 9288A8DBC35E8C7CB22A63940AB01FD56FF954BC
Installing Postfix (SMTP server)...
Installing Dovecot (IMAP server)...
Creating new user database: /home/user-data/mail/users.sqlite
Installing OpenDKIM/OpenDMARC...
Installing SpamAssassin...
Installing Nginx (web server)...
Installing Roundcube (webmail)...
Installing Nextcloud (contacts/calendar)...
Upgrading to Nextcloud version 24.0.7
Nextcloud is already latest version
photos 1.6.0 disabled
dashboard 7.4.0 disabled
activity 2.16.0 disabled
Installing Z-Push (Exchange/ActiveSync server)...
Installing Mail-in-a-Box system management daemon...
FAILED: /usr/local/lib/mailinabox/env/bin/pip install --upgrade pip
setup/functions.sh: line 17: /usr/local/lib/mailinabox/env/bin/pip: No such file or directory
I tried everything I could think of last night. This morning, I tried a bare metal install, no updates, ran #export DEB_PYTHON_INSTALL_LAYOUT='deb' prior to any command, then ran the install, #sudo apt install curl locales -y #sudo dpkg-reconfigure locales #sudo curl -L https://power-mailinabox.net/setup.sh | sudo bash
and this happens...still....
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Installing nsd (DNS server)... Generating DNSSEC signing keys... No keypair found. Generating daemon's PGP keypair... Generated key with fingerprint 9288A8DBC35E8C7CB22A63940AB01FD56FF954BC Installing Postfix (SMTP server)... Installing Dovecot (IMAP server)... Creating new user database: /home/user-data/mail/users.sqlite Installing OpenDKIM/OpenDMARC... Installing SpamAssassin... Installing Nginx (web server)... Installing Roundcube (webmail)... Installing Nextcloud (contacts/calendar)...
Upgrading to Nextcloud version 24.0.7
Nextcloud is already latest version photos 1.6.0 disabled dashboard 7.4.0 disabled activity 2.16.0 disabled Installing Z-Push (Exchange/ActiveSync server)... Installing Mail-in-a-Box system management daemon...
FAILED: /usr/local/lib/mailinabox/env/bin/pip install --upgrade pip
setup/functions.sh: line 17: /usr/local/lib/mailinabox/env/bin/pip: No such file or directory
you should run with the option --preserve-env
#sudo --preserve-env curl -L https://power-mailinabox.net/setup.sh | sudo --preserve-env bash
in my case it was like this:
$ export DEB_PYTHON_INSTALL_LAYOUT='deb'
$ sudo --preserve-env curl -s https://mailinabox.email/setup.sh | sudo -E bash
--= THIS WORKED FOR ME==--
(subject: stand alone pc, with Ubuntu server 22.04 loaded from downloaded image from 11-27-23, no other commands given from first boot other than changing the root password)
#export DEB_PYTHON_INSTALL_LAYOUT='deb'
#sudo --preserve-env curl -L https://power-mailinabox.net/setup.sh | sudo --preserve-env bash
Thank you all.
After a "successful installation", I get a new error on the Admin Backup page.
[Errno 2] No such file or directory: '/usr/local/bin/duplicity'
It is still failing for me. I tried the solutions proposed
export DEB_PYTHON_INSTALL_LAYOUT= 'deb'
sudo --preserve-env curl -L https://power-mailinabox.net/setup.sh | sudo --preserve-env bash
Still fails at
Installing Z-Push (Exchange/ActiveSync server)...
Installing Mail-in-a-Box system management daemon...
FAILED: /usr/local/lib/mailinabox/env/bin/pip install --upgrade pip
-----------------------------------------
setup/functions.sh: line 17: /usr/local/lib/mailinabox/env/bin/pip: No such file or directory
Can't install Mailinabox on Ubuntu 22.04
Hello
I have the same issue. I try the work arround with --preserve and that's not better.
I'm starting from a fresh install, nothing on the vps , I try with an apt update or from scratch and the issue always occur.
I also try to create a virtual link to pip as it works fine (if I try "pip install --upgrade pip", it s ok, thats only the path who is wrong) , but its another fail. There is a fix or a previous stable release I can try ?
If i relanch the script after a sudo --preserve-env pip install --upgrade pip
I got this new error information :
Installing Mail-in-a-Box system management daemon...
FAILED: /usr/local/lib/mailinabox/env/bin/pip install --upgrade pip
setup/functions.sh: line 19: /usr/local/lib/mailinabox/env/bin/pip: No such file or directory
- connect to 0.0.0.60 port 80 failed: Connection timed out
- Failed to connect to 0.0.0.60 port 80 after 129901 ms: Connection timed out
- Closing connection 1
I just repeated the experiment...baremetal...tried Ubuntu server 23...but Dave hasn't addressed 23 yet...so, I loaded Ubuntu Server 20.04
Only commands given prior to installation was to change the root password.
I ran the standard install procedure, and everything appears to be working just fine...seems that Jammy just broke itself. Bummer.
So, at lease I have an option. ( I have a large project where I will be loading up a few dozen iterations of PMIAB..so I was about to panic.)
I have run all updates, and nothing appears broken.
Just as a quick note for people trying the above mentioned fix.
You need to run the command before anything else, otherwise it wont work.
So, get a VM, connect, run export DEB_PYTHON_INSTALL_LAYOUT='deb'
, then as second step, run sudo --preserve-env curl -s https://mailinabox.email/setup.sh | sudo -E bash
.
Quick note if still getting error - /usr/local/lib/mailinabox/env/bin/pip: No such file or directory
- Set the Environment Variable:
export DEB_PYTHON_INSTALL_LAYOUT='deb' - . Remove the Existing Virtual Environment:
sudo rm -r /usr/local/lib/mailinabox/env - sudo --preserve-env curl -s https://mailinabox.email/setup.sh | sudo -E bash
These 3 steps should run the installation without errors
Remove Current Python Enviroment and then re create it and try running the script again. Worked for me
rm -rf /usr/local/lib/mailinabox/env >> REMOVE ENVIROMENT
apt install python3.10-venv >> DOWNLOAD VENV
python3 -m venv /usr/local/lib/mailinabox/env >> CREATE NEW VIRTUAL ENV
Run the Script Again, It definitely should work, i updated 5 mail servers all of them faced this problem and i fixed all of them like this.