[SOLVED] error after installing today (04-10-06)

CHEETAH
CHEETAH's picture

Joined: 2003-02-26
Posts: 37
Posted: Wed, 2004-10-06 08:48
Error (ERROR_MISSING_OBJECT)
in g:\home\mydomain.com\html\gallery2\modules\core\classes\GalleryUrlGenerator.class at line 278 (gallerystatus::error)
in g:\home\mydomain.com\html\gallery2\main.php at line 95 (galleryurlgenerator::parsecurrenturl)
in g:\home\mydomain.com\html\gallery2\main.php at line 47
in g:\home\mydomain.com\html\gallery2\main.php at line 40

Does anyone know what this is about??

THX! /CHEETAH

Login or register to post comments
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8598
Posted: Wed, 2004-10-06 15:51

what is the url you're trying to access? do you have short urls enabled in your Site Admin / General screen?

Login or register to post comments
CHEETAH
CHEETAH's picture

Joined: 2003-02-26
Posts: 37
Posted: Wed, 2004-10-06 16:38
mindless wrote:
what is the url you're trying to access? do you have short urls enabled in your Site Admin / General screen?

1.) the main.php

2.) i dont know - how can I access the admin page to turn that off/on??

Login or register to post comments
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8598
Posted: Wed, 2004-10-06 17:48

does main.php appear in the url twice?

edit modules/core/classes/GalleryUrlGenerator.class, line 278.. change from:
return array(GalleryStatus::error(ERROR_MISSING_OBJECT, __FILE__, __LINE__), null);
to
return array(GalleryStatus::error(ERROR_MISSING_OBJECT, __FILE__, __LINE__, $prefix), null);

then reaccess the url and tell us what the error message says now..

Login or register to post comments
CHEETAH
CHEETAH's picture

Joined: 2003-02-26
Posts: 37
Posted: Wed, 2004-10-06 18:38
mindless wrote:
does main.php appear in the url twice?

edit modules/core/classes/GalleryUrlGenerator.class, line 278.. change from:
return array(GalleryStatus::error(ERROR_MISSING_OBJECT, __FILE__, __LINE__), null);
to
return array(GalleryStatus::error(ERROR_MISSING_OBJECT, __FILE__, __LINE__, $prefix), null);

then reaccess the url and tell us what the error message says now..

1.) the url appears like "http://www.mydomain.com/gallery2/main.php"

2.) New error code is as follows:

Error (ERROR_MISSING_OBJECT) : gallery2
in g:\home\mydomain.com\html\gallery2\modules\core\classes\GalleryUrlGenerator.class at line 278 (gallerystatus::error)
in g:\home\mydomain.com\html\gallery2\main.php at line 95 (galleryurlgenerator::parsecurrenturl)
in g:\home\mydomain.com\html\gallery2\main.php at line 47
in g:\home\mydomain.com\html\gallery2\main.php at line 40
Login or register to post comments
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8598
Posted: Thu, 2004-10-07 00:08

that's very odd. couple things to try..

in GalleryUrlGenerator.class a little above where you made the above change, just after this:
$redirectUrl = null;
add this:
print "baseFile: " . $this->_baseFile . "<br/>\n";

also try this test php file:

<?php if (preg_match('|' . preg_quote('main.php') . '(/.*)|', 'http://mydomain.com/gallery2/main.php', $regs)) {
  print "match<br/>\n";
}
?>End.

post the results of each..

Login or register to post comments
anthonyrc

Joined: 2004-10-07
Posts: 2
Posted: Thu, 2004-10-07 05:41

I have exactly the same problem, so here's the results of the same tests:

1) baseFile: main.php
Error (ERROR_MISSING_OBJECT)
in H:\Inetpub\wwwroot\gallery2\modules\core\classes\GalleryUrlGenerator.class at line 282 (gallerystatus::error)
in H:\Inetpub\wwwroot\gallery2\main.php at line 95 (galleryurlgenerator::parsecurrenturl)
in H:\Inetpub\wwwroot\gallery2\main.php at line 47
in H:\Inetpub\wwwroot\gallery2\main.php at line 40

