Pip error with fresh install of v.40 on Umbuntu 18.04 using upgrade steps


#1

Earlier today I did a fresh install (via rebuild droplet on Digital Ocean) to Umbuntu 18.04 x64 while following the steps of the v.40 upgrade guide (link).

The initial install of mailinabox went fine. The duplicity restore went fine. However I got an error on sudo mailinabox (also same result with curl method). The error occurred right after the management daemon message:

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

After digging for a while I found that the cause is something about the way virtualenv is being done in the management.sh script. When I looked in /usr/local/lib/mailinabox/env/bin I found with names like =2.0.0 (sorry I didnt retain the terminal session to obtain the actual names but they did have = in them).

Resolution:
In case others get stumped by the issue too, below are the steps I used to resolve it. I’m really don’t know why this worked and the script didn’t.

  1. Remove /usr/local/lib/mailinabox/env
    rm -rf /usr/local/lib/mailinabox/env

  2. Manually create the virtualenv (these commands assume you are already in the folder /usr/local/lib/mailinabox):

source env/bin/activate
pip install --upgrade pip

pip install --upgrade rtyaml "email_validator>=1.0.0" "exclusiveprocess" \
>         flask dnspython python-dateutil \
>         "idna>=2.0.0" "cryptography==2.2.2" boto psutil

deactivate
  1. Comment out the lines in ~mailinabox/setup/management.sh that create and install packages in the virtualenv. You’ll need to leave two lines in the top section of the file ( inst_dir=/usr/local/lib/mailinabox and venv=$inst_dir/env) as commands later in the file use them too

  2. Run sudo mailinabox and it will make it all the way through without error.

Good luck!


#2

if this was a fresh install, why are you using the upgrade steps??


#3

Sorry I wasn’t clear. It was a fresh droplet, then I completed the steps to restore data from the .gpg files I pulled before the old droplet containing MIAB v.3 was nuked. I didn’t encounter problems until I ran sudo mailinabox after restoring the data.