Description
Cannot Preview an Edit, cannot Cancel an Edit, cannot Save an Edit.
Steps to reproduce
- Edit any page, then try to Cancel, Save, or Preview.
Example
First Scenario
Originally no example was given here, but we found this problem could be reproduced when a "current-locked" file file is left hanging around in the per-user backup directory, not in the original page directory. For example: I had left around a "current-locked" file in MyUserName(2f)MoinEditorBackup/current-locked and this produced exactly the same symptoms as described above - for any page I tried to edit. The moral is: make sure you fix "current-locked" in both places. Still not a bug, though
Second Scenario
The bug seems to be attached to the user information. Any user can edit pages with no problem but the admin user which was the user that we were using to create all the structure and the initial information of the wiki. Even if there is no user logged in, it works.
We have also checked out that there is no "current-locked" file left in the directory tree to make sure that it is a different issue.
Details
First scenario details
--> -->
CouldNotLockPage could not get locked. Missing 'current' file? Please include this information in your bug reports!: Python Python 2.4: /usr/local/python/bin/python SunOS sourced01 5.9 Generic_117171-12 sun4u MoinMoin Release 1.3.4 [Revision 1.3.4 release] Wed Jun 7 15:17:46 2006 A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred. /usr/local/python/lib/python2.4/site-packages/MoinMoin/request.py in run(self=<MoinMoin.request.RequestCGI instance>) 843 from MoinMoin.wikiaction import getHandler 844 handler = getHandler(self, action) 845 handler(self.page.page_name, self) 846 847 # 5. Or redirect to another page handler = <function do_savepage>, self = <MoinMoin.request.RequestCGI instance>, self.page = <MoinMoin.Page.Page instance>, self.page.page_name = u'TomHalliley' /usr/local/python/lib/python2.4/site-packages/MoinMoin/wikiaction.py in do_savepage(pagename=u'TomHalliley', request=<MoinMoin.request.RequestCGI instance>) 599 # Edit was canceled 600 elif request.form.has_key('button_cancel'): 601 pg.sendCancel(savetext, rev) 602 603 # Save new text pg = <MoinMoin.PageEditor.PageEditor instance>, pg.sendCancel = <bound method PageEditor.sendCancel of <MoinMoin.PageEditor.PageEditor instance>>, savetext = u'== Info ==\n\n||||||\n||Member of: || ArchitectureI... Secondary Contact: 1003 (m4lite) issues\n\n-----\n', rev = 70 /usr/local/python/lib/python2.4/site-packages/MoinMoin/PageEditor.py in sendCancel(self=<MoinMoin.PageEditor.PageEditor instance>, newtext=u'== Info ==\n\n||||||\n||Member of: || ArchitectureI... Secondary Contact: 1003 (m4lite) issues\n\n-----\n', rev=70) 459 """ 460 _ = self._ 461 self._make_backup(newtext) 462 self.lock.release() 463 self = <MoinMoin.PageEditor.PageEditor instance>, self._make_backup = <bound method PageEditor._make_backup of <MoinMoin.PageEditor.PageEditor instance>>, newtext = u'== Info ==\n\n||||||\n||Member of: || ArchitectureI... Secondary Contact: 1003 (m4lite) issues\n\n-----\n' /usr/local/python/lib/python2.4/site-packages/MoinMoin/PageEditor.py in _make_backup(self=<MoinMoin.PageEditor.PageEditor instance>, newtext=u'== Info ==\n\n||||||\n||Member of: || ArchitectureI... Secondary Contact: 1003 (m4lite) issues\n\n-----\n', **kw={}) 713 intro += _('## backup of page "%(pagename)s" submitted %(date)s') % { 714 'pagename': pagename, 'date': date,} + u'\n' 715 backuppage._write_file(intro + newtext) 716 717 return backuppage.url(self.request) backuppage = <MoinMoin.PageEditor.PageEditor instance>, backuppage._write_file = <bound method PageEditor._write_file of <MoinMoin.PageEditor.PageEditor instance>>, intro = u'\n', newtext = u'== Info ==\n\n||||||\n||Member of: || ArchitectureI... Secondary Contact: 1003 (m4lite) issues\n\n-----\n' /usr/local/python/lib/python2.4/site-packages/MoinMoin/PageEditor.py in _write_file(self=<MoinMoin.PageEditor.PageEditor instance>, text=u'\n== Info ==\n\n||||||\n||Member of: || Architecture... Secondary Contact: 1003 (m4lite) issues\n\n-----\n', action='SAVE', comment=u'', extra=u'') 808 809 if not got_lock: 810 raise self.CouldNotLock, _("Page could not get locked. Missing 'current' file?") 811 812 # increment rev number of current(-locked) page self = <MoinMoin.PageEditor.PageEditor instance>, self.CouldNotLock = <class MoinMoin.PageEditor.CouldNotLock>, _ = <function <lambda>> CouldNotLock: Page could not get locked. Missing 'current' file? __doc__ = None __getitem__ = <bound method CouldNotLock.__getitem__ of <MoinMoin.PageEditor.CouldNotLock instance>> __init__ = <bound method CouldNotLock.__init__ of <MoinMoin.PageEditor.CouldNotLock instance>> __module__ = 'MoinMoin.PageEditor' __str__ = <bound method CouldNotLock.__str__ of <MoinMoin.PageEditor.CouldNotLock instance>> __unicode__ = <bound method CouldNotLock.__unicode__ of <MoinMoin.PageEditor.CouldNotLock instance>> message = u"Page could not get locked. Missing 'current' file?"
Note: The user under which apache is running has changed. Previously, when MoinMoin was working fine, the apache user was the same as the wiki files user. Now, we're using different users for running apache vs. owning the wiki files, however, both are members of the same group, and all wiki files are owned by that group.;
Here's an example file from the wiki ... note the owner/group is wikiadm/wikiadm:
992736 1 -rwxrwx--- 1 wikiadm wikiadm 20 Aug 29 2005 /usr/local/moin/share/moin/fwiki/data/pages/TomHalliley/revisions/00000001
apache runs as toolsadm
toolsadm 17036 2311 0 14:56:03 ? 0:00 /usr/local/apache2/bin/httpd -k start
but both wikiadm and toolsadm are in the wikiadm group:
bash-2.05$ groups wikiadm wikiadm toolsadm bash-2.05$ groups toolsadm toolsadm appdev wikiadm
I think this should work, right?
What is interesting is that the failure only occurs when you're logged into the wiki. A guest user is able to Save, Edit, Preview, and Cancel just fine.
Second Scenario Details
#Second_scenario_CouldNotLock.htm
It is also interesting to notice that once the failing user starts editing the page, either preview, cancel or save works. They all give the same error.
I have also notice that if the failing user tries to edit a page with no restrictions, no acl directive include in the page, it also fails.
Workaround
First Scenario
No workaround.
Second Scenario
Seems to be a problem of an edit action that did not finish properly.
Go to the data directory of the wiki and look for a folder named <username>(2f)MoinEditorBackup.
- Delete that folder. It will work again.
Discussion
I don't think the groups are part of your problem. But maybe some page data structure on disk got slightly damaged. Check if the involved pages have a "current" file (page you edited and UserName/MoinEditorBackup also). If you find a file "current-locked" although nobody is editing it, rename it to "current".
If you have time, maybe upgrade to 1.5.3+.
- Yes, 1.3.5 or 1.5.0 should fix this bug.
Please reopen this bug if it was not fixed by renaming the file like explained above.
--from Tom:
I changed each "current-locked" file to "current", but then editing the corresponding page then hitting Cancel, Preview, or Save resulted in the same error.
Then give us the output of:
ls -al /usr/local/moin/share/moin/fwiki/data/pages/TomHalliley/ ls -al /usr/local/moin/share/moin/fwiki/data/
-- from Tom:
bash-2.05$ ls -al /usr/local/moin/share/moin/fwiki/data/pages/TomHalliley/ total 82 drwxrwx--- 4 wikiadm wikiadm 512 Jun 8 10:06 . drwxrwx--- 778 wikiadm wikiadm 27648 Jun 8 13:04 .. drwxrwx--- 2 wikiadm wikiadm 512 Aug 29 2005 cache -rwxrwx--- 1 wikiadm wikiadm 9 Jun 5 08:31 current -rw-rw---- 1 toolsadm toolsadm 117 Jun 8 10:06 edit-lock -rwxrwx--- 1 wikiadm wikiadm 7750 Jun 5 08:31 edit-log drwxrwx--- 2 wikiadm wikiadm 1536 Jun 5 08:31 revisions bash-2.05$ ls -al /usr/local/moin/share/moin/fwiki/data/ total 56212 drwxrwx--- 6 wikiadm wikiadm 512 Dec 23 13:32 . drwxrwxr-x 5 wikiadm wikiadm 512 Jun 5 08:28 .. drwxrwx--- 6 wikiadm wikiadm 512 Jul 19 2005 cache -rwxrwx--- 1 wikiadm wikiadm 869418 Jun 8 13:09 edit-log -rwxrwx--- 1 wikiadm wikiadm 3919944 Jun 8 13:13 error.log -rwxrwx--- 1 wikiadm wikiadm 11053126 Jun 8 13:18 event-log -rwxrwx--- 1 wikiadm wikiadm 12844776 Dec 23 13:32 event-log001.bak -rwxrwx--- 1 wikiadm wikiadm 5188 Jul 18 2005 intermap.txt drwxrwx--- 778 wikiadm wikiadm 27648 Jun 8 13:04 pages drwxrwx--- 9 wikiadm wikiadm 512 Jul 18 2005 plugin drwxrwx--- 2 wikiadm wikiadm 4608 Jun 7 11:11 user
Your wiki is running as toolsadm. Please fix that.
Plan
- Priority:
- Assigned to:
- Status: