Failed Backup Restore and Manual Recovery Issues with my_webapp__2: App Visible but Not Loading Properly After Restoration

My YunoHost server

Hardware: HP Proliant DL360 64BIT PLATFORM
YunoHost version: 11.2.29
I have access to my server: Through SSH and the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: Yes
If yes, please explain: The YunoHost instance is installed on an HP Proliant DL360, which is behind a VPS. I encountered issues while trying to restore a web app (my_webapp__2) and had to manually intervene in the restoration process.

Description of my issue

I found out that my website hosted on my_webapp__2 was giving 404 errors on subpages. To resolve this, I decided to restore a known working backup. However, the restoration process failed.

1. Initial Attempt to Restore:

  • Issue: The restoration process failed (as indicated in the YunoHost error log). I attempted to restore another backup, but that also failed.
  • Actions Taken:
    • I downloaded the backup file and manually checked its contents. I noticed that all files were present except for settings.yml and config_panel.toml.
  • Outcome: The absence of these files indicated that the restoration process couldn’t be completed successfully.

2. Manual Restoration Process:

  • Actions Taken:
    • File Restoration: I manually restored the missing files by copying them from another app (my_webapp__3), which had similar configurations.
    • Configuration Files Involved:
      • /etc/yunohost/apps/my_webapp__2/settings.yml
      • /etc/yunohost/apps/my_webapp__2/config_panel.toml
      • NGINX config: /etc/nginx/conf.d/compannie.com.d/my_webapp__2.conf
      • PHP-FPM config: /etc/php/8.2/fpm/pool.d/my_webapp__2.conf
  • Outcome: The files were successfully restored and adjusted, but the app did not appear in the YunoHost user panel.

3. Adjusting Permissions and Ownership:

  • Actions Taken:
    • Set permissions and ownership to ensure the web server could access the app files:
sudo chown -R www-data:www-data /var/www/my_webapp__2
sudo chmod -R 755 /var/www/my_webapp__2
  • Outcome: Permissions were set correctly, but the app was still not visible in the user panel.

4. Regenerating YunoHost Configurations:

  • Actions Taken:
    • Regenerated YunoHost configurations using:
yunohost tools regen-conf --force
  • Outcome: After regenerating the configurations, the app became visible in the YunoHost admin section but wouldn’t load correctly when accessed.

5. Managing App Permissions:

  • Actions Taken:
    • Attempted to add permissions for users to access my_webapp__2 using:
yunohost user permission add my_webapp__2.main -g visitors
  • Outcome: Commands did not execute as expected, possibly due to syntax issues or YunoHost version limitations.

6. Consulting Logs and Forums:

  • Actions Taken:
    • Checked logs:
      • NGINX logs: /var/log/nginx/error.log
      • PHP-FPM logs: /var/log/php8.2-fpm.log
      • YunoHost API logs: /var/log/yunohost/yunohost-api.log
    • Looked up related issues on the YunoHost forum.
  • Outcome: Logs provided insight into errors, but no definitive solution was found.

7. Backup Restore Error Encountered:

  • Issue: During the restoration of my_webapp__2, I encountered an error where the restore process failed due to a missing db.sql file, even though a db.sql* file was present.
  • Error Log:
2024-08-31 15:39:49,609: WARNING - /var/cache/yunohost/app_tmp_work_dirs/app_3fu6bkqt/restore: regel 32: ./db.sql: Bestand of map bestaat niet
2024-08-31 15:39:49,609: DEBUG - + ynh_exit_properly
2024-08-31 15:39:49,609: DEBUG - + [[ restore =~ ^install$|^upgrade$|^restore$ ]]
2024-08-31 15:39:51,112: ERROR - De app 'my_webapp__2' kon niet worden terug gezet: Er ging iets mis in het helstelscript van de app
  • Context:
    • The backup system was not creating backups of certain files correctly, which led to issues during the restore process.

Request for Help:

Despite following these steps, my_webapp__2 still does not load correctly in the YunoHost user panel, and I encountered an error during the restore process. I need guidance on how to resolve this issue, whether it’s related to permissions, visibility settings, or the backup/restore process.

Any insights or suggestions would be greatly appreciated. Thank you!

I have had something similar, there was a version with an error with db.sql* but it have been fixed here :

Perhaps you can just try found were the db.sql* file is in the tar backup and rename it to db.sql

In my case I have resinstall a my_webapp, sync files I have backup before, give them the correct permissions and do an manual import of the db…

Normally the owner is my_webapp: but perhaps your application need www-data ?

1 Like

If I do that I get this error:

Could not load info for archive '/mnt/backup/my_webapp__2-pre-upgrade1.tar.gz'… The info.json file cannot be retrieved (or is not a valid json).

The info .json in inside the root of the backup folder is the same as inside the .tar.gz backup file.

To fix it now, I reinstalled the app as a new one, then I moved the files from the backup in var/www/my_webapp__2 did the database thingy and it was fixed. No thanks too the backup bug!

Ok,
if you still have your file my_webapp__2-pre-upgrade1.tar.gz perhaps it needs also found inside the the path apps/my_webapp__2/settings/scripts/backup and correct the typo db.sql* to db.sql

Well not easy, we have been both unlucky with this very short “star from nowhere”…

Nice if you have found how resolve it.

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