Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cherokee: dev

Issue 1058 in cherokee: cherokee-tweak logrotate not working since v1.0.9

 

 

Cherokee dev RSS feed   Index | Next | Previous | View Threaded


cherokee at googlecode

Nov 28, 2010, 10:01 PM

Post #1 of 10 (464 views)
Permalink
Issue 1058 in cherokee: cherokee-tweak logrotate not working since v1.0.9

Status: New
Owner: ----

New issue 1058 by i...@cmsfruit.com: cherokee-tweak logrotate not working
since v1.0.9
http://code.google.com/p/cherokee/issues/detail?id=1058

What steps will reproduce the problem?
1. Install the latest version of Cherokee Webserver v1.0.10

What is the expected output? What do you see instead?
Cherokee tweak usage has changed and I cannot get the new cherokee tweak to
successfully do a logrotate as of v1.0.9. I follow the new usage man page
but no matter what I keep getting an error when trying to do a logrotate
with cherokee-tweak. I double checked all the settings and everything is
correct. I looked on the documentation section for rotating logs, but it
has the old usage format.

What version of the product are you using? On what operating system?
v1.0.10 on Ubuntu linux.

Please provide any additional information below.
The logrotate command I am trying looks like this:

/usr/bin/cherokee-tweak --user=admin --password=mypasshere
http://127.0.0.1/admin/ logrotate /var/log/cherokee/access.log


The error message I get is:

Enabling Back-up mode..
Traceback (most recent call last):
File "/usr/bin/cherokee-tweak", line 342, in <module>
main()
File "/usr/bin/cherokee-tweak", line 332, in main
do_logrotate()
File "/usr/bin/cherokee-tweak", line 297, in do_logrotate
backup = eval(backup_str)
File "<string>", line 1, in <module>
TypeError: list indices must be integers, not dict


_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


cherokee at googlecode

Nov 29, 2010, 11:46 AM

Post #2 of 10 (448 views)
Permalink
Re: Issue 1058 in cherokee: cherokee-tweak logrotate not working since v1.0.9 [In reply to]

Comment #1 on issue 1058 by alobbs: cherokee-tweak logrotate not working
since v1.0.9
http://code.google.com/p/cherokee/issues/detail?id=1058

I just tested it, but it worked as expected:

=========
$ cherokee-tweak --user=alo --password=123 http://localhost/admin/
logrotate /tmp/hola
Enabling Back-up mode..
Moving /tmp/hola to /tmp/hola.1
Disabling Back-up mode..
=========

_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


cherokee at googlecode

Nov 29, 2010, 1:11 PM

Post #3 of 10 (446 views)
Permalink
Re: Issue 1058 in cherokee: cherokee-tweak logrotate not working since v1.0.9 [In reply to]

Comment #2 on issue 1058 by i...@cmsfruit.com: cherokee-tweak logrotate not
working since v1.0.9
http://code.google.com/p/cherokee/issues/detail?id=1058

Yes, it also works for me on my Ubuntu 10.04.1 LTS system at home which
only has about 10 vhosts.... but when I try that same exact command on our
other server which has over 50 vhosts, it fails with that error:

Enabling Back-up mode..
Traceback (most recent call last):
File "/usr/bin/cherokee-tweak", line 342, in <module>
main()
File "/usr/bin/cherokee-tweak", line 332, in main
do_logrotate()
File "/usr/bin/cherokee-tweak", line 297, in do_logrotate
backup = eval(backup_str)
File "<string>", line 1, in <module>
TypeError: list indices must be integers, not dict



It used to work for me on all our servers as of v1.0.8, but then when I
upgraded to v1.0.9 or v1.0.10 that is when it stopped working and started
producing that error on that particular system... that is also when I
noticed the cherokee-tweak usage format had changed.... I have tried
everything, I have tried double checking the config files... I have tried
comparing the 2 systems to see why one is not working... I have tried
removing the admin site and then re-creating it via cherokee-admin... but
no matter what I do, that other system will not logrotate and produces that
error. It used to work just fine on this system on v1.0.8, but after I
upgraded it broke... I have even tried completely uninstalling cherokee and
then installing a fresh install through aptitude ppa, but still the same
error.

The weird part is that the problem is intermittent... it works one second
on one machine, but if I try it again on that same machine or another
machine it may fail with the above error or it might work.... so basically
it works sometimes and doesn't work other times... I can't seem to figure
out why, but on this particular system that I am having problems with, it
doesn't work at all. It only produces the above error.

Is there anything we can do to see why cherokee-tweak is producing that
error and why it won't do a successful logrotate on that system?

Any help would be appreciated. Cherokee is truly an amazing webserver!

Thank you!

_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


cherokee at googlecode

Nov 30, 2010, 12:16 PM

Post #4 of 10 (438 views)
Permalink
Re: Issue 1058 in cherokee: cherokee-tweak logrotate not working since v1.0.9 [In reply to]

Comment #3 on issue 1058 by alobbs: cherokee-tweak logrotate not working
since v1.0.9
http://code.google.com/p/cherokee/issues/detail?id=1058

Just committed http://svn.cherokee-project.com/changeset/5849 in order to
try to figure out the problem.
Since it does not fail at my end, I will have to wait for your input.
Hopefully the patch helps to shed some light.

_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


cherokee at googlecode

Nov 30, 2010, 1:59 PM

Post #5 of 10 (444 views)
Permalink
Re: Issue 1058 in cherokee: cherokee-tweak logrotate not working since v1.0.9 [In reply to]

