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

Unable to Initiate Suma Server following INSTALL.md #1

Closed
bassettsj opened this issue Jan 15, 2013 · 25 comments
Closed

Unable to Initiate Suma Server following INSTALL.md #1

bassettsj opened this issue Jan 15, 2013 · 25 comments
Assignees

Comments

@bassettsj
Copy link

Trying to initiate a test install of the Suma project. We are getting an error every time we try to load the Suma server admin interface. Zend is unable to load the controller.

Error Message

Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (sumaserver)' in /usr/share/php/Zend/Controller/Dispatcher/Standard.php:248 Stack trace: #0 /usr/share/php/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 /var/www/app/Suma/service/web/index.php(25): Zend_Controller_Front->dispatch() #2 {main} thrown in /usr/share/php/Zend/Controller/Dispatcher/Standard.php on line 248

Index.php File

/var/www/app/Suma/service/web/index.php

<?php

// Error Reporting
error_reporting(E_ERROR | E_WARNING | E_PARSE);
ini_set('display_errors', 'on');

// Set paths
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . 'SUMA_SERVER_PATH');

// Zend Framework CLass Loader
require_once "Zend/Loader.php";

require_once "/var/www/app/Suma/service/config/Globals.php";

Zend_Loader::loadClass('Zend_Controller_Front');

// Get front controller instance
// Configure for Zone
$front = Zend_Controller_Front::getInstance();
$front->setControllerDirectory('/var/www/app/Suma/service/controllers/')
      ->setBaseUrl('/var/www/app/Suma/web/') // set the base url
      ->throwExceptions(true);

// Go
$front->dispatch();
@ghost ghost assigned cazzerson Jan 15, 2013
@cazzerson
Copy link
Collaborator

Thanks for trying out Suma. This kind of feedback to extremely helpful as we continue to try to improve the Suma install process. Have you copied this index.php file somewhere else in your web directory, or are you accessing /var/www/app/Suma/service/web/index.php directly? I am able to reproduce this error by placing a redundant 'sumaserver' at the end of the URL (e.g. http://host/sumaserver/sumaserver), but this may not be the problem in this case. One issue that I noticed with your index.php file is the setBaseUrl() call. This should contain the base URL path to the index.php file (rather than the filesystem path). For example, if you copied this file to htdocs/sumaserver/index.php, the setBaseUrl() call should be:

  ->setBaseUrl('/sumaserver') // set the base url

@bassettsj
Copy link
Author

@cazzerson Wow what a quick response! Thank you!

We would like to use this tool here at Northeastern University Libraries as well. Unfortunately I was just told this morning to put it on the back burner for the time being but thank you so much for your help.

--Steven

@KarlYee
Copy link

KarlYee commented Jan 24, 2013

Working w/ bassetts to get Suma up and working here at NU libraries. By making the suggested change within index.php, "setBaseUrl('/sumaserver') // set the base url"

The orginal error message went away. Only to be replace with a warning:

Warning: require_once(models/SessionModel.php): failed to open stream: No such file or directory in /var/www/app/Suma/service/controllers/AdminController.php on line 4

@cazzerson
Copy link
Collaborator

Sorry, I missed another issue in the file included above. In this line:

ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . 'SUMA_SERVER_PATH');

(it should be line 7 or 8 of the service/web/index.php file), the string SUMA_SERVER_PATH should be replaced, in your case, with /var/www/app/Suma/service

@cazzerson cazzerson reopened this Jan 24, 2013
@KarlYee
Copy link

KarlYee commented Jan 24, 2013

Made the recommended changes to index.php

It got rid of "Warning: require_once(models/SessionModel.php): failed to open stream: No such file or directory in /var/www/app/Suma/service/controllers/AdminController.php on line 4"

But ...

Replaced it with "Warning: require_once(Zend/Loader.php): failed to open stream: No such file or directory in /var/www/app/Suma/service/web/index.php on line 11 "

I checked my include statement in php.ini (shown below):
; UNIX: "/path1:/path2"
include_path = ".:/php/includes:/usr/share/php/Zend"

The index.php now reflects your recommended changes:

setControllerDirectory('/var/www/app/Suma/service/controllers') ->setBaseUrl('/sumaserver') // set the base url ->throwExceptions(true); // Go $front->dispatch();

