Migration Fail: API doesn’t work

What type of hardware are you using: Raspberry Pi 3, 4+
What YunoHost version are you running: I don’t know - can’t access.
How are you able to access your server: The webadmin
SSH
Are you in a special context or did you perform specific tweaking on your YunoHost instance ?: I tried doing the 11 → 12 Upgrade.

Describe your issue

Hello,

I’m experiencing issues and need technical support. Yesterday, I attempted to upgrade my Raspberry Pi from YunoHost 11 to 12, but the migration process failed due to an internet connection loss. After the failure, I restarted the server.

Currently, the YunoHost API is not functioning, and I’m unable to reinitiate the migration process. It gives be a 502 Error. I still have SSH access to the server, though.​​​​​​​​​​​​​​​​

Share relevant logs or error messages

Fehler: “502”
Aktion: “GET” /yunohost/api/installed?locale=de

Fehlermeldung:
Die YunoHost-API antwortet nicht. Vielleicht ist ‘yunohost-api’ ausgefallen oder wurde neu gestartet?

When trying to access the API from the command line I get this error:

Traceback (most recent call last):
File “/usr/lib/python3.11/logging/config.py”, line 389, in resolve
found = getattr(found, frag)
^^^^^^^^^^^^^^^^^^^^
AttributeError: module ‘moulinette.interfaces’ has no attribute ‘api’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3.11/logging/config.py”, line 391, in resolve
self.importer(used)
File “/usr/lib/python3/dist-packages/moulinette/interfaces/api.py”, line 16, in
from bottle import request, response, Bottle, HTTPResponse, FileUpload
File “/usr/lib/python3/dist-packages/bottle.py”, line 44, in
from inspect import getargspec
ImportError: cannot import name ‘getargspec’ from ‘inspect’ (/usr/lib/python3.11/inspect.py)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/usr/lib/python3.11/logging/config.py”, line 562, in configure
handler = self.configure_handler(handlers[name])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/logging/config.py”, line 724, in configure_handler
klass = self.resolve(cname)
^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/logging/config.py”, line 396, in resolve
raise v from e
ValueError: Cannot resolve ‘moulinette.interfaces.api.APIQueueHandler’: cannot import name ‘getargspec’ from ‘inspect’ (/usr/lib/python3.11/inspect.py)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/usr/bin/yunohost”, line 77, in
yunohost.cli(
File “/usr/lib/python3/dist-packages/yunohost/init.py”, line 35, in cli
init_logging(interface=“cli”, debug=debug, quiet=quiet)
File “/usr/lib/python3/dist-packages/yunohost/init.py”, line 168, in init_logging
configure_logging(logging_configuration)
File “/usr/lib/python3/dist-packages/moulinette/utils/log.py”, line 67, in configure_logging
dictConfig(logging_config)
File “/usr/lib/python3.11/logging/config.py”, line 812, in dictConfig
dictConfigClass(config).configure()
File “/usr/lib/python3.11/logging/config.py”, line 569, in configure
raise ValueError('Unable to configure handler ’
ValueError: Unable to configure handler ‘api’

I’ve now tried to get everything running again by performing an upgrade via APT. Initially, it had to repair DPKG in some way, and then it completed the upgrade as usual. Afterwards, I simply restarted the API using systemctl. However, I’m now seeing several error messages in the diagnostics. Among them, it states that the server might not be reachable under the IPv4 address. Additionally, the migration still cannot be performed at all.

I tried once more to troubleshoot everything and specifically focused on getting DNSMasq running again. I reinstalled it using AI tools that guided me through the steps, as I’m not particularly tech-savvy. Unfortunately, the migration continues to fail, and there are still issues with resolving DNS addresses. I’ll share my complete log on another site, as it’s not possible for me to upload it to Yunopaste.

Log: tchncs

Warning: E: Sub-process /usr/bin/dpkg returned an error code (1)
Warning: dpkg: error processing package fontconfig (--configure):
Warning:  package is in a very bad inconsistent state; you should
Warning:  reinstall it before attempting configuration

so the issue seems to be with “fontconfig” which in turn causes other error … Naively I would try something like sudo apt install fontconfig --reinstall (and share what is displays if that doesnt fix the situation)

In parallel you’re having DNS resolution issue which may be related to the fact that you’re in some intermediate state … Temporarily you may want to echo 'nameserver 8.8.8.8' | sudo tee /etc/resolv.conf to get back a working DNS resolution (without which apt and yunopaste may not work)

Thank you for the help!
I tried both. My biggest problem right now is that I can’t get the website to really load. I see the login page, but can’t get further because of an „ Safari can’t open the page because the network connection was broken.“ error. :confused:

Hey!
Still… DNS doesn’t really work. I tried to get everything to work but it really doesn’t. I tried to reset the config, write a own version, but it just resets itself everytime.
Additionally, I get spammed with emails that Yunohost can’t update it’s IP and the fact, that there is an invalid version for each app on my server.

It’s been 8 days, I don’t remember where we left at … does sudo yunohost --version works ? Does sudo apt full-upgrade report that everything is up to date ?

It’s okay! Sorry for me to reply so late.

sudo yunohost --version shows me:


yunohost: 
  repo: stable
  version: 11.3.0.2
yunohost-admin: 
  repo: stable
  version: 11.3.0
moulinette: 
  repo: stable
  version: 11.3.0
ssowat: 
  repo: stable

The full upgrade command always fails because of php 8.2:

Job for php8.2-fpm.service failed because the control process exited with error code.
See "systemctl status php8.2-fpm.service" and "journalctl -xeu php8.2-fpm.service" for details.
invoke-rc.d: initscript php8.2-fpm, action "restart" failed.
● php8.2-fpm.service - The PHP 8.2 FastCGI Process Manager
     Loaded: loaded (/lib/systemd/system/php8.2-fpm.service; enabled; preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Thu 2024-11-21 10:56:53 GMT; 21ms ago
       Docs: man:php-fpm8.2(8)
    Process: 2508019 ExecStart=/usr/sbin/php-fpm8.2 --nodaemonize --fpm-config /etc/php/8.2/fpm/php-fpm.conf (code=exited, status=78)
    Process: 2508020 ExecStopPost=/usr/lib/php/php-fpm-socket-helper remove /run/php/php-fpm.sock /etc/php/8.2/fpm/pool.d/www.conf 82 (code=exited, status=0/SUCCESS)
   Main PID: 2508019 (code=exited, status=78)
        CPU: 169ms
dpkg: error processing package php8.2-fpm (--configure):
 installed php8.2-fpm package post-installation script subprocess returned error exit status 1
Setting up php8.3 (8.3.14-1+0~20241121.47+debian12~1.gbpc8bfb4) ...
dpkg: dependency problems prevent configuration of php8.2:
 php8.2 depends on libapache2-mod-php8.2 | php8.2-fpm | php8.2-cgi; however:
  Package libapache2-mod-php8.2 is not installed.
  Package php8.2-fpm is not configured yet.
  Package php8.2-cgi is not installed.

dpkg: error processing package php8.2 (--configure):
 dependency problems - leaving unconfigured
Setting up rpi-eeprom (26.4-1) ...
Setting up raspi-config (20241119) ...
insserv: FATAL: service mountkernfs has to be enabled to use service raspi-config
Processing triggers for man-db (2.11.2-2) ...
Errors were encountered while processing:
 php8.2-fpm
 php8.2
E: Sub-process /usr/bin/dpkg returned an error code (1)

Hey, still doesn’t work. Any ideas?