Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #9281] Problem with Icingaweb 2 after PHP Upgrade 5.6.8 -> 5.6.9 #1658

Closed
icinga-migration opened this issue May 16, 2015 · 14 comments
Labels
area/framework Affects third party integration/development bug Something isn't working queue/important Blocks a release or needs immediate attention
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/9281

Created by mixmegapol on 2015-05-16 20:00:27 +00:00

Assignee: mjentsch
Status: Resolved (closed on 2015-06-16 15:10:03 +00:00)
Target Version: 2.0.0-rc1
Last Update: 2015-06-16 18:13:13 +00:00 (in Redmine)


Hello all

I have RHEL 7, icinga2, icingaweb2, pgsql9.4 and php5.6.8 running.
Yesterday I upgraded php 5.6.8 to 5.6.9, since then I have problems with icingaweb2.

Output:
Server error: The use statement with non-compound name 'Exception' has no effect

The use statement with non-compound name 'Exception' has no effect

#0 /usr/share/icingaweb2/library/vendor/Zend/Controller/Dispatcher/Standard.php(352): Icinga\Application\ApplicationBootstrap->Icinga\Application\{closure}(2, 'The use stateme...', '/usr/share/icin...', 4, Array)
#1 /usr/share/icingaweb2/library/vendor/Zend/Controller/Dispatcher/Standard.php(352): Zend_Controller_Dispatcher_Standard::loadClass()
#2 /usr/share/icingaweb2/library/vendor/Zend/Controller/Dispatcher/Standard.php(271): Zend_Controller_Dispatcher_Standard->loadClass('DashboardContro...')
#3 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Zend_Controller_Dispatcher_Standard->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#4 /usr/share/php/Icinga/Application/Web.php(154): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#5 /usr/share/php/Icinga/Application/webrouter.php(111): Icinga\Application\Web->dispatch()
#6 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...')
#7 {main}

Could you please investigate in that?

Kind regards
Daniel

Attachments

Changesets

2015-06-02 14:41:33 +00:00 by (unknown) 00ae69a

Fix PHP 5.6.9 error: The use statement with non-compound name 'Exception' has no effect

refs #9281

2015-06-16 14:10:52 +00:00 by mjentsch 5bf7bbd

Remove unneeded use statements from global namespaces

Use statements on global classes from the global namespace don't have any effect, prevent warnings from being displayed in php versions >= 5.6.9 and version >= 5.5.25.

refs #9281

2015-06-16 15:06:47 +00:00 by mjentsch 5b8c308

Merge branch 'bugfix/use-statement-error-9281'

fixes #9281
@icinga-migration
Copy link
Author

Updated by mixmegapol on 2015-05-16 20:02:15 +00:00

My packages:
[root@server]# rpm qa | grep 'icinga2\|php\|icingaweb2\|postgresql94'
php-cli-5.6.9-1.el7.remi.x86_64
php-odbc-5.6.9-1.el7.remi.x86_64
php-intl-5.6.9-1.el7.remi.x86_64
php-pear-1.9.5-10.el7.remi.noarch
postgresql94-server-9.4.1-1PGDG.rhel7.x86_64
icingaweb2-common-2.0.0-3.beta3.el7.centos.noarch
icingaweb2-vendor-Zend-1.12.9-1.el7.centos.noarch
icingaweb2-vendor-lessphp-0.4.0-1.el7.centos.noarch
icingaweb2-vendor-HTMLPurifier-4.6.0-1.el7.centos.noarch
php-pecl-imagick-3.2.0-0.9.RC1.el7.remi.5.6.x86_64
php-pecl-jsonc-1.3.7-1.el7.remi.5.6.x86_64
php-pecl-zip-1.12.5-1.el7.remi.5.6.x86_64
icinga2-ido-pgsql-2.3.4-1.el7.centos.x86_64
php-pdo-5.6.9-1.el7.remi.x86_64
php-xml-5.6.9-1.el7.remi.x86_64
php-5.6.9-1.el7.remi.x86_64
php-pgsql-5.6.9-1.el7.remi.x86_64
php-recode-5.6.9-1.el7.remi.x86_64
php-gd-5.6.9-1.el7.remi.x86_64
php-soap-5.6.9-1.el7.remi.x86_64
postgresql94-libs-9.4.1-1PGDG.rhel7.x86_64
postgresql94-devel-9.4.1-1PGDG.rhel7.x86_64
postgresql94-contrib-9.4.1-1PGDG.rhel7.x86_64
icingaweb2-vendor-dompdf-0.6.1-1.el7.centos.noarch
icingaweb2-vendor-Parsedown-1.0.0-1.el7.centos.noarch
icinga2-common-2.3.4-1.el7.centos.x86_64
icinga2-2.3.4-1.el7.centos.x86_64
php-Icinga-2.0.0-3.beta3.el7.centos.noarch
icingaweb2-2.0.0-3.beta3.el7.centos.noarch
icinga2-doc-2.3.4-1.el7.centos.x86_64
php-common-5.6.9-1.el7.remi.x86_64
php-xmlrpc-5.6.9-1.el7.remi.x86_64
php-process-5.6.9-1.el7.remi.x86_64
php-ldap-5.6.9-1.el7.remi.x86_64
php-pecl-memcache-3.0.8-4.el7.remi.5.6.x86_64
postgresql94-9.4.1-1PGDG.rhel7.x86_64
postgresql94-docs-9.4.1-1PGDG.rhel7.x86_64
icinga2-bin-2.3.4-1.el7.centos.x86_64
icingaweb2-vendor-JShrink-1.0.1-1.el7.centos.noarch

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-06-02 14:19:38 +00:00