2) End. (that's all)

Configuration is IIS on Windows 2003 server, PHP 4.3.9
Gallery 1 works fine on the same system.

Login or register to post comments
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8598
Posted: Thu, 2004-10-07 06:08

ok, so I'm confused.. those are both the expected results if things are working correctly, but we know they're not.

if either of you want to PM me ssh access to your server I can probably figure this out more quickly, but i'm ok with posting debug stuff too.

change this:

$redirectUrl = null;
if (preg_match('|' . preg_quote($this->_baseFile) . '(/.*)|', $url, $regs)) {

to this:

$redirectUrl = null;
print "url: '$url'<br/>\n";
print "baseFile: '" . $this->_baseFile . "'<br/>\n";
print "preg_quote(baseFile): '" . preg_quote($this->_baseFile) . "'<br/>\n";
$x = preg_match('|' . preg_quote($this->_baseFile) . '(/.*)|', $url, $y);
print "preg_match: '$x'<br/>\n";
var_dump($y);
print "<br/>\n";
if (preg_match('|' . preg_quote($this->_baseFile) . '(/.*)|', $url, $regs)) {
print "in the if<br/>\n";

and post the results... (please PM me the actual exact $url value if you prefer not to post the real value here)

Login or register to post comments
anthonyrc

Joined: 2004-10-07
Posts: 2
Posted: Thu, 2004-10-07 07:38

Wow, that was a fast reply, here are the requested results:

url: 'http://morphasys.dns2go.com/gallery2/main.php/gallery2/main.php'
baseFile: 'main.php'
preg_quote(baseFile): 'main\.php'
preg_match: '1'
array(2) { [0]=> string(26) "main.php/gallery2/main.php" [1]=> string(18) "/gallery2/main.php" }
in the if
Error (ERROR_MISSING_OBJECT)
in H:\Inetpub\wwwroot\gallery2\modules\core\classes\GalleryUrlGenerator.class at line 288 (gallerystatus::error)
in H:\Inetpub\wwwroot\gallery2\main.php at line 95 (galleryurlgenerator::parsecurrenturl)
in H:\Inetpub\wwwroot\gallery2\main.php at line 47
in H:\Inetpub\wwwroot\gallery2\main.php at line 40

Login or register to post comments
CHEETAH
CHEETAH's picture

Joined: 2003-02-26
Posts: 37
Posted: Thu, 2004-10-07 08:21

ok so I think since anthonyrc had indentical error and anthonyrc have moved on when i've been sleeping with the testing of it I let you guys continue and just tell me when I need to try something! hope we can solve it as quickly as possible! :)

thx /CHEETAH

Login or register to post comments
osomanden
osomanden's picture

Joined: 2003-11-25
Posts: 51
Posted: Thu, 2004-10-07 09:46

Hi.. Just tried to install G2 as well.. and get the same error..

should I post same tests or..

-- Osomanden

Login or register to post comments
osomanden
osomanden's picture

Joined: 2003-11-25
Posts: 51
Posted: Thu, 2004-10-07 10:44
osomanden wrote:
Hi.. Just tried to install G2 as well.. and get the same error..

should I post same tests or..

-- Osomanden

So I just did ;-)

[block]
url: 'http://www.dulmens.dk/g2/main.php/g2/main.php'
baseFile: 'main.php'
preg_quote(baseFile): 'main\.php'
preg_match: '1'
array(2) { [0]=> string(20) "main.php/g2/main.php" [1]=> string(12) "/g2/main.php" }
in the if
Error (ERROR_MISSING_OBJECT) : g2
in D:\internet\www\dulmens.dk\www\g2\modules\core\classes\GalleryUrlGenerator.class at line 274 (gallerystatus::error)
in D:\internet\www\dulmens.dk\www\g2\main.php at line 95 (galleryurlgenerator::parsecurrenturl)
in D:\internet\www\dulmens.dk\www\g2\main.php at line 47
in D:\internet\www\dulmens.dk\www\g2\main.php at line 40
[/block]

Login or register to post comments
osomanden
osomanden's picture

Joined: 2003-11-25
Posts: 51
Posted: Thu, 2004-10-07 12:21

Found the error:

In modules/core/classes/GalleryUrlGenerator.class the function GetCurrentUrl() has something like:

if (!empty($_SERVER['PATH_INFO']))
$path .= $_SERVER['PATH_INFO'];

I removed it and wham.. nice front page there...

Login or register to post comments
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8598
Posted: Thu, 2004-10-07 15:24

thanks everyone... ah, so it did come down to my original hypothesis ("is main.php in the url twice?"), but it's only that G2 thinks main.php is in the url twice..

so, that code was added because of this thread, to help short urls work with IIS.

I think I'll try this as the fix:
if (!empty($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] != $path) {

tomorrow try updating from cvs or getting a nightly snapshot and hopefully it will work ok (if someone wants to manually make the fix above and let us know if it works today, that'd be good too!)

Login or register to post comments
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8598
Posted: Thu, 2004-10-07 15:41

also, can one of you access this url: /yourgallery2/lib/tools/phpinfo.php?test=param
then find the Environment section and post the values for any of these you find:
SCRIPT_NAME, REQUEST_URI, QUERY_STRING, PATH_INFO
(or anything else that shows the phpinfo.php path and/or query string)
thanks!

Login or register to post comments
osomanden
osomanden's picture

Joined: 2003-11-25
Posts: 51
Posted: Fri, 2004-10-08 07:44

As a security precaution, please enter your setup password to continue.

Your password is defined in your gallery/config.php file like this:
$gallery->setConfig('setup.password', 'your password here');

Password:

is what I get, and entering the password that is in the config.php... I get the same page again.. So no luck there.

Login or register to post comments
baschny
baschny's picture

Joined: 2003-01-04
Posts: 328
Posted: Fri, 2004-10-08 07:55

mindless, this crazy confusion about server variables is really a mess.

I would suggest collecting and maintaing a repository of those important server variables (SCRIPT_NAME, REQUEST_URI, QUERY_STRING, PATH_INFO) for different PHP vs SAPI environments and use that information to maintain our unit-tests. (like I have done for the imagemagick phpunit tests, see modules/imagemagick/test/phpunit/ImEnvironments.inc.

Currently there are some things in the GalleryUrlGenerator and the respective that only mindless can recall why. :)

What do you think?

Login or register to post comments
osomanden
osomanden's picture

Joined: 2003-11-25
Posts: 51
Posted: Fri, 2004-10-08 08:13

I think: first off.. this is an alpa release, so make sure security (like the above) works, then remove it for devel. purpose. (reinsert at beta or beta2).
Insert link to a page (modules/test/phpunit/{functionname.php) that receives the requested information (SCRIPT_NAME, REQUEST_URI, QUERY_STRING, PATH_INFO). It would make life a lot easier.. ;-)

Just my opinion..

That said, I see a G2 that is very well done (as so far) and seeing the code I understand why it takes so long to develop. So many things to account for and make sure works.

Login or register to post comments
baschny
baschny's picture

Joined: 2003-01-04
Posts: 328
Posted: Fri, 2004-10-08 08:32

osomanden, the security in phpunit and the other tools is there because those tools can extract sensitive server-information. Many people are running G2 already on servers on the Internet, we don't want those servers to be exposed just because G2 is alpha.

There is already a phpinfo.php script included in G2 (lib/tools/phpinfo.php) which will extract the required information. This again is a page that exposes many server-details that might be interesting for a potential intrusor, that's why its also password protected. All we can do is ask the person to check that page (using the setup password) or hand us the setup password for us to look at our own.

Login or register to post comments
osomanden
osomanden's picture

Joined: 2003-11-25
Posts: 51
Posted: Fri, 2004-10-08 08:41

I see your point. But running an alpha release as prod. online... tsk.. ;-)

I fully understand the security issues at hand an I agree.

For what it is worth, I have installed G2 on my own server and I am perfectly willing to let the G2 team have access to it in developing G2. There is even phpmyadmin installed for G2 only and ftp access.

It is an offer..

Login or register to post comments
baschny
baschny's picture

Joined: 2003-01-04
Posts: 328
Posted: Fri, 2004-10-08 08:51

osomanden, G2-Alpha is already as secure as we could get it, so I see no problem in testing it online on the Internet.

Our current main problem is testing things on Windows platforms. There are many different combinations possible that change stuff:

PHP 4 vs PHP 5
IIS vs Apache
ISAPI vs CGI-mode
IIS4 vs IIS5 vs IIS6
WinNT vs Win2k vs WinXP vs Win2003

To add to the confusion, there are PHP's with some patched ISAPI module to handle PATH_INFO and there are the official PHP ISAPI modules.

What is your constelation?

All the _SERVER-variables problems do not appear on Apache, because they are all handled the same way.

Last time I tried to understand that thing I found myself comparing the ISAPI C-source-code from different PHP versions.. and I must confess: It's ugly!

Login or register to post comments
osomanden
osomanden's picture

Joined: 2003-11-25
Posts: 51
Posted: Fri, 2004-10-08 09:02

Running PHP 4.8.9 (php.exe) on a win2k with 512 Mb ram. mysql 4.20d and phpmyadmin 2.6.0

Login or register to post comments
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8598
Posted: Fri, 2004-10-08 14:59

oops, my bad.. security.inc has basically the same code as GalleryUrlGenerator so that's the problem in accessing phpinfo.
Please edit lib/tools/phpinfo.php and comment out the require_once line (add // in front).. now try again and you won't get the password prompt.

Login or register to post comments
CHEETAH
CHEETAH's picture

Joined: 2003-02-26
Posts: 37
Posted: Sat, 2004-10-09 15:52

So what is the solution?? what shall I change in the code??

thx! /CHEETAH

Login or register to post comments
bharat
bharat's picture

Joined: 2002-05-21
Posts: 6019
Posted: Sat, 2004-10-09 16:40

CHEETAH, follow the instructions that mindless mentioned in his last post:

Quote:
Please edit lib/tools/phpinfo.php and comment out the require_once line (add // in front).. now try again and you won't get the password prompt.

Login or register to post comments
broadband

Joined: 2004-08-22
Posts: 7
Posted: Sun, 2004-10-10 21:12

This worked for me also right after a clean install.

Login or register to post comments
CHEETAH
CHEETAH's picture

Joined: 2003-02-26
Posts: 37
Posted: Tue, 2004-10-12 15:27
bharat wrote:
CHEETAH, follow the instructions that mindless mentioned in his last post:

Quote:
Please edit lib/tools/phpinfo.php and comment out the require_once line (add // in front).. now try again and you won't get the password prompt.

well doing so I still get the below error:

Error (ERROR_MISSING_OBJECT) : gallery2
in g:\home\hejhopp.com\html\gallery2\modules\core\classes\GalleryUrlGenerator.class at line 278 (gallerystatus::error)
in g:\home\hejhopp.com\html\gallery2\main.php at line 95 (galleryurlgenerator::parsecurrenturl)
in g:\home\hejhopp.com\html\gallery2\main.php at line 47
in g:\home\hejhopp.com\html\gallery2\main.php at line 40

Login or register to post comments
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8598
Posted: Tue, 2004-10-12 15:51

Apparently my request is too many posts ago and has been forgotten.. here's what I'm looking for:

Quote:
Please edit lib/tools/phpinfo.php and comment out the require_once line (add // in front)..

Quote:
also, can one of you access this url: /yourgallery2/lib/tools/phpinfo.php?test=param
then find the Environment section and post the values for any of these you find:
SCRIPT_NAME, REQUEST_URI, QUERY_STRING, PATH_INFO
(or anything else that shows the phpinfo.php path and/or query string)
thanks!

Login or register to post comments
CHEETAH
CHEETAH's picture

Joined: 2003-02-26
Posts: 37
Posted: Tue, 2004-10-12 16:17

[doublepost]

Login or register to post comments
CHEETAH
CHEETAH's picture

Joined: 2003-02-26
Posts: 37
Posted: Tue, 2004-10-12 16:18

[tripplepost]

Login or register to post comments
CHEETAH
CHEETAH's picture

Joined: 2003-02-26
Posts: 37
Posted: Tue, 2004-10-12 16:19
mindless wrote:
Apparently my request is too many posts ago and has been forgotten.. here's what I'm looking for:

Quote:
Please edit lib/tools/phpinfo.php and comment out the require_once line (add // in front)..

Quote:
also, can one of you access this url: /yourgallery2/lib/tools/phpinfo.php?test=param
then find the Environment section and post the values for any of these you find:
SCRIPT_NAME, REQUEST_URI, QUERY_STRING, PATH_INFO
(or anything else that shows the phpinfo.php path and/or query string)
thanks!

SCRIPT_NAME /gallery2/lib/tools/phpinfo.php
QUERY_STRING test=par
PATH_INFO /gallery2/lib/tools/phpinfo.php
REQUEST_URI: didn't find this one!

Login or register to post comments
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8598
Posted: Tue, 2004-10-12 19:14

Thanks.. if other people on windows can try this too it would be helpful.. just post if your results are different.

Another url to try: /yourgallery2/lib/tools/phpinfo.php/path/info?test=param
CHEETAH, does this url work for you? If so, what are the environment variable values?

Login or register to post comments
CHEETAH
CHEETAH's picture

Joined: 2003-02-26
Posts: 37
Posted: Sun, 2004-10-17 20:13
mindless wrote:
Thanks.. if other people on windows can try this too it would be helpful.. just post if your results are different.

Another url to try: /yourgallery2/lib/tools/phpinfo.php/path/info?test=param
CHEETAH, does this url work for you? If so, what are the environment variable values?

Ok. I reinstalled now Alpha 3. Results on main page are still:

Error (ERROR_MISSING_OBJECT)
in g:\home\ mydomain.com\html\gallery2a3\modules\core\classes\GalleryUrlGenerator.class at line 278 (gallerystatus::error)
in g:\home\ mydomain.com\html\gallery2a3\main.php at line 95 (galleryurlgenerator::parsecurrenturl)
in g:\home\ mydomain.com\html\gallery2a3\main.php at line 47
in g:\home\ mydomain.com\html\gallery2a3\main.php at line 40

The address you specified above gives the below result:
No input file specified.

But if I instead use this url: http://www.mydomain.com/gallery2a3/lib/tools/phpinfo.php?test=param I get all the PHP info results.

Thanks! /CHEETAH[/url]

Login or register to post comments
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8598
Posted: Sun, 2004-10-17 20:24

Thanks, CHEETAH.. try the latest daily snapshot or update from cvs and it should work. The fix is not in alpha3.

Login or register to post comments
CHEETAH
CHEETAH's picture

Joined: 2003-02-26
Posts: 37
Posted: Sun, 2004-10-17 20:27

what/how do you mean???? daily snapshot? udate from cvs??

Login or register to post comments
valiant

Joined: 2003-01-04
Posts: 32356
Posted: Sun, 2004-10-17 20:32
Login or register to post comments
CHEETAH
CHEETAH's picture

Joined: 2003-02-26
Posts: 37
Posted: Sun, 2004-10-17 20:35

So I just dl G2/gallery2.2004-10-17-08-31-39.zip 5858K from the first link and overwrite my old thing??

thx! /CHEETAH

Login or register to post comments
valiant

Joined: 2003-01-04
Posts: 32356
Posted: Sun, 2004-10-17 21:00

and don't forget to wipe out you database and to empty the g2data directory.

and don't use winzip to decompress the downloaded file, use winrar or other tools, just not winzip.

Login or register to post comments
CHEETAH
CHEETAH's picture

Joined: 2003-02-26
Posts: 37
Posted: Sun, 2004-10-17 22:05

I didn't wipe out the database but I redid the config with new table and columnprefixes so that shouldnt matter right?

what I got:

in g:\home\mydomain.com\html\gallery2a3\modules\core\classes\GalleryStorage\DatabaseStorage.class at line 1362 (gallerystatus::error)
in g:\home\mydomain.com\html\gallery2a3\modules\core\classes\GalleryStorage\DatabaseStorage.class at line 260 (mysqldatabasestorage::_identifyentities)
in g:\home\mydomain.com\html\gallery2a3\modules\core\classes\GalleryStorage.class at line 113 (mysqldatabasestorage::loadentities)
in g:\home\mydomain.com\html\gallery2a3\modules\core\classes\helpers\GalleryEntityHelper_simple.class at line 89 (gallerystorage::loadentities)
in g:\home\mydomain.com\html\gallery2a3\modules\core\classes\GalleryCoreApi.class at line 1977 (galleryentityhelper_simple::loadentitiesbyid)
in g:\home\mydomain.com\html\gallery2a3\modules\core\classes\GalleryView.class at line 313 (gallerycoreapi::loadentitiesbyid)
in g:\home\mydomain.com\html\gallery2a3\modules\core\ShowItem.inc at line 44 (showitemview::_getitem)
in g:\home\mydomain.com\html\gallery2a3\modules\core\classes\GalleryView.class at line 209 (showitemview::getthemename)
in g:\home\mydomain.com\html\gallery2a3\main.php at line 281 (showitemview::doloadtemplate)
in g:\home\mydomain.com\html\gallery2a3\main.php at line 47
in g:\home\mydomain.com\html\gallery2a3\main.php at line 40
Login or register to post comments
valiant

Joined: 2003-01-04
Posts: 32356
Posted: Sun, 2004-10-17 22:08

go to your_gallery_url/lib/tools/test/ and delete the template and entity caches

if that doesn't help, reset the gallery installation with the link in lib/tools/test (deletes everything), if that fails wipe out the g2data directory and drop all tables from the database.

Login or register to post comments
CHEETAH
CHEETAH's picture

Joined: 2003-02-26
Posts: 37
Posted: Sun, 2004-10-17 22:12

nothing works... i cant access my database as it is currently so I cant drop all tables. and it shouldnt matter... or does the gallery communicate with tables that doesnt belong to the gallery???

Login or register to post comments
CHEETAH
CHEETAH's picture

Joined: 2003-02-26
Posts: 37
Posted: Sun, 2004-10-17 22:13

btw "entity caches" is chinese for me.

Login or register to post comments
valiant

Joined: 2003-01-04
Posts: 32356
Posted: Sun, 2004-10-17 22:31

browse to your_gallery/lib/tools/test/ (replace your_gallery with the path to your G2)

click on:

EmptyGallery Clean out all the Gallery filesystem data.
FlushCache Get rid of all cached entities

browse back to your G2 and check if it works now.
if not, get back to lib/tools/test/
and hit the link

ReInitializeGallery Reset the database and the gallery data area. Create root album, anonymous user.

get back to G2 and check if it works.

if not, we have a problem.

Login or register to post comments
CHEETAH
CHEETAH's picture

Joined: 2003-02-26
Posts: 37
Posted: Sun, 2004-10-17 22:35

well i get a lot of errors at your_gallery/lib/tools/test/. i deleting again and emptying database. i managed to now. so do you think i shall give it a try again and ul or not? ul will take like 30 minutes each time i do it cuz ma server is slow so :)

Login or register to post comments
valiant

Joined: 2003-01-04
Posts: 32356
Posted: Sun, 2004-10-17 22:43

what do you want to upload?
you only need to delete the contents of g2data directory.
then try again the lib/tools/test/ links.
if you still get errors at lib/tools/test/, drop all G2 tables from your database.

then try installing G2 again.

if that doesn't work, upload G2 again to your server.

Login or register to post comments
CHEETAH
CHEETAH's picture

Joined: 2003-02-26
Posts: 37
Posted: Sun, 2004-10-17 22:44

i drop all g2 tables and deleted the whole thing. total restart. so lets see... :)

Login or register to post comments
CHEETAH
CHEETAH's picture

Joined: 2003-02-26
Posts: 37
Posted: Sun, 2004-10-17 23:18

Great it worked now! THX°!

Login or register to post comments
valiant

Joined: 2003-01-04
Posts: 32356
Posted: Sun, 2004-10-17 23:23

good :)

Login or register to post comments