xech / agora-project

Agora-Project : create a worspace for your team !
https://www.agora-project.net
GNU General Public License v3.0
32 stars 23 forks source link

Agora 24.2.1 to 24.2.3 error File or folder not accessible : UPDATE_LOCK.log #30

Closed prbt2016 closed 6 months ago

prbt2016 commented 7 months ago

Hello,

I was in the process of upgrading Agora Project from 24.2.1 to 24.2.3 on a non Su-PHP server on PHP 5.6, MYSQL 5.6, Apache 2.2.

However, I get the following error on visiting my installation URL i.e :

File or folder not accessible : UPDATE_LOCK.log

image

I had a backup of the installation and again I tried to upgrade by creating the file manually i.e UPDATE_LOCK.log and gave 666 permissions by chowning as the file user to the same , since i feel that its vulnerable to give permissions to the root folder.

However, after doing so, I got another error :

Update error : check Apache/PHP logs for details. When the issue is resolved : delete the 'UPDATE_LOCK.log' file.

image

Apache logs show :

PHP Warning: file_put_contents(UPDATE_LOCK.log): failed to open stream: Permission denied in /{{PATH}}/{{TO}}{{AGORA-FOLDER}}/app/Common/DbUpdate.php

It seems that the script requires root folder permissions.

I didn't get this error while upgrading from 24.2.0 to 24.2.1 or in the earlier versions.

Is it possible for you to make required changes in code, so that user can manually create a UPDATE_LOCK.log file in the root folder and chown it as the file user with required permissions so that this error doesn't occur.

This would be my kind suggestion, as it is vulnerable to give root folder permissions.

Kindly let me know.

prbt2016 commented 7 months ago

Hello,

Any update regarding the same ?.

xech commented 7 months ago

Hello, it seems that there was an error during the upgrade of your Agora-Project software. You may use PHP version 7.4 or higher to ensure the software works properly. The latest version 24.2.3 of Agora-Project may also correct the problem you encountered. If you want to restart updating your space, simply delete the UPDATE_LOCK.log file (in DATAS folder) and restart the update procedure. Sincerely Xech

prbt2016 commented 7 months ago

Hello @xech ,

Thanks for your reply. I checked upgrade from 24.2.1 to 24.2.3, please check the title .

I even checked upgrade on 7.4 as well but the same issue occurs .

It seems to be a issue with this code

https://github.com/xech/agora-project/commit/8da6a6ec363537f4ba67ebce1a004c704d2fbf28#diff-135254fa758438e1ea4b6ec122e1c3e2bfb7a8e0e311ed2428c5ba3bc05fe82dR84

In earlier version 24.2.1 the code on line 84 in app/Common/DbUpdate.php was

$lockedUpdate=PATH_DATAS."lockedUpdate.log";

Which has been changed to $lockedUpdate="UPDATE_LOCK.log";

Did you forget to append PATH_DATAS i.e

$lockedUpdate=PATH_DATAS."UPDATE_LOCK.log";

It seems that the current code is checking for the project root folder and not the PATH_DATAS folder.

Please check the code and let me know .

Also could you please update the PHP requirements to 7.4 on official site, so that users won't face any issues, it still shows PHP 5.5 https://www.agora-project.net/?ctrl=offline&action=AgoraProject.

Regards.

xech commented 7 months ago

Hello, This is not an error, the "UPDATE_LOCK.log" file is now at the root, to be more easily located. Thank you also for your comment on the recommendation of PHP version 7.4. It has just been updated. Sincerely

prbt2016 commented 7 months ago

Hello @xech ,

Okay got it . Thanks for the update.

But is there any possibility that through code, you could allow the file 'UPDATE_LOCK.log' to be chowned as a user and assign the required permissions to it rather than a user giving root folder permission and the UPDATE_LOCK.log file being created , for the script to work on non SU-PHP servers, where one cannot give root folder permissions due to security issues and vulnerabilities, for instance shared hosts.

Kindly let me know if that's possible.

prbt2016 commented 7 months ago

Hello @xech ,

Checked upgrade from 24.2.1 to the latest 24.4.1 with PHP 7.0 as mentioned in the docs. Same issue as above.

image

Do you have any further plans to make the above changes in code as per the suggestions i provided?.

Please kindly let me know.

Regards.

xech commented 6 months ago

Hello, The next version 24.4.2 of Agora-Project will include a fix for this. Have a good day Xech

prbt2016 commented 6 months ago

Hello @xech ,

Thank you so much . Kindly notify once you release the same .

Regards.