Code Monkey home page Code Monkey logo

Comments (28)

dms00 avatar dms00 commented on July 18, 2024 3

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.

from mailinabox.

JoshData avatar JoshData commented on July 18, 2024 2

Great sleuthing! We'll set this environment variable automatically in the next Mail-in-a-Box update (see 371f5bc).

from mailinabox.

ypeskov avatar ypeskov commented on July 18, 2024 2

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

from mailinabox.

nishchayjeet avatar nishchayjeet commented on July 18, 2024 2

Quick note if still getting error - /usr/local/lib/mailinabox/env/bin/pip: No such file or directory

  1. Set the Environment Variable:
    export DEB_PYTHON_INSTALL_LAYOUT='deb'
  2. . Remove the Existing Virtual Environment:
    sudo rm -r /usr/local/lib/mailinabox/env
  3. sudo --preserve-env curl -s https://mailinabox.email/setup.sh | sudo -E bash

These 3 steps should run the installation without errors

from mailinabox.

LuD1161 avatar LuD1161 commented on July 18, 2024 1

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 😄
image

from mailinabox.

awkto avatar awkto commented on July 18, 2024 1

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

from mailinabox.

KaiserRuben avatar KaiserRuben commented on July 18, 2024 1

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.

from mailinabox.

HusseinKhazem avatar HusseinKhazem commented on July 18, 2024 1

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.

from mailinabox.

MarcosBL avatar MarcosBL commented on July 18, 2024

+1 breaking here with the exact steps and errors. Seems the same as in #2272 but with no solution so no clues

from mailinabox.

kiekerjan avatar kiekerjan commented on July 18, 2024

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?

from mailinabox.

samos028 avatar samos028 commented on July 18, 2024

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

from mailinabox.

LuD1161 avatar LuD1161 commented on July 18, 2024

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 😄

from mailinabox.

samos028 avatar samos028 commented on July 18, 2024

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.

from mailinabox.

dms00 avatar dms00 commented on July 18, 2024

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

from mailinabox.

awkto avatar awkto commented on July 18, 2024

This worked for me, adding the env var as per @dms00
export DEB_PYTHON_INSTALL_LAYOUT='deb'

from mailinabox.

dms00 avatar dms00 commented on July 18, 2024

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.

from mailinabox.

dms00 avatar dms00 commented on July 18, 2024

This comment from the "askubuntu.com" link I posted seems to be crucial:

Screenshot 2023-11-27 at 19 46 37

Could someone who has this problem on their system, please check if you have python3-distutils installed on your system? And if you do not, please install it and see if that resolves the issue.

from mailinabox.

RobWW avatar RobWW commented on July 18, 2024

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.

from mailinabox.

LuD1161 avatar LuD1161 commented on July 18, 2024

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.

from mailinabox.

MarcosBL avatar MarcosBL commented on July 18, 2024

@dms00 suggestion worked like a charm, thanks mate !

export DEB_PYTHON_INSTALL_LAYOUT='deb'

from mailinabox.

LuD1161 avatar LuD1161 commented on July 18, 2024

Closing this issue for now.

from mailinabox.

ypeskov avatar ypeskov commented on July 18, 2024

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.

from mailinabox.

kiekerjan avatar kiekerjan commented on July 18, 2024

And depending on the cause we might want to include a code change to management.sh

from mailinabox.

capitancurt avatar capitancurt commented on July 18, 2024

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

from mailinabox.

capitancurt avatar capitancurt commented on July 18, 2024

--= 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.

from mailinabox.

capitancurt avatar capitancurt commented on July 18, 2024

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'

from mailinabox.

demha-theFirstOne avatar demha-theFirstOne commented on July 18, 2024

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

from mailinabox.

capitancurt avatar capitancurt commented on July 18, 2024

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.

from mailinabox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.