Comment #4 on issue 1058 by i...@cmsfruit.com: cherokee-tweak logrotate not
working since v1.0.9
http://code.google.com/p/cherokee/issues/detail?id=1058

Hi Alvaro!

I copied the cherokee.conf file from our server that is having issues with
cherokee-tweak and logrotate to my local dev system where I attempted to
re-produce the issue with cherokee-tweak... and sure enough, after copying
the conf file that has over 50 vhosts, the issue started occurring on my
dev system as well.... but keep in mind it didn't occur with v1.0.10 and my
conf file that had only 10 vhosts in it...

So then I proceeded to download the new cherokee from svn revision 5850
which was the latest at the time... I compiled it on my local dev system
which was now producing the same error as the other server since I copied
the conf files over... I compiled it with the following:

./configure --localstatedir=/var \
--prefix=/usr \
--sysconfdir=/etc \
--with-wwwroot=/var/www

and after installing the latest from svn revision 5850... I can no longer
start the cherokee webserver process at all. I tried to start it from the
command prompt with:

/etc/init.d/cherokee start

and it starts a process for about a second and then dies off with no
errors. Then I try to start the server from within cherokee-admin and it
comes back with the following error "504 Gateway Timeout" when I click
the "Start Server" button.

So basically after installing the latest version from svn my cherokee no
longer starts at all.

Any thoughts?

Best Regards,
John

_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


cherokee at googlecode

Dec 1, 2010, 2:22 AM

Post #6 of 10 (427 views)
Permalink
Re: Issue 1058 in cherokee: cherokee-tweak logrotate not working since v1.0.9 [In reply to]

Comment #5 on issue 1058 by i...@cmsfruit.com: cherokee-tweak logrotate not
working since v1.0.9
http://code.google.com/p/cherokee/issues/detail?id=1058

So I looked over your changes in revision 5849, and went ahead and manually
applied those same changes to my cherokee-tweak file that is having issues
with logrotate, and here is the output of the error now:

Enabling Back-up mode..
Failed to evaluate: ========
[][{"backup_mode":True}]
============================
Traceback (most recent call last):
File "/usr/bin/cherokee-tweak", line 353, in <module>
main()
File "/usr/bin/cherokee-tweak", line 343, in main
do_logrotate()
File "/usr/bin/cherokee-tweak", line 308, in do_logrotate
backup = eval_safe(backup_str)
File "/usr/bin/cherokee-tweak", line 162, in eval_safe
return eval(txt)
File "<string>", line 1, in <module>
TypeError: list indices must be integers, not dict




_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


cherokee at googlecode

Dec 8, 2010, 9:43 PM

Post #7 of 10 (393 views)
Permalink
Re: Issue 1058 in cherokee: cherokee-tweak logrotate not working since v1.0.9 [In reply to]

Comment #6 on issue 1058 by i...@cmsfruit.com: cherokee-tweak logrotate not
working since v1.0.9
http://code.google.com/p/cherokee/issues/detail?id=1058

I supplied you with the debug information you asked for. Any fix?

_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


cherokee at googlecode

Dec 8, 2010, 9:47 PM

Post #8 of 10 (388 views)
Permalink
Re: Issue 1058 in cherokee: cherokee-tweak logrotate not working since v1.0.9 [In reply to]

Comment #7 on issue 1058 by i...@cmsfruit.com: cherokee-tweak logrotate not
working since v1.0.9
http://code.google.com/p/cherokee/issues/detail?id=1058

I supplied you with the debug information you asked for. Any fix?

By the way I attempted to solve the python error above by manually deleting
the empty list from the result and although that fixed the python error,
the log doesn't actually rotate... it freezes at "Disabling Backup Mode"
and never completes the logrotate.

_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


cherokee at googlecode

Sep 8, 2011, 5:44 PM

Post #9 of 10 (129 views)
Permalink
Re: Issue 1058 in cherokee: cherokee-tweak logrotate not working since v1.0.9 [In reply to]

Comment #8 on issue 1058 by rudygod...@gmail.com: cherokee-tweak logrotate
not working since v1.0.9
http://code.google.com/p/cherokee/issues/detail?id=1058

Hi, I have the same issue reported on this ticket. I've managed to get down
to the problem but I'd need some input here from a Python-wise person.

The problem is on the eval_safe() function which calls eval().

backup_str = request (['set server.backup_mode on'])

backup_str returns a string in the form of: [][{"backup_mode":True}]
Now, the call to eval() passes such string as parameter. As far I can tell
eval() treats it's parameters as python expressions. Given the backup_str
doesn't have the form of a string, or a expression, it fails.

So, here is the question: do we need to change the way of evaluating such
returned string or do we look at the server side returning such value?

Regards,
Rudy

_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


cherokee at googlecode

Sep 9, 2011, 5:02 AM

Post #10 of 10 (129 views)
Permalink
Re: Issue 1058 in cherokee: cherokee-tweak logrotate not working since v1.0.9 [In reply to]

Comment #9 on issue 1058 by alobbs: cherokee-tweak logrotate not working
since v1.0.9
http://code.google.com/p/cherokee/issues/detail?id=1058

Rudy,

I'm almost sure that eval_safe() is not the source of the problem -
actually, we do need to use a safe eval() function, otherwise arbitrary
code could be injected from a malicious (fake) admin interface.

The prepending [] is most likely there either because it was not discarded
on a previous request (an cherokee-tweak operation can require to make a
number of HTTP requests), or because of a bug in the code that parses the
output of the administration service.

_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev

Cherokee dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.