OMP can't upload files

Hi, we are using OMP 3.1.2.4 with this patch applied
When we try to upload a file in submission (word, pdf…) or a css in website>appearance the upload fails with “The file could not be uploaded or revised” message.immagine
The error occurs at line 352 in /var/www/clients/client126/web307/web/lib/pkp/classes/db/DAO.inc.php
The log is below.
Can anyone help?
Best regards
Stefano

[Wed Oct 28 10:08:36.800601 2020] [proxy_fcgi:error] [pid 17409:tid 139933094647552] [client 172.16.193.211:52767] AH01071: Got error ‘PHP message: PHP Warning: file_put_contents(/var/www/clients/client126/web307/web/cache/fc-pluginSettings-0-defaultthemeplugin.php): failed to open stream: Permesso negato in /var/www/clients/client126/web307/web/lib/pkp/classes/cache/FileCache.inc.php on line 90\nPHP message: PHP Notice: unserialize(): Error at offset 1033 of 1050 bytes in /var/www/clients/client126/web307/web/lib/pkp/classes/db/DAO.inc.php on line 352\nPHP message: PHP Notice: unserialize(): Error at offset 1146 of 1163 bytes in /var/www/clients/client126/web307/web/lib/pkp/classes/db/DAO.inc.php on line 352\nPHP message: PHP Notice: unserialize(): Error at offset 1148 of 1165 bytes in /var/www/clients/client126/web307/web/lib/pkp/classes/db/DAO.inc.php on line 352\nPHP message: PHP Notice: unserialize(): Error at offset 1028 of 1045 bytes in /var/www/clients/client126/web307/web/lib/pkp/classes/db/DAO.inc.php on line 352\nPHP message: PHP Notice: unserialize(): Error at offset 1141 of 1158 bytes in /var/www/clients/client126/web307/web/lib/pkp/classes/db/DAO.inc.php on line 352\nPHP message: PHP Notice: unserialize(): Error at offset 1145 of 1162 bytes in /var/www/clients/client126/web307/web/lib/pkp/classes/db/DAO.inc.php on line 352\nPHP message: PHP Notice: unserialize(): Error at offset 1033 of 1050 bytes in /var/www/clients/client126/web307/web/lib/pkp/classes/db/DAO.inc.php on line 352\nPHP message: PHP Notice: unserialize(): Error at offset 1033 of 1050 bytes in /var/www/clients/client126/web307/web/lib/pkp/classes/db/DAO.inc.php on line 352\nPHP message: PHP Notice: unserialize(): Error at offset 1146 of 1163 bytes in /var/www/clients/client126/web307/web/lib/pkp/classes/db/DAO.inc.php on line 352\nPHP message: PHP Notice: unserialize(): Error at offset 1148 of 1165 bytes in /var/www/clients/client126/web307/web/lib/pkp/classes/db/DAO.inc.php on line 352\nPHP message: PHP Notice: unserialize(): Error at offset 1028 of 1045 bytes in /var/www/clients/client126/web307/web/lib/pkp/classes/db/DAO.inc.php on line 352\nPHP message: PHP Notice: unserialize(): Error at offset 1141 of 1158 bytes in /var/www/clients/client126/web307/web/lib/pkp/classes/db/DAO.inc.php on line 352\nPHP message: PHP Notice: unserialize(): Error at offset 1145 of 1162 bytes in /var/www/clients/client126/web307/web/lib/pkp/classes/db/DAO.inc.php on line 352\nPHP message: PHP Notice: unserialize(): Error at offset 1033 of 1050 bytes in /var/www/clients/client126/web307/web/lib/pkp/classes/db/DAO.inc.php on line 352\n’

Hi @bolelligallevi,

I don’t see anything relevant to the CSS upload in the log, though I do see two separate problems:

  • PHP Warning: file_put_contents(/var/www/clients/client126/web307/web/cache/fc-pluginSettings-0-defaultthemeplugin.php): failed to open stream: Permesso negato
    
    This is related to file permissions in your cache directory, and
  • PHP Notice: unserialize(): Error at offset ...
    
    Warnings like this are probably caused by changes to your character set configuration. Data was serialized to the database using PHP’s serialize() function with one configuration, and then the configuration was changed, leading to problems when the data (now slightly different) is passed through unserialize().

The likeliest problem with the file upload is related to file permissions in the public files directory. Ensure that OMP has permission to store files there (recursively).

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher, thanks for your reply: the problem with the file uploading was related to permissions in the directories public | uploads | tmp.
We solved with g+rw, thank a lot for your help.

Still, we would like to better understand the unserialize warnings in the logs, because they are still there even if the permission issue is fixed.
Regarding the serialize() configuraton change, we didn’t change anything on purpose, we just applied this patch, but we did that on the test environment and file uploading is working here…
It’s only a PHP Notice, but we would like if is safe to ignore it or not.

Finally, Below is our i18N config, we don’t see problems there, can you kindly confirm?
Best regards,
Stefano

;;;;;;;;;;;;;;;;;;;;;;;;;
; Localization Settings ;
;;;;;;;;;;;;;;;;;;;;;;;;;

[i18n]

; Default locale
locale = en_US

; Client output/input character set
client_charset = utf-8

; Database connection character set
; Must be set to “Off” if not supported by the database server
; If enabled, must be the same character set as “client_charset”
; (although the actual name may differ slightly depending on the server)
connection_charset = utf8

; Database storage character set
; Must be set to “Off” if not supported by the database server
database_charset = utf8

Hi @bolelligallevi,

Could you post that as a separate question? That’ll help keep the forum organized by topic.

Thanks,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher, I just posted this
Best regards
Stefano

1 Like