[ZBX-18695] file_put_contents runtime error observed when the webserver doesn't have rights to update zabbix.conf.php Created: 2020 Nov 24  Updated: 2024 Apr 10  Resolved: 2021 Jun 17

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F), Installation (I)
Affects Version/s: 4.0.27rc1, 5.0.6rc1, 5.2.2rc1, 5.4.0alpha1
Fix Version/s: 4.0.32rc1, 5.0.13rc1, 5.4.2rc1, 6.0.0alpha1, 6.0 (plan)

Type: Problem report Priority: Trivial
Reporter: Sergejs Olonkins Assignee: Andrejs Griščenko
Resolution: Fixed Votes: 0
Labels: configfile, installation, runtimeerror
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Team: Team A
Sprint: Sprint 70 (Nov 2020), Sprint 71 (Dec 2020), Sprint 72 (Jan 2021), Sprint 73 (Feb 2021), Sprint 74 (Mar 2021), Sprint 75 (Apr 2021), Sprint 76 (May 2021), Sprint 77 (Jun 2021)
Story Points: 0.125

 Description   

Problem description: If the webserver doesn't have rights to update the zabbix.conf.php file, the following runtime error is observed along with the error message in frontend, when completing zabbix frontend setup form (setup.php):

file_put_contents(/home/jenkins/workspace/zabbix-dev/frontend/sources/ui/conf/zabbix.conf.php): failed to open stream: Permission denied [setup.php:130 -> CTag->__construct() -> CTag->addItem() -> CObject->addItem() -> CTag->addItem() -> CObject->addItem() -> unpack_object() -> CTag->toString() -> CSetupWizard->bodyToString() -> CSetupWizard->getStage() -> CSetupWizard->stage5() -> CConfigFile->save() -> file_put_contents() -> CConfigFile->{closure}() in include/classes/core/CConfigFile.php:190]

No runtime errors should be thrown, only the frontend error message should be shown.

Steps to reproduce:

  1. Make sure Your webserver doesn't have permissions to update the zabbix.conf.php file.
  2. Open zabbix frontend configuration form (setup.php)
  3. Go through all sections of this form untill You reach "Install" section
  4. In the "Install" section press "Finish" button - make sure that the "Cannot create the configuration file" error message is displayed
  5. Check for runtime errors.

Result: the previously mentioned runtime error is observed.

Expected: no runtime errors should be thrown, only the frontend error message should be shown.



 Comments   
Comment by Andrejs Griščenko [ 2021 Jan 12 ]

Resolved in development branches:

Comment by Andrejs Griščenko [ 2021 Jun 15 ]

Fixed in:

Generated at Tue May 20 07:42:26 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.