Missing sql dir causes infinite loop on upgrade

Found a bug? Tell us!!
Post Reply
SaneLemmingCorp
Posts: 2
Joined: Mon Apr 11, 2011 5:03 am
Contact:

Missing sql dir causes infinite loop on upgrade

Post by SaneLemmingCorp »

This error occurs on upgrade if the sql directory doesn't exist:

Code: Select all

PHP Warning:  opendir(/path-to-s9y/sql/) [<a href='function.opendir'>function.opendir</a>]: failed to open dir: No such file or directory in /path-to-s9y/include/admin/upgrader.inc.php on line 155
Then this error occurs in an infinite loop, resulting in a gigabytes-large Apache log:

Code: Select all

PHP Warning:  readdir() expects parameter 1 to be resource, boolean given in /path-to-s9y/include/admin/upgrader.inc.php on line 157
Wasn't fun trying to cut that from the rest of my log.
post_count++;
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Missing sql dir causes infinite loop on upgrade

Post by garvinhicking »

Hi!

Well, you can't expect s9y to properly work if files/directories are missing...?!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
SaneLemmingCorp
Posts: 2
Joined: Mon Apr 11, 2011 5:03 am
Contact:

Re: Missing sql dir causes infinite loop on upgrade

Post by SaneLemmingCorp »

Well, I got rid of it because I didn't want the SQL files lying around. There were no new ones in the archive so it didn't get recreated: There were no DB upgrades to be done. They're not PHP files, so it's not like they're critical to S9Y working - in fact, only the upgrader could possibly expect them to be there.
So yes, I actually kind of expect one of two situations: Graceful handling of it considered as an error, or assumption that there are no upgrades to do. Is it that unlikely that someone would want to clean up old upgrade files that have no further use?
post_count++;
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Missing sql dir causes infinite loop on upgrade

Post by garvinhicking »

Hi!

The files there might always be related to s9y, you cannot simply delete files and expect a tool to work when you delete them.

We need to rely on certain factors; s9y having access to all files shipping with s9y is one of them. If we were to check each of those factors time and again, it would both slow down execution and cause a considerable maintenance overhead...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply