Jump to content

Topic on Extension talk:MediaWikiChat

[RESOLVED] Database Error: A database query error has occurred. This may indicate a bug in the software.

18
Solanki (talkcontribs)

Using Apache 2.4, PHP 5.4 and MW v1.23 and PostgreSQL 9.2 as DB. Converted the MySql queries to PostgreSQL and executed it successfully. But,getting "Database Error: A database query error has occurred. This may indicate a bug in the software." on the MW page and following warning on top of it. "Warning: Invalid argument supplied for foreach() in /path/to/MW/folder/extension/MeadiaWikiChatClass.php on line 95".

Please suggest, what might help resolve this issue.

UltrasonicNXT (talkcontribs)

Hmm, are you 100% percent sure your tables are set up correctly? I would just go through and check you have each of the columns of each table there. Apart from that, I'm not sure what to suggest, I'll have a think

Solanki (talkcontribs)

Yes, It created 2 tables chat & chat_users containing 5 & 3 columns respectively in the db.

UltrasonicNXT (talkcontribs)

Hmm, this is odd, because normally after "A database query error has occurred" it tells you what the error was. There are definitely no other error messages?

Kghbln (talkcontribs)

Adding $wgShowSQLErrors = true; to the end of the "LocalSettings.php" file will probably provide more info.

Solanki (talkcontribs)

added $wgShowSQLErrors = true; and this is the error that I am getting. "Notice: pg_send_query(): Cannot set connection to blocking mode in /path/to/MW/folder/includes/db/DatabasePostgres.php" How can I resolve this issue?

Solanki (talkcontribs)

and on the /MediaWiki:common.js page , I am getting this message on the page.

"A database query error has occurred. This may indicate a bug in the software.

Query: SELECT cu_user_id,cu_away FROM "chat_users" WHERE (cu_timestamp > 142062685413) AND (cu_user_id != 1) Function: MediaWikiChat::getOnline Error: 42883 ERROR: operator does not exist: bytea > bigint LINE 1: ...,cu_away FROM "chat_users" WHERE (cu_timestamp > 14206268... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts."

UltrasonicNXT (talkcontribs)

Ok, can you confirm the data type of the cu_timestamp column? It should be bigint.

Solanki (talkcontribs)

It was bytea, as was converted by the converter, changed it to bigint and it worked. But, when I tried logging in to the wiki from other user(from different machine), it gave the following error: Fatal error: Class 'wAvatar' not found in /path/to/MW/folder/extensions/MediaWikiChat/MediaWikiChatClass.php on line 37.

Solanki (talkcontribs)

Disabled the ChatSocialAvatars. That fixed it. But, now the display is gone. Getting the following error in javascript console. TypeError: data is undefined


...e.chatgetnew;var onlineUsers=[];for(var userId in data.users){var user=data.user...

UltrasonicNXT (talkcontribs)

Hmm, probably worth running the latest version of the code, as ChatSocialAvatars has been removed to fix that first problem.

Ok, navigate to /api.php?action=chatgetnew&format=json and what error message do you see there?

Solanki (talkcontribs)

This is what I am getting... {"chatgetnew":{"error":"blockedfromchat"}}

UltrasonicNXT (talkcontribs)

Okay, that error means your user does not have the permission to chat. (The 'chat' permission). Perhaps setting that (using wgGroupPermissions) might fix the problem?

Solanki (talkcontribs)

hey! I gave the parameter "$wgGroupPermissions = true;"

but, now what I am getting is

"error":{"code":"readapidenied","info":"You need read permission to use this module"

I don't know what read permission is it referring to as I have already given following permissions in my LocalSettings.php

$wgGroupPermissions['*']['read'] = true;
$wgGroupPermissions['user']['edit'] = true;
$wgGroupPermissions['user']['read'] = true;
$wgGroupPermissions['sysop']['edit'] = true;
$wgGroupPermissions['sysop']['read'] = true;
UltrasonicNXT (talkcontribs)

Sorry for the confusion, I mean $wgGroupPermissions['user']['chat'] = true;

Alot163 (talkcontribs)

Look at this...who can help me..

  • Query:
    SELECT page_id,page_namespace,page_title FROM `page`,`searchindex` WHERE (page_id=si_page) AND ( MATCH(si_title) AGAINST('+\"u8e5a4a7 u8e8b59b\" ' IN BOOLEAN MODE) ) AND page_namespace = '0' LIMIT 20
  • Function: SearchMySQL::searchInternal
  • Error: 1214 The used table type doesn't support FULLTEXT indexes