Python error when logging in

  • READ ME AND USE THIS TEMPLATE IF YOU WANT TO GET HELP !

:uk:/:us: Message template (english)

My YunoHost server

Hardware: Old laptop or computer
YunoHost version: 3.7.1.3
I have access to my server : Through SSH and through the web admin.
**Are you in a special context or did you perform some particular tweaking on your YunoHost instance ?: yes
If yes, please explain: I updated my MariaDB while ago to use an LMS.

Description of my issue

Hello! YunoHost admin! When I login to YunoHost admin, I get the following error:

Action
GET /users
{ā€œlocaleā€:ā€œenā€}
Traceback
Traceback (most recent call last):
File ā€œ/usr/lib/python2.7/dist-packages/moulinette/interfaces/api.pyā€, line 489, in process
ret = self.actionsmap.process(arguments, timeout=30, route=_route)
File ā€œ/usr/lib/python2.7/dist-packages/moulinette/actionsmap.pyā€, line 588, in process
return func(**arguments)
File ā€œ/usr/lib/moulinette/yunohost/user.pyā€, line 59, in user_list
from yunohost.utils.ldap import _get_ldap_interface
File ā€œ/usr/lib/moulinette/yunohost/utils/ldap.pyā€, line 23, in
from moulinette.core import init_authenticator
ImportError: cannot import name init_authenticator

Also, the upgrade from yunohost (from 3.7.1.3 to 3.8.4.5) and yunohost-admin (from 3.7.1.1 to 3.8.3.3) are failing. Thanks!

Yes, thatā€™s the reason of the error you pasted.

Can you provide the log of the upgrade (and explain how youā€™re running the upgrade)

Hi Aleks,

Here are the logs from my last attempt to upgrade:

2020-05-27 10:38:08,757: DEBUG - Get:1 http://forge.yunohost.org/debian stretch InRelease [18.2 kB]
2020-05-27 10:38:08,958: DEBUG - Fetched 18.2 kB in 0s (25.8 kB/s)
2020-05-27 10:38:08,958: DEBUG - Reading package listsā€¦
2020-05-27 10:38:08,958: DEBUG - Building dependency treeā€¦
2020-05-27 10:38:08,958: DEBUG - Reading state informationā€¦
2020-05-27 10:38:08,958: DEBUG - 2 packages can be upgraded. Run ā€˜apt list --upgradableā€™ to see them.
2020-05-27 10:38:08,972: DEBUG - Done
2020-05-27 10:38:08,973: INFO - Fetching available upgrades for appsā€¦
2020-05-27 10:38:08,973: DEBUG - Attempting to fetch list yunohost at https://app.yunohost.org/apps.json
2020-05-27 10:38:10,297: SUCCESS - Updated the app list ā€˜yunohostā€™
2020-05-27 10:38:26,192: DEBUG - The log category ā€˜historyā€™ does not exist
2020-05-27 10:38:26,192: DEBUG - The log category ā€˜packageā€™ does not exist
2020-05-27 10:38:26,193: DEBUG - The log category ā€˜systemā€™ does not exist
2020-05-27 10:38:26,193: DEBUG - The log category ā€˜accessā€™ does not exist
2020-05-27 10:38:26,193: DEBUG - The log category ā€˜serviceā€™ does not exist
2020-05-27 10:38:26,193: DEBUG - The log category ā€˜appā€™ does not exist
2020-05-27 11:12:16,686: WARNING - Could not monitor disks: Server monitoring is off
Traceback (most recent call last):
File ā€œ/usr/lib/moulinette/yunohost/tools.pyā€, line 757, in tools_diagnosis
disks = monitor_disk(units=[ā€˜filesystemā€™], human_readable=True)
File ā€œ/usr/lib/moulinette/yunohost/monitor.pyā€, line 63, in monitor_disk
glances = _get_glances_api()
File ā€œ/usr/lib/moulinette/yunohost/monitor.pyā€, line 470, in _get_glances_api
raise YunohostError(ā€˜monitor_not_enabledā€™)
YunohostError: Server monitoring is off
2020-05-27 11:12:16,695: WARNING - Could not monitor system: Server monitoring is off
Traceback (most recent call last):
File ā€œ/usr/lib/moulinette/yunohost/tools.pyā€, line 773, in tools_diagnosis
system = monitor_system(units=[ā€˜cpuā€™, ā€˜memoryā€™], human_readable=True)
File ā€œ/usr/lib/moulinette/yunohost/monitor.pyā€, line 255, in monitor_system
glances = _get_glances_api()
File ā€œ/usr/lib/moulinette/yunohost/monitor.pyā€, line 470, in _get_glances_api
raise YunohostError(ā€˜monitor_not_enabledā€™)
YunohostError: Server monitoring is off
2020-05-27 11:12:17,158: DEBUG - Using cached results for meltdown checker, from /tmp/yunohost-meltdown-diagnosis
2020-05-27 11:12:24,511: INFO - Fetching available upgrades for system packagesā€¦
2020-05-27 11:12:24,621: DEBUG -
2020-05-27 11:12:24,623: DEBUG - WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
2020-05-27 11:12:24,623: DEBUG -
2020-05-27 11:12:25,226: DEBUG - Hit:1 http://forge.yunohost.org/debian stretch InRelease
2020-05-27 11:12:25,326: DEBUG - Reading package listsā€¦
2020-05-27 11:12:25,327: DEBUG - Building dependency treeā€¦
2020-05-27 11:12:25,327: DEBUG - Reading state informationā€¦
2020-05-27 11:12:25,327: DEBUG - 2 packages can be upgraded. Run ā€˜apt list --upgradableā€™ to see them.
2020-05-27 11:12:25,343: DEBUG - Done
2020-05-27 11:12:25,343: INFO - Fetching available upgrades for appsā€¦
2020-05-27 11:12:25,344: DEBUG - Attempting to fetch list yunohost at https://app.yunohost.org/apps.json
2020-05-27 11:12:26,680: SUCCESS - Updated the app list ā€˜yunohostā€™
2020-05-27 11:12:49,241: WARNING - The server will reboot
2020-05-27 11:12:49,272: DEBUG - Full log of this operation: ā€˜Reboot your serverā€™

