Page MenuHomePhabricator

PDF fails to render on PostgreSQL and FreeBSD
Closed, ResolvedPublic

Description

Author: kayasaman

Description:
PDF Not Rendering

Platform: FreeBSD 8.3 x64
PHP: 5.3.28 (fpm-cgi)
PostgreSQL DB: 9.2.4

Upon deletion of PDF file the error below is observed:

<error>
A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:
(SQL query hidden)
from within function "Revision::fetchFromConds". Database returned error "0A000: ERROR: SELECT FOR UPDATE/SHARE cannot be applied to the nullable side of an outer join ".
</error>

In addition PDF files won't render either... possibly attributed to the error above (see attachment)

PdfHandler Extension is active in LocalSettings.php and in addition all paths for various tools are correct (gs, imagemagick, convert etc...)


Version: unspecified
Severity: major
OS: FreeBSD

Attached:

Details

Reference
bz59147

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.
StatusAssignedTask
InvalidNone
ResolvedNone

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 2:38 AM
bzimport set Reference to bz59147.
bzimport added a subscriber: Unknown Object (MLST).

What version of MediaWiki are you using?

kayasaman wrote:

Hi, version 1.21.3

https://www.mediawiki.org/wiki/Manual:How_to_debug probably doesn't help much either here, hmm. Which PDFHandler branch is this about?