@cazzerson
Copy link
Collaborator

OK, we're getting there. Could you look around in /usr/share/php/Zend and find the path to the Zend/Loader.php file? Depending on how ZF is installed, you may need a different path in your include_path. For example, mine is actually root path/Zend/library (instead of just /Zend).

By the way, the version of index.php you pasted still has the default SUMA_SERVER_PATH string on line 8ish.

@KarlYee
Copy link

KarlYee commented Jan 24, 2013

No change in the warning.

There's only one file on the system named Loader.php. The path is as follows:

[root@libdev /]# find -name Loader.php
./usr/share/php/Zend/Loader.php

Also changed the SUMA_SERVER_PATH string on line 8 within my index.php file, the line now reads ...

// Set paths
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . '/var/www/app/Suma/service');

Thank-you for your help.

@cazzerson
Copy link
Collaborator

Thanks, this is helpful. It looks like there is an include_path issue for Zend. Looking at the include_path from your php.ini, the Zend path is included, but not the parent diretory. The Suma code assumes that Zend/Loader.php is in the search path, but what is being constructed instead is /usr/share/php/Zend/Zend/Loader.php. There are a few options:

  1. Add /usr/share/php on to the include_path in php.ini
  2. Add the following line to the service/web/index.php for Suma before the other ini_set line:
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . '/usr/share/php');
  1. If you aren't currently using Zend Framework anywhere else, you could move it somewhere else in the search path (e.g. /php/includes).

The second option would probably be the easiest way to test this, and then you could make the php.ini change if it works.

@KarlYee
Copy link

KarlYee commented Jan 24, 2013

Yes! We have login web page and upon logon can see a menu selection.

But, another Zend error msg:

Fatal error: Uncaught exception 'Zend_Exception' with message 'File "Zend/Db/Adapter/Pdo/Mysql.php" does not exist or class "Zend_Db_Adapter_Pdo_Mysql" was not found in the file' in /usr/share/php/Zend/Loader.php:87 Stack trace: #0 /usr/share/php/Zend/Db.php(263): Zend_Loader::loadClass('Zend_Db_Adapter...') #1 /var/www/app/Suma/service/config/Globals.php(30): Zend_Db::factory('Pdo_Mysql', Array) #2 /var/www/app/Suma/service/models/LocationModel.php(216): Globals::getDBConn() #3 /var/www/app/Suma/service/controllers/AdminController.php(272): LocationModel::getLocTreeRoots() #4 /usr/share/php/Zend/Controller/Action.php(516): AdminController->locationsAction() #5 /usr/share/php/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('locationsAction') #6 /usr/share/php/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #7 /var/www/app/Suma/service/web/index.php(26): Zend_Controller_Front->dispatch() in /usr/share/php/Zend/Loader.php on line 87

Did a search for Mysql.php. Not found anywhere on the machine.

@cazzerson
Copy link
Collaborator

This is strange. Did you install this version of Zend Framework 1 recently? If you look at the ZF1 mirror, it should be there:

https://github.com/breerly/zf1/tree/master/library/Zend/Db/Adapter/Pdo

If you compare /usr/share/php/Zend to the ZF1 repository above, does it look like there are a lot of files missing?

@KarlYee
Copy link

KarlYee commented Jan 24, 2013

I did a YUM install for Zend Framework and it looks like I also need to install the php-ZendFramework-Db-Adapter-Pdo-Mysql package as well.

@cazzerson
Copy link
Collaborator

Ah, that's good to know. I think in our next development cycle we will package Zend Framework with Suma.

@KarlYee
Copy link

KarlYee commented Jan 24, 2013

Getting close. I get the Suma Administrative Tools login page, which works. I get menu page but none the links work except for the "Direct JSON Import" link. That brings up 'Enter JSON in textarea below and click "Submit". '
and an input box.

All the other links bring a blank page. No errors, warnings, nothing.

@KarlYee
Copy link

KarlYee commented Jan 24, 2013

Oh, I installed the php-ZendFramework-Db-Adapter-Pdo-Mysql package and can find the Mysql.php file .

@cazzerson
Copy link
Collaborator