Aleks,

Also, I did the upgrade from the admin web page.

Uuuuh wokay ā€¦ But the log looks like itā€™s only ā€œupdatingā€ and not ā€œupgradingā€ (updating = ā€˜looking for available upgradesā€™)

But uh I guess you clicked on the green upgrade button after this ā€¦ Did anything happen ?

(Or do you have any log in Tools > Logs about previously attempted upgrades ?)

Aleks,

Here are the logs from when I first attempted the upgrade yesterday:

Get:1 http://forge.yunohost.org/debian stretch InRelease [18.2 kB]
2020-05-27 10:38:08,958: DEBUG - Fetched 18.2 kB in 0s (25.8 kB/s)
2020-05-27 10:38:08,958: DEBUG - Reading package listsā€¦
2020-05-27 10:38:08,958: DEBUG - Building dependency treeā€¦
2020-05-27 10:38:08,958: DEBUG - Reading state informationā€¦
2020-05-27 10:38:08,958: DEBUG - 2 packages can be upgraded. Run ā€˜apt list --upgradableā€™ to see them.
2020-05-27 10:38:08,972: DEBUG - Done
2020-05-27 10:38:08,973: INFO - Fetching available upgrades for appsā€¦
2020-05-27 10:38:08,973: DEBUG - Attempting to fetch list yunohost at https://app.yunohost.org/apps.json
2020-05-27 10:38:10,297: SUCCESS - Updated the app list ā€˜yunohostā€™
2020-05-27 10:38:26,192: DEBUG - The log category ā€˜historyā€™ does not exist
2020-05-27 10:38:26,192: DEBUG - The log category ā€˜packageā€™ does not exist
2020-05-27 10:38:26,193: DEBUG - The log category ā€˜systemā€™ does not exist
2020-05-27 10:38:26,193: DEBUG - The log category ā€˜accessā€™ does not exist
2020-05-27 10:38:26,193: DEBUG - The log category ā€˜serviceā€™ does not exist
2020-05-27 10:38:26,193: DEBUG - The log category ā€˜appā€™ does not exist
2020-05-27 11:12:16,686: WARNING - Could not monitor disks: Server monitoring is off
Traceback (most recent call last):
File ā€œ/usr/lib/moulinette/yunohost/tools.pyā€, line 757, in tools_diagnosis
disks = monitor_disk(units=[ā€˜filesystemā€™], human_readable=True)
File ā€œ/usr/lib/moulinette/yunohost/monitor.pyā€, line 63, in monitor_disk
glances = _get_glances_api()
File ā€œ/usr/lib/moulinette/yunohost/monitor.pyā€, line 470, in _get_glances_api
raise YunohostError(ā€˜monitor_not_enabledā€™)
YunohostError: Server monitoring is off
2020-05-27 11:12:16,695: WARNING - Could not monitor system: Server monitoring is off
Traceback (most recent call last):
File ā€œ/usr/lib/moulinette/yunohost/tools.pyā€, line 773, in tools_diagnosis
system = monitor_system(units=[ā€˜cpuā€™, ā€˜memoryā€™], human_readable=True)
File ā€œ/usr/lib/moulinette/yunohost/monitor.pyā€, line 255, in monitor_system
glances = _get_glances_api()
File ā€œ/usr/lib/moulinette/yunohost/monitor.pyā€, line 470, in _get_glances_api
raise YunohostError(ā€˜monitor_not_enabledā€™)
YunohostError: Server monitoring is off
2020-05-27 11:12:17,158: DEBUG - Using cached results for meltdown checker, from /tmp/yunohost-meltdown-diagnosis
2020-05-27 11:12:24,511: INFO - Fetching available upgrades for system packagesā€¦
2020-05-27 11:12:24,621: DEBUG -
2020-05-27 11:12:24,623: DEBUG - WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
2020-05-27 11:12:24,623: DEBUG -
2020-05-27 11:12:25,226: DEBUG - Hit:1 http://forge.yunohost.org/debian stretch InRelease
2020-05-27 11:12:25,326: DEBUG - Reading package listsā€¦
2020-05-27 11:12:25,327: DEBUG - Building dependency treeā€¦
2020-05-27 11:12:25,327: DEBUG - Reading state informationā€¦
2020-05-27 11:12:25,327: DEBUG - 2 packages can be upgraded. Run ā€˜apt list --upgradableā€™ to see them.
2020-05-27 11:12:25,343: DEBUG - Done
2020-05-27 11:12:25,343: INFO - Fetching available upgrades for appsā€¦
2020-05-27 11:12:25,344: DEBUG - Attempting to fetch list yunohost at https://app.yunohost.org/apps.json
2020-05-27 11:12:26,680: SUCCESS - Updated the app list ā€˜yunohostā€™
2020-05-27 11:12:49,241: WARNING - The server will reboot
2020-05-27 11:12:49,272: DEBUG - Full log of this operation: ā€˜Reboot your serverā€™