(In reply to comment #3)

https://www.mediawiki.org/wiki/Manual:How_to_debug probably doesn't help much
either here, hmm. Which PDFHandler branch is this about?

I suspect this more has to do with core then with pdf stuff. Can you delete non pdf files fine

kayasaman wrote:

Hi, the PDF Handler version is:

https://git.wikimedia.org/tree/mediawiki%2Fextensions%2FPdfHandler

2013-12-07

basically, I used the link above to grab the .tar.gz file.

Everything else works fine, I can delete and render everything; even using the TimedMediaHandler plugin to handle ogg and m4v files and works perfectly.

So you are running extension's git master with MW 1.21. The extension's 1.21 branch would be https://git.wikimedia.org/log/mediawiki%2Fextensions%2FPdfHandler/REL1_21

kayasaman wrote:

I've just re-installed the extension from the link above and unfortunately same thing :-(

<----error
A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:
(SQL query hidden)
from within function "Revision::fetchFromConds". Database returned error "0A000: ERROR: SELECT FOR UPDATE/SHARE cannot be applied to the nullable side of an outer join ".
----->

and page still not rendering "thumb" properly either:

http://www.optiplex-networks.com/index.php?title=File:Hp-2230s-review-final-2.pdf

??

It probably won't make much of a difference in this case, but please add to the bottom of LocalSettings.php

$wgShowSQLErrors = true;
$wgShowDBErrorBacktrace = true;

kayasaman wrote:

We have some more output:

A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:
SELECT rev_id,rev_page,rev_text_id,rev_timestamp,rev_comment,rev_user_text,rev_user,rev_minor_edit,rev_deleted,rev_len,rev_parent_id,rev_sha1,rev_content_format,rev_content_model,page_namespace,page_title,page_id,page_latest,page_is_redirect,page_len,user_name FROM "revision" INNER JOIN "page" ON ((page_id = rev_page)) LEFT JOIN "mwuser" ON ((rev_user != 0) AND (user_id = rev_user)) WHERE page_id = '19' AND rev_id = '41' LIMIT 1 FOR UPDATE
from within function "Revision::fetchFromConds". Database returned error "0A000: ERROR: SELECT FOR UPDATE/SHARE cannot be applied to the nullable side of an outer join ".
Backtrace:
#0 /usr/local/www/www/includes/db/DatabasePostgres.php(482): DatabaseBase->reportQueryError('ERROR: SELECT ...', '0A000', 'SELECT rev_id,...', 'Revision::fetch...', false)
#1 /usr/local/www/www/includes/db/Database.php(983): DatabasePostgres->reportQueryError('ERROR: SELECT ...', '0A000', 'SELECT rev_id,...', 'Revision::fetch...', false)
#2 /usr/local/www/www/includes/db/Database.php(1434): DatabaseBase->query('SELECT rev_id,...', 'Revision::fetch...')
#3 /usr/local/www/www/includes/Revision.php(372): DatabaseBase->select(Array, Array, Array, 'Revision::fetch...', Array, Array)
#4 /usr/local/www/www/includes/Revision.php(314): Revision::fetchFromConds(Object(DatabasePostgres), Array, 3)
#5 /usr/local/www/www/includes/Revision.php(294): Revision::loadFromConds(Object(DatabasePostgres), Array, 3)
#6 /usr/local/www/www/includes/Revision.php(143): Revision::newFromConds(Array, 3)
#7 /usr/local/www/www/includes/WikiPage.php(575): Revision::newFromPageId(19, 41, 3)
#8 /usr/local/www/www/includes/WikiPage.php(615): WikiPage->loadLastEdit()
#9 /usr/local/www/www/includes/WikiPage.php(2543): WikiPage->getContent(3)
#10 /usr/local/www/www/includes/FileDeleteForm.php(185): WikiPage->doDeleteArticleReal('', false, 0, false, '', Object(User))
#11 /usr/local/www/www/includes/FileDeleteForm.php(110): FileDeleteForm::doDelete(Object(Title), Object(LocalFile), '', '', false, Object(User))
#12 /usr/local/www/www/includes/ImagePage.php(875): FileDeleteForm->execute()
#13 /usr/local/www/www/includes/actions/DeleteAction.php(45): ImagePage->delete()
#14 /usr/local/www/www/includes/Wiki.php(439): DeleteAction->show()
#15 /usr/local/www/www/includes/Wiki.php(305): MediaWiki->performAction(Object(ImagePage), Object(Title))
#16 /usr/local/www/www/includes/Wiki.php(565): MediaWiki->performRequest()
#17 /usr/local/www/www/includes/Wiki.php(458): MediaWiki->main()
#18 /usr/local/www/www/index.php(59): MediaWiki->run()
#19 {main}

kayasaman wrote:

I just upgraded to Mediawiki 1.22.2, and additionally updated the extension.

Good news is that I was able to delete the PDF file; the bad news is that it still doesn't render the first page as the I believe the PDFHandler extension is supposed to do:

"
The PdfHandler extension shows uploaded pdf files in a multipage preview layout. With the Proofread Page extension enabled, pdfs can be displayed side-by-side with text for transcribing books and other documents, as is commonly done with DjVu files (particularly in Wikisource).
"

The file delete part was bug 60531

Change 129109 had a related patch set uploaded by Jjanes:
PostgreSQL: decode image.img_metadata

https://gerrit.wikimedia.org/r/129109

Change 129109 merged by jenkins-bot:
PostgreSQL: decode image.img_metadata

https://gerrit.wikimedia.org/r/129109

blob handling for postgres was successfully merged

Change 132508 had a related patch set uploaded by Jjanes:
PostgreSQL: decode image.img_metadata

https://gerrit.wikimedia.org/r/132508

Change 132510 had a related patch set uploaded by Jjanes:
PostgreSQL: decode image.img_metadata

https://gerrit.wikimedia.org/r/132510

Change 132508 merged by jenkins-bot:
PostgreSQL: decode image.img_metadata

https://gerrit.wikimedia.org/r/132508

Only https://gerrit.wikimedia.org/r/#/c/132510/ remaining for review (for 1.22 branch) here.

Jjanes: Anything else needed to fix this?

Andre: I have not tested on FreeBSD, and can't readily do so. But I see no reason to think it behaves differently than Linux does in this regard, until someone else reports otherwise.

Should it also go into final EOL release of 1.21 ?

Other than those, I think that is all for this issue.

Change 132510 merged by Mglaser:
PostgreSQL: decode image.img_metadata

https://gerrit.wikimedia.org/r/132510

successfully merged on release branch

Gilles raised the priority of this task from Normal to Unbreak Now!.Dec 4 2014, 10:21 AM
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to Normal.Dec 4 2014, 11:22 AM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

Migrating from the old tracking task to a tag for PostgreSQL-related tasks.

Restricted Application added a subscriber: Matanya. · View Herald TranscriptNov 2 2016, 8:16 PM