Hi! And sorry for the alarmist title, but that is what's happening. It's very strange.

I am running Drupal 6.10 and have just upgraded from tax image 6-1.5 to 6-1.6

1.5 was working great on my site, but 1.6 has broken it to the point where it won't load until I remove taxonomy_image from my modules directory.

I have my images in two different places at the moment:
/var/www/sitename.com/files/taxonomy_image/ <- This holds most of the images.
/var/www/sitename.com/files/catagory_pictures <- This holds the last 5 or so images I've uploaded. At some stage this path must have changed, or I changed it from the above.

The module itself is installed in: /var/www/sitename.com/sites/sitename.com/modules/taxonomy_image/

The problem appears to be, most of my images appear in the SQL table with their path like this:
files/taxonomy_image/imagename.ext

However, the last 5 images (the ones that are stored in the catagory_pictures directory) are stored as just the filename. There's no path prepended.

This is, I assume, the reason the following appears in my access logs:

sitename.com:80 X.X.X.X - - [18/Apr/2009:22:22:14 +0200] "GET /files/category_pictures//files/taxonomy_image/cactus.gif HTTP/1.0" 503 2534 "-" "-
"
sitename.com:80 X.X.X.X - - [18/Apr/2009:22:22:14 +0200] "GET /files/category_pictures//files/taxonomy_image/grumpy.gif HTTP/1.0" 503 2534 "-" "-
"
sitename.com:80 X.X.X.X - - [18/Apr/2009:22:22:14 +0200] "GET /files/category_pictures//files/taxonomy_image/flying.gif HTTP/1.0" 404 14868 "-" "
-"
sitename.com:80 X.X.X.X - - [18/Apr/2009:22:22:14 +0200] "GET /files/category_pictures//files/taxonomy_image/flying.gif HTTP/1.0" 503 2534 "-" "-

What's worse however is that when this happens, the maximum number of SQL connections to my server is rapidly reached and the site goes offline. The follow keep scrolling in the apache error log:

[Sat Apr 18 22:32:33 2009] [error] [client 91.121.171.15] File does not exist: /var/www/sitename.com/files/category_pictures/files
[Sat Apr 18 22:32:33 2009] [error] [client 91.121.171.15] File does not exist: /var/www/sitename.com/files/category_pictures/files
[Sat Apr 18 22:32:33 2009] [error] [client 91.121.171.15] File does not exist: /var/www/sitename.com/files/category_pictures/files
[Sat Apr 18 22:32:33 2009] [error] [client 91.121.171.15] File does not exist: /var/www/sitename.com/files/category_pictures/files

Once I restart apache (and move taxonomy_image out of the modules directory) everything's working again.

So I was hoping someone could help with my questions:

1) Is this a valid bug, or is my setup somehow very wonky?
2) Should the entries in the DB have the full path included, or is this something that was done in an older version and now isn't supported?
3) Was the fact it worked with v1.5 pure luck? :)
4) Even though there's something wrong with my setup (paths or something), isn't the fact that the mysql sessions max out the server indicative of some other bug where a request is processed over and over again when it fails?

Many thanks for any help you can offer. I hope I have provided enough information.

Kind Regards,

Tim

PS Software Specs:

Apache 2.2.9 (Debian)
PHP 5.2.6-1+lenny2 with Suhosin-Patch 0.9.6.2 (eAccelerator v0.9.5.3)
MySQL 5.0.51a

Comments

nancydru’s picture

Status: Active » Postponed (maintainer needs more info)

Did you run update.php after the upgrade? You can change the file directory where the images are stored and move the images all into that directory.

tjharman’s picture

Yes, I ran update.php after the upgrade. I have tried changing the path, now the error log fills with:

[Sun Apr 19 19:18:35 2009] [error] [client 91.121.171.15] File does not exist: /var/www/sitename.com/files/taxonomy_image/files

I should also point out, I am using the "Node Display" module and it's loading the front page, where I used to see the images on each story, that's causing the problem.

What does a "normal" entry in the term_image table look like? Does the file have a path, or just a filename?

Kind Regards,
Tim

nancydru’s picture

Term_image would have only the file name. There is a setting for which directory it is stored in. Another issue indicates you must be using Public file upload. Also, please try clearing the cache again after you changed the directory.

tjharman’s picture

I'm serving files using public, not private.

Are you able to provide a SQL query that strips the leading pathnames from the images in the table? I can't do SQL and don't want to have to do 100 odd entries by hand :)

I have tried clearing the cache, but that hasn't helped.

Many thanks,

Tim

tjharman’s picture

Ignore previous request :)

I have since dumped the file using phpmyadmin and done a find replace using notepad and then pasted the resulting dump back in. I'll give you a moment to cry over what a ugly hack that is, but it worked!

My term_image table now only has the filename of the image, no pathname. Images are displaying as expected now.

Very werid that I managed to trigger this issue, I suspect it might have had something to do with the script I used ~2 years ago when migrating from PostNuke to Drupal.

All sorted now - Thanks for your help. Issue can be closed as PEBCAK.

nancydru’s picture

Status: Postponed (maintainer needs more info) » Fixed

The taxonomy_image_update_6101 function should have changed the paths automatically, but I see that if there was no previous setting for the path, it might not have worked.

andypost’s picture

Status: Fixed » Needs work

So this one is not fixed... all previous images are prefixed with path so why not use old path?

Suppose it should be re-think for example when public-private method is changed or image_attach functionality

mdeltito’s picture

I'm having a very similar problem on 6.20 using taxonomy_image 1.6

I upgraded a Drupal install from 6.17 => 6.20. Afterward, loading any page on the site would crash apache.

I traced this out and determined that the cause of the crash was an infinite loop, which is caused by a missing taxonomy image file. The request for the taxonomy image is routed through index.php since it does not exist (this is the correct behavior per .htaccess). There, it hits drupal_not_found(), which again is correct in D6. The problem is that Drupal then tries to load the taxonomy image again during the 404, causing the process to repeat indefinitely.

I haven't yet determined why taxonomy_image seems to be loading images on EVERY request, but that certainly seems to be the case.

Any insights?