Sunday, May 26, 2013

Auto-update not necessarily good

Following is for my own notes and for anyone that needs 'em. Below is "the hard way" because I couldn't remember the changes that I'd made to the admin account's name and password.

Sat down yesterday to read the various RSS feeds with TT-RSS. Instead of the login screen, was met with a screen with a number of complaints about SPHINX, MEMORY, and a couple about crypto. The one at the top was "FEED_CRYPT_KEY should be exactly 24 characters in length" (it's what I searched with).

The cause turned out to be an automatic update for TT-RSS. The new version didn't like the old config.php file, because it was missing a number of new settings (four, IIRC). This part was easily fixable. I made a backup copy of the old config file (just to be safe), and then copied the new config.php-dist over the old config.php. In short:







cp config.php config.php.bak.20130525
cp config.php-dist config.php

Editing the usual settings in the new config.php fixed the getting-to-the-login screen issue, but I still couldn't log in. Instead, TT-RSS started responding with "Your access level is insufficient to run this script." The script remained unnamed.

A little bit of research later, it turned out that I needed to change a setting in the database. What was happening was that the new code was attempting to update the database schema but my account didn't have sufficient access to the MariaDB database.

With apologies to Postgres users, the following fix is for TT-RSS users who employ a MySQL or MariaDB back-end. In short, access the database from the command line and run the following:







use ttrss;
select id,login,access_level from ttrss_users;
update ttrss_users set access_level=10 where id=2;
quit

Of course, you'll need to edit the above to suit your own instance. The purpose of the select line was to check the access_level for my account. The update line gives my login admin-level access. The next time I logged in, I followed the prompts, TT-RSS updated the database, and everything went back to normal and I was able to log in.

To clean up, you'll need to set your access level back to the original value. Use the above steps to change access_level back to 0 (for a regular user account) or 5 (for a power_user account). An alternative would be to use preferences to reset the admin account password, log in with that account, and use "Preferences - Users" to change your user account's access back to that for a normal user.

The above needed to be done because I couldn't remember the admin username and password. If you do remember it, when TT-RSS complains about insufficient access, just log in with the admin credentials and skip the changes to the database.