Aleks,

I noticed all the login errors have to do with Python 2.7. I did upgrade the box to Python 3.6; could this be the problem? I still cannot upgrade. When I click the green button or try apt upgrade from the command line no upgrade occurs. Any idea what I can do? Thanks. Hope you are having a great day.

Aleks,

Actually, it is Python 3.5.3. Any way to get those moulinette python scripts in Python 3 versus Python 2.7?

I know this may not be obvious, but this doesnā€™t have anything to do with python 2.7 vs. 3.6 ā€¦ Just ā€¦ please share the log of any uprade that happens. If ā€œno upgrade occursā€, what happens when you click the button then ā€¦

Alternatively you can try to manually run apt dist-upgrade from the command line but this shouldnā€™t be needed.

Here are the results from the command line:

root@shinevar:~# apt dist-upgrade
Reading package listsā€¦ Done
Building dependency tree
Reading state informationā€¦ Done
Calculating upgradeā€¦ Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@shinevar:~# app update
-bash: app: command not found
root@shinevar:~# apt update
Hit:1 http://forge.yunohost.org/debian stretch InRelease
Hit:2 http://mariadb.mirror.liquidtelecom.com/repo/10.4/debian stretch InRelease
Reading package listsā€¦ Done
Building dependency tree
Reading state informationā€¦ Done
2 packages can be upgraded. Run ā€˜apt list --upgradableā€™ to see them.
root@shinevar:~# apt list --upgradable
Listingā€¦ Done
yunohost/stable 3.8.4.6 all [upgradable from: 3.7.1.3]
yunohost-admin/stable 3.8.3.3 all [upgradable from: 3.7.1.1]
root@shinevar:~# apt upgrade
Reading package listsā€¦ Done
Building dependency tree
Reading state informationā€¦ Done
Calculating upgradeā€¦ Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
:slight_smile:

Aleks,

Okay. Here are the latest log files from the last attempt to upgrade, which did not succeed.

