I've just upgraded Organizr through AtoMiC-Toolkit; sorry to say I didn't notice what version it was before the upgrade... After the upgrade I kept getting the following error:
Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1 no such table: invites in /var/www/organizr/settings.php:30 Stack trace: #0 /var/www/organizr/settings.php(30): PDO->query('SELECT * FROM i...') #1 {main} thrown in /var/www/organizr/settings.php on line 30
Checking line 30 of settings.php, it was trying to get data from a table called invites, but at that point my users.db only had the tables user, tabs and options.
I found the "create table" script in functions.php, which I then ran manually to create the table. After this, the error went away and my settings tab is loading again.
I would've expected the DB to be upgraded automatically, but in my quick searching now, I can't see any functionality in the PHP scripts that would do this.. Did I miss something?
I wonder how atomik is handling the update.
the DB update is called inside the function upgradeCheck()
Specifically here:
// Upgrade to 1.40
$config = loadConfig();
if (isset($config['database_Location']) && (!isset($config['CONFIG_VERSION']) || $config['CONFIG_VERSION'] < '1.40')) {
// Upgrade database to latest version
updateSQLiteDB($config['database_Location'],'1.38');
// Update Version and Commit
$config['CONFIG_VERSION'] = '1.40';
copy('config/config.php', 'config/config['.date('Y-m-d_H-i-s').'][1.38].bak.php');
$createConfigSuccess = createConfig($config);
unset($config);
}
upgradeCheck() is called at the beginning of index.php
Before you manually ran it, did it create any backups?
Looking through AtoMiC-Toolkit's "Organizr" install script, it looks like it tries to make a backup in the inc/app-move-precious.sh script, but I can't find that folder on my server.
Basically though, it looks like the idea here is to remove the existing folder (in this case, /var/www/organizr) and then clone a new copy with --depth 1 to the same path. My DB is outside of this folder, so that wasn't affected at all by this process.
Could this be because the folder is removed and then re-cloned during the process, rather than simply updating the app in-place?
Although, thinking about it now, I chose to upgrade the app through the toolkit, which means it would've used the inc/app-git-update.sh script, not inc/app-git-download.sh. This runs git fetch --all, then git pull, so perhaps it didn't create a backup (which is why I can't find it) and it did actually upgrade in-place.
hmmmm
on next upgrade can you try upgrading within the org?
Yeah, will do. It's been working perfectly since adding the table, so that's all good. (:
Maybe label this one as "on hold" or something like that, then I'll just drop a message here when I next upgrade.
awesome! thanks
I found the "create table" script in functions.php, which I then ran manually to create the table. After this, the error went away and my settings tab is loading again.
Can you tell me how you did this? I am trying to pull up functions.php in my web browser and it comes up blank but I also don't know what I am doing so that is probably not what I am supposed to be trying to do. Thanks!
@RyanWor did the update not work for you?
It probably did but I had an issue with my database and had to restore from backup. I am probably using a backup from before the update I just applied recently. I tried forcing the database to be upgraded again at updatedb.php but the issue still is occuring regarding the invites table.
change the config version in config.php to 1.35 or something
@RyanWor, to force the DB update I think this is what you need: stop your Organizr service, edit the /var/www/organizr/config/config.php file and change the CONFIG_VERSION to 1.35. Then start Organizr and it should run the update script for you.
@ZaLiTHkA is correct. Sorry i was in a hurry when i wrote that.
Thanks for the help guys that seems to have worked and I now have my settings tab again. Much appreciated!
Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1 no such table: invites in /var/www/organizr/settings.php:30 Stack trace: #0 /var/www/organizr/settings.php(30): PDO->query('SELECT * FROM i...') #1 {main} thrown in /var/www/organizr/settings.php on line 30
This is driving me crazy. I tried changing the config version. No dice
@YellowGTO was this from an update? or when did this happen for you?
I'm pretty sure this was a fresh install. It is possible I installed it and forgot about it awhile ago. It was via the atomic script.