[SOLVED] Admin dashboard fails to load

brentil
brentil's picture

Joined: 2007-04-11
Posts: 121
Posted: Tue, 2010-05-18 19:19

This is a bit odd. It was working and now it's not. When I go to the Admin Dashboard it throws an error to me. I have the local.php file in place as well.

Gallery3 RC1

I have installed several modules, but all of the same ones I have running with no issue in another install. The other install was a fresh setup with new images added. This was also a fresh installation but it has had 8600+ images imported into it. I've also disabled all of the modules I added in plus all of the built in ones as well to see if it was any of those. I still get the same error even after disabling them. This seems to have started post importation of the images from G2.

PHPInfo

Quote:
ErrorException [ Warning Message ]:
file(/proc/loadavg) [function.file]: failed to open stream: Permission denied
MODPATH/gallery/helpers/gallery_block.php[ 75 ]

70 $block->css_id = "g-platform";
71 $block->title = t("Platform information");
72 $block->content = new View("admin_block_platform.html");
73 if (@is_readable("/proc/loadavg")) {
74 $block->content->load_average =
75 join(" ", array_slice(explode(" ", current(file("/proc/loadavg"))), 0, 3));
76 } else {
77 $block->content->load_average = t("Unavailable");
78 }
79 break;
80
{PHP internal call} » gallery_error_Core::error_handler()

MODPATH/gallery/helpers/gallery_block.php[ 75 ] » file( arguments )

{PHP internal call} » gallery_block_Core::get( arguments )

MODPATH/gallery/helpers/block_manager.php[ 106 ] » call_user_func( arguments )

MODPATH/gallery/controllers/admin_dashboard.php[ 26 ] » block_manager_Core::get_html( arguments )

{PHP internal call} » Admin_Dashboard_Controller->index()

MODPATH/gallery/controllers/admin.php[ 57 ] » call_user_func_array( arguments )

{PHP internal call} » Admin_Controller->__call( arguments )

SYSPATH/core/Kohana.php[ 330 ] » ReflectionMethod->invokeArgs( arguments )

{PHP internal call} » Kohana_Core::instance( arguments )

SYSPATH/core/Event.php[ 208 ] » call_user_func_array( arguments )

APPPATH/Bootstrap.php[ 67 ] » Event_Core::run( arguments )

DOCROOT/index.php[ 91 ] » require( arguments )

Debug log from var folder;

Quote:
2010-05-18 12:03:48 -07:00 --- error: ErrorException [ 0 ]: file(/proc/loadavg) [function.file]: failed to open stream: Permission denied
/htdocs/gallery/modules/gallery/helpers/gallery_block.php [ 75 ]
#0 [internal function]: gallery_error_Core::error_handler('/proc/loadavg')
#1 /htdocs/gallery/modules/gallery/helpers/gallery_block.php(75): file('platform_info', NULL)
#2 [internal function]: gallery_block_Core::get(Array, 'platform_info', NULL)
#3 /htdocs/gallery/modules/gallery/helpers/block_manager.php(106): call_user_func('dashboard_sideb...')
#4 /htdocs/gallery/modules/gallery/controllers/admin_dashboard.php(26): block_manager_Core::get_html()
#5 [internal function]: Admin_Dashboard_Controller->index(Array, Array)
#6 /htdocs/gallery/modules/gallery/controllers/admin.php(57): call_user_func_array('index', Array)
#7 [internal function]: Admin_Controller->__call(Object(Admin_Controller), Array)
#8 /htdocs/gallery/system/core/Kohana.php(330): ReflectionMethod->invokeArgs(NULL)
#9 [internal function]: Kohana_Core::instance(Array, Array)
#10 /htdocs/gallery/system/core/Event.php(208): call_user_func_array('system.execute')
#11 /htdocs/gallery/application/Bootstrap.php(67): Event_Core::run()
#12 /htdocs/gallery/index.php(91): require('/htdocs/...')
#13 {main}

 
brentil
brentil's picture

Joined: 2007-04-11
Posts: 121
Posted: Tue, 2010-05-18 19:21

I can get to any of the sub areas of the admin sections, just not the initial dashboard page.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Tue, 2010-05-18 19:41

Try upgrading to the latest experimental code.

Get it here:
http://github.com/gallery/gallery3/zipball/master

Upgrade instructions here:
http://codex.gallery2.org/Gallery3:Upgrading

Looks like your host doesn't allow access to read the loadavg on the server. I don't know about the RC1 code, but in the current code I'm running G3 checks to see if /proc/loadavg is readable. If not, then it doesn't do anything if so, then it grabs that info and displays it.

Oh wait, looks like code you posted is the same as what I have. I just set my /proc/loadavg to 400 so that the webserver can't read it and I get the expected behavior, the dashboard loads and just displays "Unavailable" for that.

Could you contact your host and see if they can think of why this would be failing?

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
brentil
brentil's picture

Joined: 2007-04-11
Posts: 121
Posted: Tue, 2010-05-18 19:54

The odd thing is I have two instances of Gallery3 running with the same host. Both are setup as www.MyURL.com/gallery and are running on the same web server. The other one is working with no issues but this one (G2 imported one) is failing.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Tue, 2010-05-18 20:09

Ah, try going to the Maintenance page and running the Fix Album/Photo hierarchy task.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
brentil
brentil's picture

