The Serendipity Handbook

You can now read the (german) handbook here: PDF - https://github.com/s9y/Book (LaTeX source).

Forum-Information

Before posting about errors, make sure that the answer cannot already be found in our FAQ or by searching this forum!
Posting is restricted to registered users (registering is free and simple!) due to recent spam attacks. When having trouble with this board, contact garvin(-at)s9y(-dot)org.

Board index Plugins »Heavy Rotation« - Your top album in the last week

Creating and modifying plugins.
User avatar
garvinhicking
Core Developer
 
Posts: 28948
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Fri Apr 24, 2009 10:47 am

Hi!

Actually the plugin code instructs to only cache for an hour. Can you check your templates_c directory? It should contain a "serendipity_plugin_heavyrotation.txt" file, check its last modiufication time?

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/

User avatar
mo
Regular
 
Posts: 40
Joined: Mon Jan 28, 2008 12:33 am

Postby mo » Sun Apr 26, 2009 4:25 pm

user@server1:/html/blog/templates_c$ ls -la serendipity_plugin_heavyrotation.txt
-rw-r--r-- 1 user user 72 2009-04-15 12:28 serendipity_plugin_heavyrotation.txt

When I delete the file (or create an empty new one), the sidebar doesn't display at all. I have tried reinstalling the plugin, but that doesn't help (nor does it create a new cache file for it).

User avatar
garvinhicking
Core Developer
 
Posts: 28948
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Mon Apr 27, 2009 11:36 am

Hi!

If the sidebar does not display, this would mean a fatal PHP error. HAve you looked inside the PHP error log and/or the HTML sourcecode to check for PHP errors?

To me it sounds as if the file cannot be written anymore, maybe due to permissions or a change in the server setup.

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/

User avatar
mo
Regular
 
Posts: 40
Joined: Mon Jan 28, 2008 12:33 am

Postby mo » Mon Apr 27, 2009 12:58 pm

[27-Apr-2009 12:56:33] PHP Fatal error: Uncaught exception 'serendipity_plugin_heavyrotation_albumhandler_chickeneggproblem' with message 'Could not read image from a file. Error was: File /var/www/htdocs/web51/html/blog/templates_c/serendipity_plugin_heavyrotation.txt does not exists' in /var/www/htdocs/web51/html/blog/plugins/serendipity_plugin_heavyrotation/lib/albumhandler.php:208
Stack trace:
#0 /var/www/htdocs/web51/html/blog/plugins/serendipity_plugin_heavyrotation/plugin.inc.php(137): serendipity_plugin_heavyrotation_albumhandler->getInstance()
#1 /var/www/htdocs/web51/html/blog/include/plugin_api.inc.php(847): serendipity_plugin_heavyrotation->generate_content(' ')
#2 /var/www/htdocs/web51/html/blog/include/functions_smarty.inc.php(599): serendipity_plugin_api::generate_plugins('right')
#3 /var/www/htdocs/web51/html/blog/templates_c/carl_modified^%%0F^0FE^0FEECB36%%index.tpl.php(77): serendipity_smarty_printSidebar()
#4 /var/www/htdocs/web51/html/blog/bundled-libs/Smarty/libs/Smarty.class.php(1255): include('/var/www/htdocs...')
#5 /v in /var/www/htdocs/web51/html/blog/plugins/serendipity_plugin_heavyrotation/lib/albumhandler.php on line 208


I've played around with various permissions, but it doesn't help. Other cached content can be written fine. If i create the file with a simple "touch", the error message stays the same. If I edit the file and put *anything* in it, the sidebar displays (no php errors). If I then change the file date to some older date, I get the following error:

[27-Apr-2009 13:07:44] PHP Fatal error: Uncaught exception 'serendipity_plugin_heavyrotation_albumhandler_chickeneggproblem' with message 'Could not read image from a file. Error was: Metadata exists, but image is not fetched. So reread the whole stuff.' in /var/www/htdocs/web51/html/blog/plugins/serendipity_plugin_heavyrotation/lib/albumhandler.php:208
Stack trace:
#0 /var/www/htdocs/web51/html/blog/plugins/serendipity_plugin_heavyrotation/plugin.inc.php(137): serendipity_plugin_heavyrotation_albumhandler->getInstance()
#1 /var/www/htdocs/web51/html/blog/include/plugin_api.inc.php(847): serendipity_plugin_heavyrotation->generate_content(' ')
#2 /var/www/htdocs/web51/html/blog/include/functions_smarty.inc.php(599): serendipity_plugin_api::generate_plugins('right')
#3 /var/www/htdocs/web51/html/blog/templates_c/carl_modified^%%0F^0FE^0FEECB36%%index.tpl.php(77): serendipity_smarty_printSidebar()
#4 /var/www/htdocs/web51/html/blog/bundled-libs/Smarty/libs/Smarty.class.php(1255): include('/var/www/htdocs...')
#5 /var/www/htdocs/web51/html/blog/bu in /var/www/htdocs/web51/html/blog/plugins/serendipity_plugin_heavyrotation/lib/albumhandler.php on line 208

