Bug #2248

PHP Error mkdir() Uncaught AppKitPHPError

Added by mopp over 2 years ago. Updated over 1 year ago.

Status:ResolvedStart date:01/04/2012
Priority:NormalDue date:
Assignee:mhein% Done:

100%

Category:-Estimated time:1.00 hour
Target version:Icinga 1.x - 1.6.2
Icinga Version: DB Version:
Icinga Web Version: Jasper Version:
IDO Version: Browser Version:
DB Type:

Description

Icinga Web 1.6.1
Icinga Reports 1.6.0 tried to mkdir /usr/share/icinga-web/app/modules/Reporting/data/tmp. Unfortunately the directory had no write permissions.

I got the following error:
[fatal] Uncaught AppKitPHPError: PHP Error mkdir(): Permission denied (/usr/share/icinga-web/app/modules/Reporting/models/ReportUserFileModel.class.php:61) (/usr/share/icinga-web/app/modules/AppKit/lib/logging/AppKitExceptionHandler.class.php:37)

The "mkdir($this->__dir);" caused the error. If mkdir fails the program interrupts without an useful error message.

Associated revisions

Revision becb8fe6
Added by mhein about 2 years ago

  • Fixed error handling reporting module (fixes #2248, ref #2277)

Revision ca46fab5
Added by mhein about 2 years ago

  • Fixed error handling reporting module (fixes #2248, ref #2277)

Conflicts:

Makefile.in
app/modules/Reporting/config/cronks.xml

History

#1 Updated by mhein over 2 years ago

  • Assignee set to mhein
  • Target version changed from 1.6.2 to 1.7

#2 Updated by mhein about 2 years ago

  • Status changed from New to Feedback

I tested and tried to reproduce:

$ tail app/Makefile.in | grep data
    -and ! -path "*Reporting/data*"`; \
    $(INSTALL) -m 755 $(INSTALL_OPTS_WEB) -d $(DESTDIR)$(prefix)/app/data/tmp
    $(INSTALL) -m 755 $(INSTALL_OPTS_WEB) -d $(DESTDIR)$(prefix)/app/modules/Reporting/data

The r1.6 and current master sets the web server user as owner for the reporting temp directories.

Are there any errors for your install?

Otherwise I would close that bug.

Kind regards,
Marius.

#3 Updated by mopp about 2 years ago

Sorry for the missunderstanding, the error is not related to the "make install".

The intention of the bug report was to report an error in the error handling of the php script.
The following code from ReportUserFileModel.class.php should catch problems with the "mkdir($this->__dir);", but unfortunately it doesn't work.
To test it do the following: Remove tmp in app/modules/Reporting/data and modify the permissions of app/modules/Reporting/ to prohibit write access. You will get the error message I mentioned.
If the code below would have worked a message like "Could not create dir: /usr/share/icinga-web/app/modules/Reporting/data/tmp" should have be shown instead of the "Uncaught AppKitPHPError: PHP Error mkdir(): Permission denied"

$this->__dir = AgaviConfig::get('modules.reporting.dir.download');

if (!is_dir($this->__dir)) {
    mkdir($this->__dir);
}

if (!is_dir($this->__dir)) {
    throw new AppKitModelException('Could not create dir: '. $this->__dir);
} else {
    $this->fileGarbageCollector();
}

#4 Updated by mhein about 2 years ago

  • Status changed from Feedback to Resolved
  • % Done changed from 0 to 100

Applied in changeset commit:becb8fe6db56c7a750029a1335b59beb9e68ee41.

#5 Updated by mhein about 2 years ago

  • Target version changed from 1.7 to 1.6.2

#6 Updated by dnsmichi over 1 year ago

  • Project changed from Web to Report Module

Also available in: Atom PDF