Could you take a look at the Suma log file? If it doesn't exist, you'll need to point to a path that is writable by the web server in Suma/service/config/config.ini.

@KarlYee
Copy link

KarlYee commented Jan 24, 2013

In the sumaserver.log:

2013-01-24T15:10:59-05:00 ERR (3): ADMIN fetch initiatives error: File "Zend/Db/Adapter/Pdo/Mysql.php" does not exist or class "Zend_Db_Adapter_Pdo_Mysql" was not found in the file

Yet, when I do a find, it's there.
[root@libdev /]# find -name Mysql.php
./usr/share/php/Zend/Db/Adapter/Pdo/Mysql.php

[root@libdev Pdo]# ls -l Mysql.php
-rw-r--r--. 1 root root 9323 Jan 5 2012 Mysql.php

@cazzerson
Copy link
Collaborator

It looks like that log line is from 3:10pm--is it possible that it was written before you added the PDO package? if you check the log again after trying to view one of the broken admin tools, are there any new entries?

@KarlYee
Copy link

KarlYee commented Jan 24, 2013

Good point. I've logged in several times since and there's only one entry. I just tried it again, still only one entry.

@cazzerson
Copy link
Collaborator

I suspect that there may be a problem related to database access, since every admin view except the JSON input queries the database on load, but I'm having trouble recreating this exact problem (where no exceptions are displayed). I just sent you an email.

@KarlYee
Copy link

KarlYee commented Jan 24, 2013

Just a snippet from the mysqld.log file

130110 14:10:03 [ERROR] Native table 'performance_schema'.'events_waits_current' has the wrong structure
130110 14:10:03 [ERROR] Native table 'performance_schema'.'events_waits_history' has the wrong structure
130110 14:10:03 [ERROR] Native table 'performance_schema'.'events_waits_history_long' has the wrong structure

Not sure if this is related to the Suma installation. Recognize anything?

@KarlYee
Copy link

KarlYee commented Jan 25, 2013

In response to:
would you mind replacing the two error statements at the top of the sumaserver/index.php file with these lines?
error_reporting(E_ALL);
ini_set("display_errors", 1);

After doing so, I get this when I click on the links:

Fatal error: Cannot redeclare class Zend_Log_Filter_Abstract in /usr/share/php/Zend/Log/Filter/Abstract.php on line 38

On a different note. Your specs call for ZendFramework 1.11 I'm using version 1.12.1. Does this matter? Do you know ZendFramework 2 will work?

Karl

@KarlYee
Copy link

KarlYee commented Jan 25, 2013

We're getting a different error msg:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user 'sumaproduser'@'localhost' for table 'location'' in /usr/share/php/Zend/Db/Statement/Pdo.php:228 Stack trace: #0 /usr/share/php/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array) #1 /usr/share/php/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array) #2 /usr/share/php/Zend/Db/Adapter/Abstract.php(468): Zend_Db_Statement->execute(Array) #3 /usr/share/php/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query(Object(Zend_Db_Select), Array) #4 /usr/share/php/Zend/Db/Select.php(686): Zend_Db_Adapter_Pdo_Abstract->query(Object(Zend_Db_Select)) #5 /var/www/app/Suma/service/models/LocationModel.php(228): Zend_Db_Select->query() #6 /var/www/app/Suma/service/controllers/AdminController.php(272): LocationModel::getLocTreeRoots() #7 /usr/share/php/Zend/Controller/Action.php(513): AdminController->locationsAction() #8 /usr/share/php/Zend/Controller/Di in /usr/share/php/Zend/Db/Statement/Pdo.php on line 234

It hints at a database access issue. Going to try granting all rights to the database user and see what happens.

@cazzerson
Copy link
Collaborator

Zend Framework 2 won't work, but 1.12.1. should be fine. Out offline communications indicate that this was fixed with a fresh Zend Framework install along with updated database permissions.

@KarlYee
Copy link

KarlYee commented Jan 28, 2013

Jason. We have Suma up and running, SumaServer, Suma Client, and the analytics! Thank-you to you and your team for the generous, expert help. We couldn't have done it without you.

@cazzerson
Copy link
Collaborator

It's our pleasure. Keep us posted and, of course, all suggestions and pull requests are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants