User:Icyflame/Slack Conversations

From Metakgp Wiki
Jump to navigation Jump to search

We are on Slack's free plan, so we can only see the latest 10,000 messages. As people send more and more messages, old threads go away and become harder to find.

2019-12-05: ArticleFeedback extension not working[edit | edit source]

Thread
meta-x
Berserker Nov 25th at 17:37
Recently in the Article Feedback Log (https://wiki.metakgp.org/w/Special:Log/articlefeedbackv5), opening any feedback post submitted by anyone results in some sort of Database Error.
The following image is the error I see when I open this feedback
https://wiki.metakgp.org/w/Special:ArticleFeedbackv5/HS30087:_Economics_Of_Growth/05ba646b6601674f62e7ed15c72b3134Is this behaviour expected?
Screenshot from 2019-11-25 14-08-03.png 
Screenshot from 2019-11-25 14-08-03.png
32 replies
icyflame:snow_capped_mountain:  7 days ago
No! I have been wanting to investigate this, I am not really sure what's going wrong here. I tried to ssh in and look at the logs, but nothing particular stood out. :cold_sweat:
Berserker  7 days ago
Any ideas to investigate this?
icyflame:snow_capped_mountain:  7 days ago
SSH-ing into the server and looking at the logs for the Nginx, PHP and MySQL container to see if any obvious errors logs are printed would be a good first step. Let me know if you face any trouble trying to do that, perhaps it would be useful if two people looked at it together. (edited) 
Berserker  7 days ago
Will report in this thread only if some new findings are there on my side.
icyflame:snow_capped_mountain:  2 hours ago
Ah, I looked at the page without logging in and it works properly!https://wiki.metakgp.org/w/Special:ArticleFeedbackv5/Main_Page/059b77dd7829c36ca4b3ed15c72b3134^ This page works fine if you open it in a browser where you aren't logged in! I was always logged in so I never realized that it works for some people.I added some feedback and that worker properly too. So, the only problem seems to be viewing feedback as a logged in user :thinking_face:
icyflame:snow_capped_mountain:  2 hours ago
I can see the 500 on the PHP container's logs, at least

172.27.0.2 -  04/Dec/2019:19:19:02 +0530 "GET /w/Special:ArticleFeedbackv5/Main_Page/05bb44a09d81674f62e7ed15c72b3134" 500

icyflame:snow_capped_mountain:  2 hours ago
I can't see any logs on the MySQL container that could tell us what was wrong with the query that's being run. I have to probably turn on more debugging logs. let me try that on local (I haven't setup the articleFeedback extension before though, so might take some time)
icyflame:snow_capped_mountain:  1 hour ago
Okay, looks like a table might just be missing from our database :cold_sweat:https://www.mediawiki.org/wiki/Topic:U26n1a1pgo0078tt
icyflame:snow_capped_mountain:  1 hour ago
Let me try to deploy locally with the appropriate debug options

$wgShowExceptionDetails = true;
$wgShowDBErrorBacktrace = true;
$wgShowSQLErrors = true;

icyflame:snow_capped_mountain:  1 hour ago
Actually, the MySQL server might record queries that threw an error somewhere inside itself. Let me check if there is such a DB first.
icyflame:snow_capped_mountain:  1 hour ago
Interesting, information_schema.processlist is empty! (edited) 
icyflame:snow_capped_mountain:  1 hour ago
MySQL has /var/log/error.log but the last lines were printed in 2018 February!
icyflame:snow_capped_mountain:  1 hour ago
Okay, I guess I just have to turn on debugging on local and try to figure it out.
icyflame:snow_capped_mountain:  1 hour ago
Alright, local build process is running. It has to get a bunch of images because it seems I have never run Metakgp locally on this laptop :cold_sweat:
icyflame:snow_capped_mountain:  1 hour ago
Backups seem to have been running periodically, that's good :100:

icyflame@metakgp-blr:~$ docker cp metakgp-wiki_backup_1:/root/backups/metakgp_wiki_2019_12_04_04_23_01.tar.gz .

I will prepare the SQL file. Once the containers are up, I will recreate from the latest backup and then turn on debugging, restart all containers, try to access feedback and see what queries are being run!
icyflame:snow_capped_mountain:  1 hour ago

mysql> SELECT @@global.general_log;
+----------------------+
| @@global.general_log |
+----------------------+
|                    0 |
+----------------------+
1 row in set (0.00 sec)mysql> SELECT @@global.general_log_file;
+---------------------------------+
| @@global.general_log_file       |
+---------------------------------+
| /var/lib/mysql/4efb1f830bf6.log |
+---------------------------------+
1 row in set (0.00 sec)mysql> SELECT @@global.log_output;
+---------------------+
| @@global.log_output |
+---------------------+
| FILE                |
+---------------------+
1 row in set (0.00 sec)

@@global.general_log is 0. This answer asks people to set it to 1 for the log to be printed to a file https://stackoverflow.com/a/11598959/2080089
Stack OverflowStack Overflow
mysql log files are empty although it seems that I have set eveything
I am trying to get log files for mysql server Ver 14.14 Distrib 5.5.22 running on debian-linux-gnu (x86_64) using readline 6.2 Based on several websites I uncommented these lines in /etc/mysql/my....
icyflame:snow_capped_mountain:  1 hour ago
https://github.com/metakgp/metakgp-wiki/issues/73Opened an issue for this. This has to be an issue for another day :sweat_smile: I wonder if @amrav set general_log = 1 locally on our old instance and when we moved instances from the France region to Bangalore, that setting was lost? :thinking_face: Anyway, we need to fix this. I am wondering if it might be wise to set general_log to 1 on the current container and then tail the error logs in an attempt to find the problem.
icyflame:snow_capped_mountain:  40 minutes ago
Ah, so general_log is for normal logs, not error logs.Error logs are always written somewhere. Our current setting seems to be to write to stderr

mysql> SELECT @@log_error;
+-------------+
| @@log_error |
+-------------+
| stderr      |
+-------------+
1 row in set (0.00 sec)

icyflame:snow_capped_mountain:  39 minutes ago
@Berserker If you are online and have a running local instance of Metakgp, can you try restoring the latest backup and turning on the debug variables above?
icyflame:snow_capped_mountain:  39 minutes ago
I am at Step 10/15 trying to download all the composer dependencies :sweat_smile: (edited) 
Berserker  38 minutes ago
I am online, but do not have a local instance of running Metakgp as of now, I will do it tonight actually.
Berserker  37 minutes ago
https://metakgp.slack.com/archives/C0AKQ9VFC/p1575470598004600?thread_ts=1574671031.000300&cid=C0AKQ9VFC
Shouldn't we direct error_log to a file instead of stderr?
Ah, so general_log is for normal logs, not error logs.Error logs are always written somewhere. Our current setting seems to be to write to stderr

mysql> SELECT @@log_error;
+-------------+
| @@log_error |
+-------------+
| stderr      |

From a thread in #meta-x | Yesterday at 23:43 | View reply
icyflame:snow_capped_mountain:  37 minutes ago
Oh, okay :+1: I am gonna be around for a few more minutes, but I don't think it will finish building tonight. I think you know what to do, so if you get time tonight, try :+1:
icyflame:snow_capped_mountain:  37 minutes ago
Yeah, probably file is better. But it doesn't matter because the file would be part of the container and gone, just like stderr when we restart the container.If we wanted to keep error logs, we would create a volume and make it persistent.
Berserker  37 minutes ago
Thanks for the insight to this problem, I will try and give a update in this thread.
icyflame:snow_capped_mountain:  37 minutes ago
:100: :muscle:
icyflame:snow_capped_mountain:  36 minutes ago
I can see error logs from my incorrect login attempts, but not from the supposed query that PHP is running. Which is now making me suspect that it's getting stuck somewhere in the middle and not even making the query to MySQL :sweat_smile:
icyflame:snow_capped_mountain:  35 minutes ago

icyflame@metakgp-blr:~$ docker logs -f --since=60m metakgp-wiki_mysql_1
2019-12-04T14:08:48.038821Z 659684 [Note] Access denied for user 'root'@'localhost' (using password: NO)
2019-12-04T14:09:23.909384Z 659696 [Note] Access denied for user 'metakgp_user'@'localhost' (using password: NO)

icyflame:snow_capped_mountain:  35 minutes ago
Maybe we didn't update the extension? :thinking_face:
icyflame:snow_capped_mountain:  30 minutes ago
Version looks good :ok:https://wiki.metakgp.org/w/Special:VersionThe extension page says that you should run the update script after installing the extension. I am sure we ran that extension and created the DB tables. :green_book:Also, as the feedback feature works properly except for a logged in user trying to look at a specific feedback page, this seems like something else is the problem.
icyflame:snow_capped_mountain:  23 minutes ago
Ah, turns out the update top trending job has been failing :cry:
icyflame:snow_capped_mountain:  15 minutes ago
Opened an issue for that failure: https://github.com/metakgp/metakgp-wiki/issues/74