digitalmethodsinitiative / dmi-tcat

Digital Methods Initiative - Twitter Capture and Analysis Toolset
Apache License 2.0
367 stars 114 forks source link

Out-of-date database #132

Closed bornakke closed 9 years ago

bornakke commented 9 years ago

Hi,

On one of our tcat instances we keep getting the following error:

Your database is out-of-date and needs to be upgraded to fix bugs. Follow the documentation and run the command-line script common/upgrade.php from your shell.

We have tried to run the upgrade.php script, but the message keep staying there. Do you have any idea as to why this error happens?

Best Tobias

dentoir commented 9 years ago

Hi Tobias,

I assume you have answered 'y' on all questions during command-line execution of the upgrade.php script?

Actually most upgrades create new features. The message regarding bug fixes should be resolved after anwering yes to the following question: Changing column type for column user_id in table tcat_query_bins_users

If you tried this already, please provide a print log of your script execution.

Cheers,

Emile

bornakke commented 9 years ago

Yes I have answered y on all questions.

Which script do you referer to? The upgrade script simply prints out two lines:

/dmi-tcat/common$ php upgrade.php 2015-09-15 11:27:48 Running in interactive mode 2015-09-15 11:27:48 Executing global upgrade

dentoir commented 9 years ago

Does anything show up in your PHP/Apache error logs when you are running the upgrade script?

Could you perhaps run the MySQL query "SHOW FULL COLUMNS FROM tcat_query_bins_users" on your database server? This should produce the internal table structure which is supposed to be fixed.

bornakke commented 9 years ago

No error in apache error log. Running the suggested code returns:

tcat_ogtal_dk___localhost___twittercapture___phpmyadmin_4_0_10deb1

However i'm starting to think that the easiest might be to manually adapt the database (since I seem to be the only one with the problem).

dentoir commented 9 years ago

Okay, I just thought of this: Did you perhaps create the database under a different user and does the mysql account specifed in config.php actually have rights to issue an ALTER TABLE?

limogin commented 9 years ago

I have the same problem. I will follow the procedure described here https://github.com/digitalmethodsinitiative/dmi-tcat/wiki/Upgrading-TCAT#upgrading-database-tables

the table description for tcat_query_bin_users will be:

mysql> SHOW FULL COLUMNS FROM tcat_query_bins_users;
+-------------+----------+-----------+------+-----+---------+----------------+---------------------------------+---------+
| Field       | Type     | Collation | Null | Key | Default | Extra          | Privileges                      | Comment |
+-------------+----------+-----------+------+-----+---------+----------------+---------------------------------+---------+
| id          | int(11)  | NULL      | NO   | PRI | NULL    | auto_increment | select,insert,update,references |         |
| starttime   | datetime | NULL      | YES  | MUL | NULL    |                | select,insert,update,references |         |
| endtime     | datetime | NULL      | YES  | MUL | NULL    |                | select,insert,update,references |         |
| user_id     | int(11)  | NULL      | YES  | MUL | NULL    |                | select,insert,update,references |         |
| querybin_id | int(11)  | NULL      | YES  | MUL | NULL    |                | select,insert,update,references |         |
+-------------+----------+-----------+------+-----+---------+----------------+---------------------------------+---------+

The mysql user has alter table privileges too. And I continue with the same message "Your database is out-of-date and needs to be upgraded to fix bugs. Follow the documentation and run the command-line script common/upgrade.php from your shell."

Alternatively, I think that the upgrade method in upgrade.php can also show the differences beetwen current database and the new database to trace any problem.

ErikBorra commented 9 years ago

Hi @limogin,

did you get the latest code and run the upgrade script?

Best,

Erik

limogin commented 9 years ago

Hi @ErikBorra, yes I have made a

$ git pull origin master 

but with the same result.

ErikBorra commented 9 years ago

Hi Limogin,

when did you last pull the code? I have merged some changes yesterday. Did you also run the upgrade script?

Best,

Erik

limogin commented 9 years ago

Hi Erik,

I have made a pull this morning too

Regards,

Victor.

ErikBorra commented 9 years ago

Hi Victor,

did you try running the upgrade script after your most recent pull? Does TCAT capture data and do the analysis and capture (web) interfaces work?

Best,

Erik

limogin commented 9 years ago

Yes, I execute the upgrade script after the last pull. The web interface is running correctly and the capture data too. It exists new data captured.

ErikBorra commented 9 years ago

Hi Limogin,

Good to hear that apart from the message everything is working fine. Have you answered 'no' to any of the questions of the upgrade script (this is perfectly fine to do ;)? If so, it might be that our checks for checking the up-to-dateness of the database are to stringent.

Best,

Erik

limogin commented 9 years ago

The upgrade script was run directly without offering any questions. In this case, do you think that I can consider that the database is functioning well?.

Thanks,

Victor.

ErikBorra commented 9 years ago

Hi Victor,

the upgrade script should be run from the command line and will ask you some questions. See our wiki entry on (upgrading tcat](https://github.com/digitalmethodsinitiative/dmi-tcat/wiki/Upgrading-TCAT) for detailed instructions.

Best,

Erik

limogin commented 9 years ago

Yes, correct, I have followed the same process from command line. Stop backgrounds process and execute in the same order

$ cd common/
$ screen
$ php upgrade.php

And then uncomment in the crontab the call

* * (cd /var/www/dmi-tcat/capture/stream/; php controller.php)

Regards,

Victor.

ErikBorra commented 9 years ago

I am out of suggestions. As everything is running fine (apart from that message) I suggest we wait until @dentoir is back :)

limogin commented 9 years ago

ok, thanks for your attention, it look forward then.

Regards,

Victor.

dentoir commented 9 years ago

Thank you for the bug reports. I think the latest commit b3a9425 should now fix this issue. Please run the common/upgrade.php script again and this time it will ask the proper question.

ErikBorra commented 9 years ago

Hi @bornakke, @limogin,

did you have a chance to test the fix by @dentoir?

Best,

Erik

bornakke commented 9 years ago

Hi Erik,

It seems to fix the issue. However now I'm stuck with a new message:

"A newer version of TCAT is available. You can get the latest code via git pull. Please read the documentation for details. [ commit #7d969b7... - Fix order of arguments to timeout ]"

I have already git pull'ed and killed any running controller processes.

limogin commented 9 years ago

Hi Erik,

I have made a pull with your new release, I do not see the warning message to update. Great.

Thanks,

Victor.