Topic on Project:Support desk

Unable to upload .pdf file to wiki since update (Synology)

10
Summary by Vanctardi

Dev was able to solve my problem quickly and effeciently. Amazing support

Vanctardi (talkcontribs)

Hello. After upgrading from 1.31 to 1.33.1, I was unable to upload pdf files to my mediawiki. I get the following error when trying to run update.php from MaintenanceShell:


https://pastebin.com/nLActyLy


Currently running :

*PHP 7.2.29-2007

*Mediawiki 1.33.1-0136

*MariaDB 10.3.21-0063


Feel free to ask any questions, I will try to answer to the best of my ability. Thank you!

Antonkarpp (talkcontribs)
Vanctardi (talkcontribs)

The problem isn't opening the files, it's uploading them. I updated PdfHandler, but to no avail. I get the same error.

[3c2738c1e0b1400b3c40373d] /mediawiki/index.php?title=Special:Upload Wikimedia\Rdbms\DBQueryError from line 1587 of /volume1/web/mediawiki/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?

Query: INSERT IGNORE INTO `image` (img_name,img_size,img_width,img_height,img_bits,img_media_type,img_major_mime,img_minor_mime,img_timestamp,img_metadata,img_sha1,img_description_id,img_actor) VALUES ('Calc1.pdf','8248398','0','0','0','OFFICE','application','pdf','20200809210218'

Vanctardi (talkcontribs)

For some reason it seems to be this file only. I was able to upload another just fine.

The current file is not corrupted.

Bawolff (talkcontribs)

first of all, dont use update.php from maintenanceshell. Use the web installer upgrade feature via mywiki.com/pathtowiki/mw-config url if you cant use command line installer.

You should be given a stack trace which includes the actual sql error message when uploading the file. Please imclude full error message.

Vanctardi (talkcontribs)

Most of it is the content of the pdf file. Here it is:

https://pastebin.com/EPbJDAR2


I had to delete a good chunk of it (contents of the pdf file) because the log file was over a megabyte of text.

Bawolff (talkcontribs)

ok the important part of the error is:

Error: 1153 Got a packet bigger than 'max_allowed_packet' bytes (localhost:/run/mysqld/mysqld10.sock)

Basically the issue is that mediawiki tries to extract the text content of the pdf, but mysql says that its too much stuff. You can try increasing mysqls max_allowed_packet size in mysql's config, or try deleting the text layer of that pdf, or you can try disabling mediawikis text extraction feature by setting $wgPdftoText = null;

Vanctardi (talkcontribs)

Wow okay, that would make a lot of sense.

Which config file would use "$wgPdftoText = null;"? Just LocalSettings.php?


Thanks

Bawolff (talkcontribs)
Vanctardi (talkcontribs)

Wow. Can't believe it was that easy. Thank you so much, you're a legend.