I do have the same problem on Fedora 22 with PHP 5.6.9 and the latest git master.

Looking at the Changelog for PHP 5.6.9
http://php.net/ChangeLog-5.php

it seems that they've changed the handling somewhat.
https://bugs.php.net/bug.php?id=60022

Looking at Zend
http://forums.zend.com/viewtopic.php?f=59&t=5764

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-06-02 14:25:28 +00:00

From a short overview, this only happens at specific views and controllers.

http://localhost/icingaweb2/dashboard
http://localhost/icingaweb2/user
http://localhost/icingaweb2/usergroupbackend/list

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-06-02 14:45:05 +00:00

Those controllers explicitely include the Exception class which is already included in IcingaException controllers. Removing that use statement fixes the problem for me.

application/controllers/UserController.php

use \Exception;
use Icinga\Application\Logger;
use Icinga\Exception\ConfigurationError;
use Icinga\Exception\NotFoundError;

application/controllers/UsergroupbackendController.php

use \Exception;
use Icinga\Application\Config;
use Icinga\Exception\NotFoundError;

application/controllers/DashboardController.php

use \Exception;
use Icinga\Exception\ProgrammingError;

@eric
I've pushed a fix to bugfix/use-statement-error-9281 - please review.

@icinga-migration
Copy link
Author

Updated by lhorace on 2015-06-02 22:02:14 +00:00

I have a similiar issue but seperate error with CentOS7 PHP5.6.9 during the setup phase:

Server error: The use statement with non-compound name 'Zend_View_Helper_FormElement' has no effect

#0 /usr/share/icingaweb2/library/vendor/Zend/Loader/PluginLoader.php(397): Icinga\Application\ApplicationBootstrap->Icinga\Application\{closure}(2, 'The use stateme...', '/usr/share/icin...', 4, Array)
#1 /usr/share/icingaweb2/library/vendor/Zend/Loader/PluginLoader.php(397): Zend_Loader_PluginLoader::load()
#2 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(1168): Zend_Loader_PluginLoader->load('FormNumber')
#3 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(610): Zend_View_Abstract->_getPlugin('helper', 'formNumber')
#4 /usr/share/icingaweb2/library/vendor/Zend/Form/Decorator/ViewHelper.php(240): Zend_View_Abstract->getHelper('formNumber')
#5 /usr/share/icingaweb2/library/vendor/Zend/Form/Element.php(2048): Zend_Form_Decorator_ViewHelper->render('')
#6 /usr/share/icingaweb2/library/vendor/Zend/Form/Decorator/FormElements.php(115): Zend_Form_Element->render()
#7 /usr/share/icingaweb2/library/vendor/Zend/Form.php(2974): Zend_Form_Decorator_FormElements->render('\n

@icinga-migration
Copy link
Author

Updated by syncinga on 2015-06-11 10:56:29 +00:00

Solved! (hopefully)
I could not find UserController.php and UsergroupbackendController.php, but DashboardController.php and AuthenticationController.php.
In last both I removed "use \Exception;" and that worked.

@icinga-migration
Copy link
Author

Updated by link_sdm on 2015-06-12 11:17:51 +00:00

I have encountered this issue during the setup process as well, and removing use \Exception doesn't seem to work.

PHP 5.5.25 (cli) (built: May 28 2015 00:58:51)

@icinga-migration
Copy link
Author

Updated by jmeyer on 2015-06-12 11:26:07 +00:00

  • Category changed from Dashboard to Framework
  • Assigned to set to jmeyer
  • Priority changed from Normal to High
  • Target Version set to 2.0.0-rc1

@icinga-migration
Copy link
Author

Updated by mjentsch on 2015-06-16 07:50:28 +00:00

  • Assigned to changed from jmeyer to mjentsch

@icinga-migration
Copy link
Author

Updated by mjentsch on 2015-06-16 11:43:23 +00:00

link_sdm wrote:

I have encountered this issue during the setup process as well, and removing use \Exception doesn't seem to work.
PHP 5.5.25 (cli) (built: May 28 2015 00:58:51)

Do you have any extended information on that? Which error is triggered exactly? (EDIT: never mind, got it)

