[SOLVED] error after installing today (04-10-06)
|
CHEETAH
![]()
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 |


Posts: 8598
what is the url you're trying to access? do you have short urls enabled in your Site Admin / General screen?
Posts: 37
1.) the main.php
2.) i dont know - how can I access the admin page to turn that off/on??
Posts: 8598
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..
Posts: 37
1.) the url appears like "http://www.mydomain.com/gallery2/main.php"
2.) New error code is as follows:
Posts: 8598
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..
Posts: 2
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.
Posts: 8598
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)
Posts: 2
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
Posts: 37
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
Posts: 51
Hi.. Just tried to install G2 as well.. and get the same error..
should I post same tests or..
-- Osomanden
Posts: 51
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]
Posts: 51
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...
Posts: 8598
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!)
Posts: 8598
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!
Posts: 51
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.
Posts: 328
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?
Posts: 51
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.
Posts: 328
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.
Posts: 51
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..
Posts: 328
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!
Posts: 51
Running PHP 4.8.9 (php.exe) on a win2k with 512 Mb ram. mysql 4.20d and phpmyadmin 2.6.0
Posts: 8598
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.
Posts: 37
So what is the solution?? what shall I change in the code??
thx! /CHEETAH
Posts: 6019
CHEETAH, follow the instructions that mindless mentioned in his last post:
Posts: 7
This worked for me also right after a clean install.
Posts: 37
well doing so I still get the below error:
Posts: 8598
Apparently my request is too many posts ago and has been forgotten.. here's what I'm looking for:
Posts: 37
[doublepost]
Posts: 37
[tripplepost]
Posts: 37
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!
Posts: 8598
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?
Posts: 37
Ok. I reinstalled now Alpha 3. Results on main page are still:
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]
Posts: 8598
Thanks, CHEETAH.. try the latest daily snapshot or update from cvs and it should work. The fix is not in alpha3.
Posts: 37
what/how do you mean???? daily snapshot? udate from cvs??
Posts: 32356
CHEETAH,
http://jpmullan.com/galleryupdates/
http://www.fw2.net/files/gallery/
Posts: 37
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
Posts: 32356
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.
Posts: 37
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:
Posts: 32356
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.
Posts: 37
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???
Posts: 37
btw "entity caches" is chinese for me.
Posts: 32356
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.
Posts: 37
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
Posts: 32356
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.
Posts: 37
i drop all g2 tables and deleted the whole thing. total restart. so lets see...
Posts: 37
Great it worked now! THX°!
Posts: 32356
good