No access to Zoph after restore from Backup

Hello everyone;

After fresh installation of FreedomBox on my RasPi 4 with the same admin Profile, restore zoph and try to log in i get this message. Do i have to clear a cache?

Fatal Error : Unable to get records: SQLSTATE[HY000] [1045] Access denied for user ‘zoph_rw’@‘localhost’ (using password: YES) zophTable.inc.php: 628.
fatal error

FreedomBox Version 22.14

Solution for me was uninstall Zoph with

sudo su -
apt install sqlite3
echo “delete from plinth_module where name=‘zoph’;” | sqlite3 /var/lib/plinth/plinth.sqlite3
apt purge zoph

and then reinstall Zoph with Plinth. Now i am able to login to my 5000 pictures. I am very happy :smiley: . By the way: Zoph is fantastic. The Combination of Picture Organizing and Genealogy by connecting People to the Fotos is really Unique. Thank you Jeroen Roos!

5 Likes

Hello,
same Problem after restore from Backup :frowning:
After fresh installation of FreedomBox on my Pioneer FB with the same admin Profile, restore zoph i get this

Fatal Error : Unable to get records: SQLSTATE[HY000] [1045] Access denied for user ‘zo
ph_rw’@‘localhost’ (using password: YES) zophTable.inc.php: 628.
fatal error

if i try the soloution from last Year:

sudo apt remove zoph && sudo echo "delete from plinth_module where name=‚zoph;“ | sudo sqlite3 /var/lib/plinth/plinth.sqlite3

and reinstall zoph with plinth i cannot run the zoph Setup. Have any of you had a similar problem? Is it possible to run this setup in the console? Any hint welcome

Zoph Setup fails after restore. Same FB, same Username/Password. Before i restored Zoph from Backup i had installed Zoph on the new FB and also run its Setup. Than i restored Zoph but under Applications/Zoph the reqired Setup fails without a message. If i try https://myFB/zoph i get the message:

Fatal Error : Unable to get records: SQLSTATE[HY000] [1045] Access denied for user ‘zoph_rw’@‘localhost’ (using password: YES) zophTable.inc.php: 628.
fatal error

How can i give the user zoph_rw Access for localhost? When I search for this error message on the net I often get the tip that you should replace 127.0.0 by localhost in a PHP file (or vice versa) but I can’t find where? It certainly has to do with mysql and/or apache but my knowledge is simply not enough. I would be grateful for any hint.

Hello everyone,
What I tried: After reinstalling the FB Zoph installed and ran (zoph)setup. After reinstalling Zoph installs without running setup. To give the Mysql database user zoph_rw all rights to localhost. To delete and recreate the user. Delete the database and restore it from backup. Replace the password in the zoph.ini with the password from the backup. Unfortunately, none of my attempts were successful. If I interpret the outputs correctly, the user has zoph_rw access to localhost. What else can I try?

Hello to all Zoph Enthusiasts,
After I had restored Zoph from the backup I could unfortunately not execute the Plinth Setup Script successfully and got the error message again and again when trying to log in. In the end, the solution for me was to delete the database user zoph_rw and recreate it with the password from the zoph.ini file. This is after unpacking the Zoph backup in /etc/zoph.ini. After that, I was able to run the setup in Plinth and had access to Zoph again. I hope this solution helps you if you ever need to restore Zoph.
For me, the problem is solved for this time

login (as root with sudo su -)

> mysql -u root -p
> DROP USER 'zoph_rw'@'localhost';
> CREATE USER 'zoph_rw'@'localhost' IDENTIFIED BY 'Password_from_Backup_file in /etc/zoph.ini';
> FLUSH PRIVILEGES;
> exit
> service mysql restart
2 Likes

My Problem is back. Restore Zoph from Backup fails…

I try to setup a FreedomBox in a Virtualbox and restore Zoph from a backup. The new FreedomBox has the same user/password as the old, running latest stable version with zoph installed. I restore from Backup an get:

Fatal Error : Unable to get records: SQLSTATE[HY000] [1045] Access denied for user ‘zoph_rw’@‘localhost’ (using password: YES) zophTable.inc.php: 628.
fatal error

All my “solutions” that I described earlier do not help. They were also just the result of many unprofessional attempts that worked randomly at some point. Maybe someone who has more knowledge about databases can help me?
There is no better photo organizer for me than Zoph, but because I invest so much time in it, it is important that a backup is also possible

Kind Regards to the Community

I’m not very familiar with Zoph but I duplicated the problem in a container and I think I see a gap in the Zoph backup/restore process. I created issue #2346 for it, but the gist is that while zoph.ini is backed up and restored, zoph_rw is in the mysql system database and doesn’t get backed up, so the password for zoph_rw in zoph.ini ends up out of sync with password in the database.

The simplest workaround seems to be to make the password in zoph.ini agree with the password in the database. One way is to save off /etc/zoph.ini after installing Zoph on the fresh FreedomBox but before running Restore, and then overwrite the restored version with the saved off version after doing the restore. If restore has already been run and zoph.ini is the restored version, you can still pick out the new password (dbc_dbpass) from /etc/dbconfig-common/zoph.conf, because during Zoph installation it gets written there as well as to zoph.ini. You can then edit zoph.ini and set db_pass to the new password rather than the restored password.

3 Likes

Your workarround works pretty good for me after the last restore of my Zoph. Maybe someone should remove my previous helpless attempts and solutions. But at the first start with Bookworm Zoph came up with this errorlist because of the new PHP-Version:

i changed in /etc/php/8.2/fpm/php.ini according to the recommendations and it works now. Is this the right way to fix the Problem or is there a better way :slight_smile:

1 Like

It’s a known issue (see #2345 zoph: Failed requirements on Bookworm), and I don’t think there’s currently a better workaround than the one you found.