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.