2020-05-29 12:22:34,273: INFO - Now upgrading ā€˜specialā€™ (yunohost-related) packagesā€¦
2020-05-29 12:22:34,339: WARNING - This action will end, but the actual special upgrade will continue in background. Please donā€™t start any other actions on your server the next ~10 minutes (depending on hardware speed). Once done, you may have to log in on the webadmin page again. The upgrade log will be available in Tools ā†’ Log (on the webadmin page) or through ā€˜yunohost log listā€™ (from the command-line).
2020-05-29 12:22:34,340: DEBUG - Running command :
((while [ -f /var/run/moulinette_yunohost.lock ]; do sleep 2; done) && DEBIAN_FRONTEND=noninteractive APT_LISTCHANGES_FRONTEND=none apt-get --fix-broken --show-upgraded --assume-yes -o Dpkg::Options::="ā€“force-confold" -o Dpkg::Options::="ā€“force-confmiss" -o Dpkg::Options::="ā€“force-confdef" dist-upgrade 2>&1 | tee -a /var/log/yunohost/categories/operation/20200529-172234-tools_upgrade.log) && (echo ā€˜Done!ā€™ | tee -a /var/log/yunohost/categories/operation/20200529-172234-tools_upgrade.log && echo ā€˜success: trueā€™ >> /var/log/yunohost/categories/operation/20200529-172234-tools_upgrade.yml) || (echo ā€˜Failed :(ā€™ | tee -a /var/log/yunohost/categories/operation/20200529-172234-tools_upgrade.log && echo ā€˜success: falseā€™ >> /var/log/yunohost/categories/operation/20200529-172234-tools_upgrade.yml); sed -i ā€œs/ended_at: .*$/ended_at: $(date -u +ā€™%Y-%m-%d %H:%M:%S.%Nā€™)/ā€ /var/log/yunohost/categories/operation/20200529-172234-tools_upgrade.yml; echo ā€™
YunoHost package upgrade completed.
Press [Enter] to get the command line backā€™
Reading package listsā€¦
Building dependency treeā€¦
Reading state informationā€¦
Calculating upgradeā€¦
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Done!
2020-05-29 12:22:34,422: DEBUG - The log category ā€˜historyā€™ does not exist
2020-05-29 12:22:34,422: DEBUG - The log category ā€˜packageā€™ does not exist
2020-05-29 12:22:34,422: DEBUG - The log category ā€˜systemā€™ does not exist
2020-05-29 12:22:34,422: DEBUG - The log category ā€˜accessā€™ does not exist
2020-05-29 12:22:34,422: DEBUG - The log category ā€˜serviceā€™ does not exist
2020-05-29 12:22:34,422: DEBUG - The log category ā€˜appā€™ does not exist

Let me know what I can do. Ralph Shinevar

Arlight so letā€™s try to force the upgrade with :

apt install yunohost=3.8.4.6 yunohost-admin=3.8.3.3

Be careful not to accept anything too quickly because Iā€™m expecting apt to complain about other things ā€¦

Hey Aleks,

Here is what apt had to complain about.

root@shinevar:~# apt install yunohost=3.8.4.6 yunohost-admin=3.8.3.3
Reading package listsā€¦ Done
Building dependency tree
Reading state informationā€¦ Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
yunohost : Depends: python-packaging but it is not installable
Depends: python-publicsuffix but it is not installable
E: Unable to correct problems, you have held broken packages.

Alright ā€¦ letā€™s go down the rabbit hole then :

apt install yunohost=3.8.4.6 yunohost-admin=3.8.3.3 python-packaging python-publicsuffix

Hi Aleks,

Here is what I got from the rabbit hole:

root@shinevar:/etc/apt/sources.list.d# apt install yunohost=3.8.4.6 yunohost-admin=3.8.3.3 python-packaging python-publicsuffix
Reading package listsā€¦ Done
Building dependency tree
Reading state informationā€¦ Done
Package python-packaging is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package python-publicsuffix is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package ā€˜python-packagingā€™ has no installation candidate
E: Package ā€˜python-publicsuffixā€™ has no installation candidate

Aleks,

Kept playing with the sources.list. Then did a apt update. Ran the rabbit-hole again and it started updating! Everything is updated. Not sure what did the trick. Then to get the web login to stop with the error I commented out everything out but the yunohost repository. Things are working again.

Aleks,

I get this error when I log in:

Error: 404 Not Found

Sorry, the requested URL ā€˜http://shinevar.nohost.me/diagnosis?locale=enā€™
caused an error:

Not found: ā€˜/diagnosisā€™

Any idea on how to get it to stop? Thanks.

Weeeell assuming yunohost-admin indeed got upgrade, maybe you need to force-refresh the browser cache with Ctrl+Shift+R (on Firefox)

Aleks,

The force-refresh the browser cache has done the trick. No errors when logging in. So happy once again. Hope your day and week is a good one. Ralph.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.