User avatar
garvinhicking
Core Developer
 
Posts: 28948
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Mon Apr 27, 2009 1:09 pm

Hi!

Sadly I don't know much of the plugin. Currently it seems like it cannot recreate the .txt file as long as your "uploads" directory was recently modified; this is where the images for heavrotation are saved, and the code checks this as well.

If you edit the plugin.inc.php file and change:

Code: Select all
               if (file_exists($handler->getPath()) or file_exists($handler->getImagePath())) {


to:

Code: Select all
               if (file_exists($handler->getPath())) {


then the plugin should hopefully properly recreate the .txt file, and also update it accordingly.

HTH,
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/

User avatar
mo
Regular
 
Posts: 40
Joined: Mon Jan 28, 2008 12:33 am

Postby mo » Mon Apr 27, 2009 1:17 pm

Thanks for trying to help, but that doesn't change anything :( It's not that important, I can live without the plugin...

User avatar
garvinhicking
Core Developer
 
Posts: 28948
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Mon Apr 27, 2009 1:20 pm

Hi!

Hm, I'm really sorry for this. On my installation it basically works, so I'm not sure which could be the exact reason here. I could offer to have a look at your installation, if you can/want to provide me with FTP access to the site. Contact me via PM, if you'd like to try that.

Best 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/

User avatar
mo
Regular
 
Posts: 40
Joined: Mon Jan 28, 2008 12:33 am

Postby mo » Fri May 08, 2009 4:45 pm

thanks for trying to help. again, it's not refreshing since you reinstalled it on my blog. :(
also, avatars seem to be broken. because they're also cached, this might be the same cause?

User avatar
mo
Regular
 
Posts: 40
Joined: Mon Jan 28, 2008 12:33 am

Postby mo » Sun Jan 31, 2010 7:07 am

i'd be grateful for help, i still experience the same problem, the cache file doesn't seem to get updated:

Code: Select all
web@server:/html/blog/templates_c$ ls -la serendipity_plugin_heavyrotation.txt
-rw-r--r-- 1 web web 50 2009-08-17 19:39 serendipity_plugin_heavyrotation.txt

drwxrwxrwx  4 web web   4096 2010-01-31 06:07 templates_c
drwxrwxrwx 19 web web   4096 2010-01-31 05:08 uploads

User avatar
garvinhicking
Core Developer
 
Posts: 28948
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Sun Jan 31, 2010 1:18 pm

Hi!

It's hard to say without access to the server.... the permissions look okay if your PHP user is 'web'.

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/

lama
Regular
 
Posts: 13
Joined: Tue Jan 19, 2010 7:35 am

Postby lama » Mon Feb 01, 2010 2:05 pm

when i look at this:
Code: Select all
-rw-r--r-- 1 user user 72 2009-04-15 12:28 serendipity_plugin_heavyrotation.txt


and this:
Code: Select all
drwxrwxrwx  4 web web   4096 2010-01-31 06:07 templates_c
drwxrwxrwx 19 web web   4096 2010-01-31 05:08 uploads


i am getting an idea of the error :mrgreen:

[add]
but if that doesnt help you, tell php to log errors perhaps will help.
in your php.ini change error_reporting:
Code: Select all
# cat /etc/php5/apache2/php.ini | grep error_reporting | grep -v ";"
error_reporting  =  E_ALL & ~E_NOTICE

in your .htaccess insert:
Code: Select all
php_value error_reporting 2047
php_value display_errors 0
php_value log_errors 1
php_value error_log /path/to/php.log


of course /path/to/php.log has to be writeable by your webserver, "user" or "web", whatever it is;-)

User avatar
mo
Regular
 
Posts: 40
Joined: Mon Jan 28, 2008 12:33 am

Postby mo » Mon Feb 01, 2010 2:49 pm

the user names are consistent within the respective posts, both times i have edited my real username. you are right, i should have used the same edited name to avoid confusion. 8)

i don't get any php errors logged until i delete the .txt , then i get
[01-Feb-2010 13:43:59] PHP Fatal error: Uncaught exception 'serendipity_plugin_heavyrotation_albumhandler_chickeneggproblem' with message 'Could not read image from a file. Error was: File /var/www/htdocs/web51/html/blog/templates_c/serendipity_plugin_heavyrotation.txt does not exists' in /var/www/htdocs/web51/html/blog/plugins/serendipity_plugin_heavyrotation/lib/albumhandler.php:208

if i manually edit the heavyrotation.txt and chance it to a different artist/album, i don't get any errors logged, but the picture isn't downloaded/displayed.

Previous


Return to Plugins

Who is online

Users browsing this forum: No registered users and 0 guests