@icinga-migration
Copy link
Author

Updated by mjentsch on 2015-06-16 15:10:03 +00:00

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

Applied in changeset 5b8c308.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-06-16 18:13:13 +00:00

  • File added Auswahl_055.png

Thanks, works for me now again on Fedora 22 :-)

Auswahl_055.png

@icinga-migration icinga-migration added queue/important Blocks a release or needs immediate attention bug Something isn't working area/framework Affects third party integration/development labels Jan 17, 2017
@icinga-migration icinga-migration added this to the 2.0.0-rc1 milestone Jan 17, 2017
@aflatto
Copy link

aflatto commented Feb 19, 2017

Am getting this issue now , using the icinga2-ansible playbook to install and configure the server
using ubuntu xenial:
dpkg -l |grep php
ii php 1:7.0+35ubuntu6 all server-side, HTML-embedded scripting language (default)
ii php-common 1:35ubuntu6 all Common files for PHP packages
ii php-dompdf 0.6.1+dfsg-2ubuntu1 all HTML to PDF converter
ii php-font-lib 0.2.2+dfsg-2build1 all read, parse, export and make subsets of different fonts
ii php-gd 1:7.0+35ubuntu6 all GD module for PHP [default]
ii php-htmlpurifier 4.7.0-1build1 all Standards-compliant HTML filter
ii php-icinga 2.4.1-1ppa1604+1 all PHP library to communicate with and use Icinga
ii php-imagick 3.4.0
rc6-1ubuntu3 amd64 Provides a wrapper to the ImageMagick library
ii php-intl 1:7.0+35ubuntu6 all Internationalisation module for PHP [default]
ii php-ldap 1:7.0+35ubuntu6 all LDAP module for PHP [default]
ii php-mysql 1:7.0+35ubuntu6 all MySQL module for PHP [default]
ii php-xml 1:7.0+35ubuntu6 all DOM, SimpleXML, WDDX, XML, and XSL module for PHP [default]
ii php7.0 7.0.13-0ubuntu0.16.04.1 all server-side, HTML-embedded scripting language (metapackage)
ii php7.0-cli 7.0.13-0ubuntu0.16.04.1 amd64 command-line interpreter for the PHP scripting language
ii php7.0-common 7.0.13-0ubuntu0.16.04.1 amd64 documentation, examples and common module for PHP
ii php7.0-fpm 7.0.13-0ubuntu0.16.04.1 amd64 server-side, HTML-embedded scripting language (FPM-CGI binary)
ii php7.0-gd 7.0.13-0ubuntu0.16.04.1 amd64 GD module for PHP
ii php7.0-intl 7.0.13-0ubuntu0.16.04.1 amd64 Internationalisation module for PHP
ii php7.0-json 7.0.13-0ubuntu0.16.04.1 amd64 JSON module for PHP
ii php7.0-ldap 7.0.13-0ubuntu0.16.04.1 amd64 LDAP module for PHP
ii php7.0-mysql 7.0.13-0ubuntu0.16.04.1 amd64 MySQL module for PHP
ii php7.0-opcache 7.0.13-0ubuntu0.16.04.1 amd64 Zend OpCache module for PHP
ii php7.0-readline 7.0.13-0ubuntu0.16.04.1 amd64 readline module for PHP
ii php7.0-xml 7.0.13-0ubuntu0.16.04.1 amd64 DOM, SimpleXML, WDDX, XML, and XSL module for PHP

dpkg -l |grep icinga
ii icinga2 2.6.2-1ppa1xenial1 amd64 host and network monitoring system
ii icinga2-bin 2.6.2-1ppa1xenial1 amd64 host and network monitoring system - daemon
ii icinga2-common 2.6.2-1ppa1xenial1 all host and network monitoring system - common files
ii icinga2-ido-mysql 2.6.2-1ppa1xenial1 amd64 host and network monitoring system - MySQL support
ii icingacli 2.4.1-1ppa1604+1 all simple CLI tool for Icingaweb2 and its modules
ii icingaweb2 2.4.1-1
ppa1604+1 all simple and responsive web interface for Icinga
ii icingaweb2-common 2.4.1-1ppa1604+1 all simple and responsive web interface for Icinga - common files
ii icingaweb2-module-doc 2.4.1-1
ppa1604+1 all simple and responsive web interface for Icinga - documentation module
ii icingaweb2-module-monitoring 2.4.1-1ppa1604+1 all simple and responsive web interface for Icinga - monitoring module
ii libicinga2 2.6.2-1
ppa1xenial1 amd64 host and network monitoring system - internal libraries
ii php-icinga 2.4.1-1
ppa1604+1 all PHP library to communicate with and use Icinga

@dnsmichi
Copy link
Contributor

Hi, please open a new issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/framework Affects third party integration/development bug Something isn't working queue/important Blocks a release or needs immediate attention
Projects
None yet
Development

No branches or pull requests

3 participants