Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python error and issue after updating to Bullseye #42

Closed
mannp opened this issue Jan 23, 2022 · 4 comments
Closed

Python error and issue after updating to Bullseye #42

mannp opened this issue Jan 23, 2022 · 4 comments

Comments

@mannp
Copy link

mannp commented Jan 23, 2022

Hi there

I thought I updated to 0.56 yestersday and then upgraded to debian 11.

The upgrade seemed to go well and everything appeared to be working, but this morning my box is down.

I tried to upgrade again, but am getting this error... it appears I am not on 0.56 or the update script is not getting 0.56 with Debian 11 maybe?

My admin gateway is 502 but the base domain displays the correct html page.

Any help would be appreciated :) thanks in advance

Installing Z-Push (Exchange/ActiveSync server)...
Installing Mail-in-a-Box system management daemon...
setup/functions.sh: line 7:  5880 Aborted                 "$@" &> $OUTPUT

FAILED: /usr/local/lib/mailinabox/env/bin/pip install --upgrade pip
-----------------------------------------
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: initfsencoding: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f0526e1f740 (most recent call first):

Edit: Tried purging python and pip and rerunning the install script but nothing I have tried works...same error.

Google is full of reports of the error but, a convoluted mess of answers, that either don't work or are not appropriate here.

@mannp mannp changed the title Update error and issue after updating to Bullseye Python error and issue after updating to Bullseye Jan 23, 2022
@ddavness
Copy link
Owner

Trying to reproduce the issue:

  • Deploy VM with Debian 10
  • Install v56.0
  • Upgrade to Debian 11
  • Re-run the setup

Not exactly sure where this could fail, I'll get back to you if I find anything interesting.

@ddavness
Copy link
Owner

Update - I was able to reproduce the issue. Band-aid solution is to run the following command:

sudo rm -rf /usr/local/lib/mailinabox/env

Then re-run the setup as usual. This will force the setup to re-create the management environment from scratch instead of using old python versions.

@ddavness
Copy link
Owner

Or... update again, because it should be fixed now :)

https://github.com/ddavness/power-mailinabox/releases/tag/v56.1

@mannp
Copy link
Author

mannp commented Jan 24, 2022

Glad you were able to reproduce and fix, thank you.

I was so close to removing the env, based on suggestions around the web, but wasn't sure of the consequences, lol.

Now I do and see your change :)

Thanks again.

elif [ "$(cat $venv/.oscode)" != $(get_os_code) ]; then
	echo "Existing management environment is from an earlier version of the OS you're running."
	echo "Re-creating Python environment..."
	rm -rf $venv
	hide_output virtualenv -ppython3 $venv
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants