After upgrade to Pydio v8.0.2, user fails to upload files


#4

Yes. It is the original error I had hit. So I amend the script.

I also tried upgrade the os to Ubuntu 16. But after upgrade and install pydio and php7 it comes out blank page, with connect database error exception. I will capture the error details next time.


#5

The original string breaks down into two parts and add by "."
i.e. something like below

    const ERROR_MESSAGES = [
        UPLOAD_ERR_OK         => 'There is no error, the file uploaded with success',
        UPLOAD_ERR_INI_SIZE   => 'The uploaded file exceeds the upload_max_filesize directive in php.ini',
        UPLOAD_ERR_FORM_SIZE  => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was '
            . 'specified in the HTML form',
        UPLOAD_ERR_PARTIAL    => 'The uploaded file was only partially uploaded',
        UPLOAD_ERR_NO_FILE    => 'No file was uploaded',
        UPLOAD_ERR_NO_TMP_DIR => 'Missing a temporary folder',
        UPLOAD_ERR_CANT_WRITE => 'Failed to write file to disk',
        UPLOAD_ERR_EXTENSION  => 'A PHP extension stopped the file upload.',
    ];

But after removal of “.”, it says the var cannot be const so I remove const

details of this file can see from https://github.com/zendframework/zend-diactoros/blob/master/src/UploadedFile.php

Restore it to original will have the following error

[Thu Jan 11 19:40:54.476393 2018] [:error] [pid 1466] [client 123.123.123.123:58692] PHP Parse error:  syntax error, unexpected '.', expecting ']' in /usr/share
/pydio/core/vendor/zendframework/zend-diactoros/src/UploadedFile.php on line 21, referer: https://pydio-server/pydio/ws-my-files/
00] /var/log/apache2/error.log

I tried install php7.0 but when I try to enable it, it prompts the following warning

root@pydio:~# a2enmod php7.0
Considering dependency mpm_prefork for php7.0:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Considering conflict php5 for php7.0:
Enabling module php7.0.
To activate the new configuration, you need to run:
  service apache2 restart

Enable it will have the following error

[Thu Jan 11 19:55:32.188855 2018] [:error] [pid 12733] [client 123.123.123.123:59106] Exception was caught but could not be logged properly: There was an error
trying to connect to your database! Did you change any configuration for the core connection? Or maybe your database is down? in /usr/share/pydio/plugins/conf
.sql/SqlConfDriver.php on line 112, referer: https://flexhk.sky-computers.com/pydio/ws-my-files/
[Thu Jan 11 19:55:32.189178 2018] [:error] [pid 12733] [client 123.123.123.123:59106]  ===> Exception details : /usr/share/pydio/plugins/conf.sql/SqlConfDriver.
php on line 112 #0 /usr/share/pydio/core/src/pydio/Core/PluginFramework/PluginsService.php(568): Pydio\\Conf\\Sql\\SqlConfDriver->init(Object(Pydio\\Core\\Mod
el\\Context), Array)\n#1 /usr/share/pydio/core/src/pydio/Core/Services/ConfService.php(192): Pydio\\Core\\PluginFramework\\PluginsService->softLoad('conf.sql'
, Array)\n#2 /usr/share/pydio/plugins/core.conf/CoreConfLoader.php(54): Pydio\\Core\\Services\\ConfService::instanciatePluginFromGlobalParams(Array, 'Pydio\\\
\Conf\\\\Core...', Object(Pydio\\Core\\PluginFramework\\PluginsService))\n#3 /usr/share/pydio/core/src/pydio/Core/Services/ConfService.php(251): Pydio\\Conf\\
Core\\CoreConfLoader->getImplementation()\n#4 /usr/share/pydio/core/src/pydio/Core/Services/ConfService.php(116): Pydio\\Core\\Services\\ConfService::getConfS
torageImpl()\n#5 /usr/share/pydio/core/src/pydio/Core/Services/ConfService.php(102): Pydio\\Core\\Services\\ConfService->startInst()\n#6 /usr/share/pydio/core
/src/pydio/Core/Http/Base.php(72): Pydio\\Core\\Services\\ConfService::start()\n#7 [internal function]: Pydio\\Core\\Http\\Base::handleRoute('/pydio', '/', Ar
ray)\n#8 /usr/share/pydio/core/src/pydio/Core/Http/TopLevelRouter.php(139): call_user_func(Array, '/pydio', '/', Array)\n#9 /usr/share/pydio/index.php(30): Py
dio\\Core\\Http\\TopLevelRouter->route()\n#10 {main}, 

#6

I also tried in-place upgrade OS to Ubuntu 16 and use apt to install pydio, pydio-all but there is error in pydio

[Thu Jan 11 19:19:19.682656 2018] [:error] [pid 7772] [client 123.123.123.123:58062] PHP Fatal error:  Uncaught Pydio\\Core\\Exception\\PydioException: Severe e
rror while loading plugins registry : There was an error trying to connect to your database! Did you change any configuration for the core connection? Or mayb
e your database is down? in /usr/share/pydio/core/src/pydio/Core/PluginFramework/PluginsService.php:819\nStack trace:\n#0 /usr/share/pydio/core/src/pydio/Core
/PluginFramework/PluginsService.php(203): Pydio\\Core\\PluginFramework\\PluginsService->getDetectedPlugins()\n#1 /usr/share/pydio/core/src/pydio/Core/Services
/ConfService.php(392): Pydio\\Core\\PluginFramework\\PluginsService::getInstance(Object(Pydio\\Core\\Model\\Context))\n#2 /usr/share/pydio/core/src/pydio/Core
/Http/Base.php(62): Pydio\\Core\\Services\\ConfService::getGlobalConf('ADMIN_URI')\n#3 [internal function]: Pydio\\Core\\Http\\Base::handleRoute('/pydio', '/'
, Array)\n#4 /usr/share/pydio/core/src/pydio/Core/Http/TopLevelRouter.php(139): call_user_func(Array, '/pydio', '/', Array)\n#5 /usr/share/pydio/index.php(30)
: Pydio\\Core\\Http\\TopLevelRouter->route()\n#6 in /usr/share/pydio/core/src/pydio/Core/PluginFramework/PluginsService.php on line 819, referer: ...

#7

I have upgraded to PHP 7.2 and the error remains. I am not seeing MySQL errors.


#8

Ok. I did get the MySQL error as well PHP7 broke many things. Is it possible to roll back the update?

This is a production server and we are into two days with uploads not functioning. Thanks.


#9

I had the same Problem with our Pydio Cloud on Ubuntu 14.04.

To make the upload work I made a backup of the UploadedFile.php and removed the array that contains the error messages.
There are only two calls for that Array inside the php so I removed the two calls, the error message is now a static output.
Now the upload is working again.
If there will be a fix for that bug I can restore the original file again.


#10

That is helpful for when I apply the upgrade again. Thanks for the details. In the meantime, due to demands for the service, I rolled back to 8.0.1 from a backup. Uploads are working.


#11

We also have this issue after upgrade to 8.0.2 (PHP 5.5)
I’ve used the fix of boomrider but it’ll be better to have a real solution.
Do you have news with that @charles ?


#12

we have to make a new release for that - probably not possible before a couple of weeks sorry


#13

Hi All,

Got in the same situation (Ubuntu 14.04.5 LTS) after the upgrade to 8.0.2…

The syntax used to declare the constant array was introduced in PHP 5.6.

At the time the task of setting the Pydio installation to use PHP5.6 instead of the default PHP5.5.9 appeared easier. I was not keen on the idea of searching the whole codebase for other instances using the same feature.

For reference I have used the ondrej/php PPA repo to install PHP5.6

Regards,
George


#14

Hi,

Could you please install php extension apcu and upgrade to 7.1 >= PHP version >= 5.6
Then in pydio setting, enable Cache server with apc


#15

Hey guys,
I read trough the previous comments, because I have the same problem.
Is there an update yet? Is it ok to change the uploadedfile.php, if so, where is it located on Debian 3.2.89?
Thanks for your help!


#16

Hi, i’ve got the same error too. Waiting for the patch …


#17

Hey guys, can anyone tell me where the pre4vious mentioned UploadedFile.php is located?


#18

UDPATE:

@Charles, any news on this?!


#19

argh not yet. I did not reproduce it locally and I’m a bit lost on which version of php the error occurs ?


#20

Ubuntu 14.04.5
PHP 5.5.9-1ubuntu4.23)

Same Problem here. Any news on that? Some kind of official patch available?


#21

I have solved in the following way:

class UploadedFile implements UploadedFileInterface
{
    private $ERROR_MESSAGES = array(
        UPLOAD_ERR_OK         => 'There is no error, the file uploaded with success',
        UPLOAD_ERR_INI_SIZE   => 'The uploaded file exceeds the upload_max_filesize directive in php.ini',
        UPLOAD_ERR_FORM_SIZE  => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',
        UPLOAD_ERR_PARTIAL    => 'The uploaded file was only partially uploaded',
        UPLOAD_ERR_NO_FILE    => 'No file was uploaded',
        UPLOAD_ERR_NO_TMP_DIR => 'Missing a temporary folder',
        UPLOAD_ERR_CANT_WRITE => 'Failed to write file to disk',
        UPLOAD_ERR_EXTENSION  => 'A PHP extension stopped the file upload.',
    );

It works under ubuntu 14.04 php 5.5.9


#22

Has anyone found a workaround for this issue. I tried the couple suggested here and they did no t work. Any help would be greatly appreciated.


#23

Did you tested also my one ?
Could you post the web servere error log ?