Joined: 2007-04-11
Posts: 121
Posted: Tue, 2010-05-18 20:22
nivekiam wrote:
Ah, try going to the Maintenance page and running the Fix Album/Photo hierarchy task.

I don't have that option in either of my G3 installs on the Maintenance page. The options I have are;

Update Search Index
Import from Gallery 2
Rebuild Images
Update translations
Remove old files

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Tue, 2010-05-18 20:32

Then that was added after RC1 was released, try upgrading to the latest experimental code.

Get it here:
http://github.com/gallery/gallery3/zipball/master

Upgrade instructions here:
http://codex.gallery2.org/Gallery3:Upgrading
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
brentil
brentil's picture

Joined: 2007-04-11
Posts: 121
Posted: Wed, 2010-05-19 14:04

Ok, I installed the latest copy and ran the upgrader. Afterwards the option you suggested was available and I ran it. Still no dice though, the Dashboard page bombs with the same error message.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Wed, 2010-05-19 14:19

I have no idea then how you can have 2 installs of G3 on the same host and one works and one doesn't. Ask your host to see if they can see anything.

Do these 2 installs happen to be on different servers, still at the same host, but on different servers?

I'd also compare the code bases to see if there are differences, especially in that file:
gallery/helpers/gallery_block.php

As well as differences between your PHP environments.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
brentil
brentil's picture

Joined: 2007-04-11
Posts: 121
Posted: Wed, 2010-05-19 14:32

Hmmm they do load balancing so maybe they are on different running http servers. I'll check the PHPinfo from the other one as well and compare their files.

 
brentil
brentil's picture

Joined: 2007-04-11
Posts: 121
Posted: Wed, 2010-05-19 14:55

They are running on different cluster machines.

The gallery_block.php file is nearly the same between the RC1 and night build (there's a slight difference in case "language" where this is case "platform_info").

I logged into my other admin after figuring out exactly what info this is returning. On that install in the Platform Information block the "Server load:" output is blank.

So I changed the code for that section as follows and it works now because it ignores that item no matter what. It seems it has access to read /proc/loadavg but it does not have access to execute it. This then results in epic fail!

Quote:
case "platform_info":
$block->css_id = "g-platform";
$block->title = t("Platform information");
$block->content = new View("admin_block_platform.html");
if (@is_readable("/proc/loadavg")) {
/*$block->content->load_average = join(" ", array_slice(explode(" ", current(file("/proc/loadavg"))), 0, 3));*/
$block->content->load_average = t("Unavailable");
} else {
$block->content->load_average = t("Unavailable");
}
break;

 
brentil
brentil's picture

Joined: 2007-04-11
Posts: 121
Posted: Wed, 2010-05-19 14:57

So this could be because /proc/loadavg has different permissions, the different servers have mismatching versions, etc. Either way in some sort of case even if the file is readable it can result in both no information returned and the system showing it as blank or an error being returned resulting in the page failing.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25945
Posted: Wed, 2010-05-19 20:06

brentil,
Thanks for the detective work! :-)
Please file a bug report so we can do a better job of detecting this issue.
https://sourceforge.net/apps/trac/gallery/newticket
So we don't loose track of this issue.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
brentil
brentil's picture

Joined: 2007-04-11
Posts: 121
Posted: Wed, 2010-05-19 20:29

Ticket made!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25945
Posted: Wed, 2010-05-19 21:39

Thanks.
For the benefit of others:
https://sourceforge.net/apps/trac/gallery/ticket/1149

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25945
Posted: Mon, 2010-06-07 13:43
 
brentil
brentil's picture

Joined: 2007-04-11
Posts: 121
Posted: Tue, 2011-01-18 15:05

FYI this has creeped back into Gallery 3.0 final again. I hardly ever use the dashboard and just recently upgraded so I'm just now noticing this.

Quote:
ErrorException [ Warning Message ]:
current() [function.current]: Passed variable is not an array or object
MODPATH/gallery/helpers/gallery_block.php[ 73 ]

68
69 case "platform_info":
70 $block->css_id = "g-platform";
71 $block->title = t("Platform information");
72 $block->content = new View("admin_block_platform.html");
73 if (@is_readable("/proc/loadavg") && $first_line = current(@file("/proc/loadavg"))) {
74 $block->content->load_average =
75 join(" ", array_slice(explode(" ", $first_line), 0, 3));
76 } else {
77 $block->content->load_average = t("Unavailable");
78 }
{PHP internal call} » gallery_error_Core::error_handler()

MODPATH/gallery/helpers/gallery_block.php[ 73 ] » current( arguments )

{PHP internal call} » gallery_block_Core::get( arguments )

MODPATH/gallery/helpers/block_manager.php[ 106 ] » call_user_func( arguments )

MODPATH/gallery/controllers/admin_dashboard.php[ 27 ] » block_manager_Core::get_html( arguments )

{PHP internal call} » Admin_Dashboard_Controller->index()

MODPATH/gallery/controllers/admin.php[ 62 ] » call_user_func_array( arguments )

{PHP internal call} » Admin_Controller->__call( arguments )

SYSPATH/core/Kohana.php[ 331 ] » ReflectionMethod->invokeArgs( arguments )

{PHP internal call} » Kohana_Core::instance( arguments )

SYSPATH/core/Event.php[ 208 ] » call_user_func_array( arguments )

APPPATH/Bootstrap.php[ 67 ] » Event_Core::run( arguments )

DOCROOT/index.php[ 97 ] » require( arguments )

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Wed, 2011-01-19 06:47