Support

Site Restoration

#38035 UNiTE 5.0.1-dev202211030845-rev87303ab error

Posted in ‘Site restoration’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

PHP version
7.4
CMS Type
Joomla!
CMS Version
4.2.4
Backup Tool Version
9.4.2
Kickstart version
n/a

Latest post by nicholas on Tuesday, 06 December 2022 11:39 CST

ascplweb

Like another user reported, I received the "argument must be of type array" error restoring with Unite 5.0.0 . When I restored with 5.0.1-dev202211030845-rev87303ab , that error did not come up, but instead I got:

PHP Notice: Undefined index: sqlfile in .../installation/framework/database/restore.php on line 643
PHP Notice: fgets(): read of 8192 bytes failed with errno=21 Is a directory in .../installation/framework/database/restore.php on line 881
100/100 100%[INFO ] Reconfiguring Joomla

Despite them only being notices, the site still displayed:

Sorry, there was a problem we could not recover from. The server returned a "500 - Whoops, looks like something went wrong."

Also even though Unite claimed that reconfiguration worked, configuration.php was untouched. So I checked the database and found that un-restored.

nicholas
Akeeba Staff
Manager

I have ran several tests using backups taken with 9.4.2. I cannot reproduce this issue. I have no notices, my database restores correctly, and my configuration.php is updated just fine.

Reading the code, the only way this can happen is if there is a discrepancy between the version of the backup engine and the restoration script (the installation/databases.json file would not have the sqlfile key). This can only happen if Joomla failed to update the component correctly which does happen, see https://github.com/joomla/joomla-cms/issues/38956 for the latest installment of my saga trying to address this issue in Joomla. Now, if they let me fix it that would be grand; I've only spent the last 8 years chasing this issue down.

Please install Akeeba Backup 9.4.2 twice in a row on your site, without uninstalling it before or in between. Take a new backup and try restoring that instead.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

ascplweb

Thanks for your prompt reply, Nicholas. I did leave one thing out of the original ticket and that is I was able to restore this backup using Kickstart with not problem. It's just using Unite where this issue pops up. Any ideas why that would be?

I'm going to try the double install trick and see what happens. Since I'm trying to use Unite for deployment, I was wondering if there's a way to detect a mismatch in advance of restoration (since we're not normally updating Akeeba right before a backup/restore).

nicholas
Akeeba Staff
Manager

UNiTE doesn't have its own restoration method; it uses the ANGIE installer which is embedded in the archive. This is intentional. It allows us to address new versions of Joomla, WordPress, MySQL, and PHP by writing code in one place only. Otherwise we'd have to essentially maintain two restoration scripts which doubles the work and the chance of introducing a subtle bug.

The error you got comes from ANGIE, not UNiTE. The path .../installation/framework/database/restore.php is inside the restored site, not inside UNiTE's PHAR archive. This happens because the sqlfile key for the current database is missing.

It's not a matter of UNiTE not having ran the initial ANGIE step which reads the installation/sql/databases.json file as that would have caused no database data to be available, with the immediate result that the database restoration would fail with an error, failing the entire restoration run. It means that something is missing from the databases.json file.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

ascplweb

If the SQL key is missing from the archive, then why does it restore with kickstart, since they use the same restoration script?

nicholas
Akeeba Staff
Manager

ANGIE used to use a databases.ini file, then moved to databases.json. A different file format. Moreover, at a later point in time we added one more key, sqlfile, in the databases.json file.

So, we have one the following problems:

  • Your backup engine produces databases.ini but ANGIE expects database.json
  • Your backup engine produces database.json without the sqlfile key but ANGIE expects all keys

That's why on November 16th I told you

> Reading the code, the only way this can happen is if there is a discrepancy between the version of the backup engine and the restoration script (the installation/databases.json file would not have the sqlfile key).

After doing the double installation you must take a new backup archive and try to restore that new backup archive. Any existing archive would not be updated.

Kickstart does not restore your site, it only extracts the backup archive which contains ANGIE. It's ANGIE which restores your site. Kickstart is irrelevant. ANGIE on the web also makes another assumption if the sqlfile is missing, that it should be filled in with the value "site". This happens in a part of the code which is not executed by UNiTE. So if the key is missing ANGIE on the web might work (only for the main site database, though!) and UNiTE won't.

That's why I need you to install Akeeba Backup twice in a row without uninstalling it before or in between, then take a new backup, then try to restore the new backup. When I use a brand new Joomla 4 site with the latest released version of Akeeba Backup I can restore it with the latest dev build of UNiTE. If you still have a problem restoring I'll have you test with the dev build of UNiTE so we can be certain what the problem is. There is a reason I am asking you to do things. I am not following a script, I have a decision tree in my head with branches six levels deep but I don't want you to get confused by dumping this on you. I am instead asking you to do the fastest, minimum fuss troubleshooting steps so I can narrow down the issue.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!