Description

It is possible that synctags files become corrupted in a wiki instance. I my case remote_rev, current_rev had valies more than last revision in wiki (last local revision = 9, last remote revision = 6, revision in remote_tag = 10).

It SyncPages action mets such tag it raises XMLRPC.Fault FROMREV_INVALID: 'Invalid from_rev.' Sync process stops, so effectively I can't use WikiSync.

Steps to reproduce

Synctags with non-existent revisions could appear in the following circumstances:

Example

instead of the step that the wiki instance was recovered from the backup I just renamed the page and created a new one with the old name.

This gives the following traceback

2012-02-05 12:17:14,484 INFO MoinMoin.web.serving:41 127.0.0.1 "POST /SyncJob?action=SyncPages HTTP/1.1" 500 -
2012-02-05 12:17:14,489 ERROR werkzeug:116 Error on request:
Traceback (most recent call last):
  File "/home/moin/workspace/moin-1.9/MoinMoin/support/werkzeug/serving.py", line 159, in run_wsgi
    execute(app)
  File "/home/moin/workspace/moin-1.9/MoinMoin/support/werkzeug/serving.py", line 146, in execute
    application_iter = app(environ, start_response)
  File "/home/moin/workspace/moin-1.9/MoinMoin/support/werkzeug/wsgi.py", line 411, in __call__
    return self.app(environ, start_response)
  File "/home/moin/workspace/moin-1.9/MoinMoin/wsgiapp.py", line 282, in __call__
    response = run(context)
  File "/home/moin/workspace/moin-1.9/MoinMoin/wsgiapp.py", line 88, in run
    response = dispatch(request, context, action_name)
  File "/home/moin/workspace/moin-1.9/MoinMoin/wsgiapp.py", line 136, in dispatch
    response = handle_action(context, pagename, action_name)
  File "/home/moin/workspace/moin-1.9/MoinMoin/wsgiapp.py", line 195, in handle_action
    handler(context.page.page_name, context)
  File "/home/moin/workspace/moin-1.9/MoinMoin/action/SyncPages.py", line 511, in execute
    ActionClass(pagename, request).render()
  File "/home/moin/workspace/moin-1.9/MoinMoin/action/SyncPages.py", line 220, in render
    self.sync(params, local, remote)
  File "/home/moin/workspace/moin-1.9/MoinMoin/action/SyncPages.py", line 507, in sync
    rpc_aggregator.scheduler(remote.create_multicall_object, handle_page, m_pages, 8, remote.prepare_multicall)
  File "/home/moin/workspace/moin-1.9/MoinMoin/util/rpc_aggregator.py", line 73, in scheduler
    call = gen.fetch_call()
  File "/home/moin/workspace/moin-1.9/MoinMoin/util/rpc_aggregator.py", line 32, in fetch_call
    next_item = self._gen.next()
  File "/home/moin/workspace/moin-1.9/MoinMoin/action/SyncPages.py", line 385, in run
    diff_result = remote.get_diff_post(yielder.fetch_result())
  File "/home/moin/workspace/moin-1.9/MoinMoin/wikisync.py", line 221, in get_diff_post
    raise value
Fault: <Fault FROMREV_INVALID: 'Unknown from_rev.'>

Component selection

Details

MoinMoin Version

1.9.3

OS and Version

Ubuntu 10.10

Python Version

2.6.6

Server Setup

Standalone

Server Details

Language you are using the wiki in (set in the browser/UserPreferences)

ru_RU

Workaround

Either remove synctags:

find wiki/data -type f -name synctags -print0 | xargs -0 rm

Or apply the following patch (wiki would ignore tags with invalid revisions):

diff -r 7df66a89c6af MoinMoin/action/SyncPages.py
--- a/MoinMoin/action/SyncPages.py      Tue Nov 02 16:03:02 2010 +0500
+++ b/MoinMoin/action/SyncPages.py      Tue Nov 02 16:29:55 2010 +0500
@@ -315,6 +315,15 @@
 
                 matching_tags = tags.fetch(iwid_full=remote.iwid_full, direction=match_direction)
                 matching_tags.sort()
+                
+                # Tags could become corrupted. Maybe they were created by 
+                # an old buggy version or it is an administrator error.
+                # Don't know how, but it happens. In my case there were tags
+                # with revisions higher then the last one. Filter such tags out.
+                matching_tags = [t for t in matching_tags 
+                                    if (t.current_rev <= sp.local_rev
+                                    and t.remote_rev  <= sp.remote_rev)]
+                                    
                 if debug:
                     self.log_status(ActionClass.INFO, raw_suffix="Tags: %r <<BR>> All: %r" % (matching_tags, tags.tags))

Discussion

I had the same problem on an ARM computer (Seagate, Freeagent, Dockstar) with Debian kernel 2.6.35.4, moin 1.9.3, python 2.6.
The other side works with Ubuntu 0904, moin 1.8.8 and python 2.6.
My solution was to fall back to moin 1.9.2
-- RudolfReuter 2010-12-17 18:33:08

hmm, may be then some of the SecurityFixes causes it. Are you sure that you have the same situation?

Rudolf, are you saying it does not happen on 1.9.2?

Thank you for taking care about that issue. I am not to deep into the details, just struggled for two days with the "FROMREV_INVALID" error on one page. Even deleting the page (in a second step also in the "pages" folder with FileZilla) on one side did not help. So, finally I gave up and installed moin version 1.9.2 and deleted the sync tag. Then it works. Two other sync problems still bother me:

  1. Even if the sync direction was set to down only, changes got uploaded.
  2. The SyncJob page always has after syncing some edit conflicts in addition to the log. My work around is now to fall back to the last revision. I did not had that with version 1.8. If I could help debugging it, please let me know.

-- RudolfReuter 2010-12-18 08:17:22

My solution to the problem is now to rsync the folder wiki/data from the server to a local installation of moin.
Then I run a little script (start_wiki9.command, MAC OS X) to check the local moin installation:

# After a "rsync" backup from the server, the local cache
# must be cleared in order to operate the local server.
# First figure out the path.
# 2011-08-03 RudolfReuter

echo Clear cache of wiki
BASEDIR=$(dirname $0)
cd $BASEDIR

./moin maint cleancache
echo "Now start wiki server on http://localhost:8080"
echo "Finish with strg + C"
./wikiserver.py

echo "The log file is in 'moin_rot.log'"

-- RudolfReuter 2012-02-05 12:13:33

There are many reasons why tags can out of sync.

It is important to notify the user who does the sync job that something like this happend if the above patch is applied. At the time we work on moin2 on the synchronisation part we have to use in the tags the uuid information of the items. Also it may make sense to log the operations what one had done with an item.

I guess RudolfReuter describes a different issue. For me a sync to 1.9.2 from a 1.9.4 wiki gives this traceback.

2012-02-05 12:51:45,921 INFO MoinMoin.web.serving:41 127.0.0.1 "POST /SyncJob?action=SyncPages HTTP/1.1" 500 -
2012-02-05 12:51:45,929 ERROR werkzeug:106 Error on request:
Traceback (most recent call last):
  File "/home/moin/tmp/moin-1.9.2/MoinMoin/support/werkzeug/serving.py", line 151, in run_wsgi
    execute(app)
  File "/home/moin/tmp/moin-1.9.2/MoinMoin/support/werkzeug/serving.py", line 138, in execute
    application_iter = app(environ, start_response)
  File "/home/moin/tmp/moin-1.9.2/MoinMoin/support/werkzeug/utils.py", line 248, in __call__
    return self.app(environ, start_response)
  File "/home/moin/tmp/moin-1.9.2/MoinMoin/wsgiapp.py", line 282, in __call__
    response = run(context)
  File "/home/moin/tmp/moin-1.9.2/MoinMoin/wsgiapp.py", line 88, in run
    response = dispatch(request, context, action_name)
  File "/home/moin/tmp/moin-1.9.2/MoinMoin/wsgiapp.py", line 136, in dispatch
    response = handle_action(context, pagename, action_name)
  File "/home/moin/tmp/moin-1.9.2/MoinMoin/wsgiapp.py", line 195, in handle_action
    handler(context.page.page_name, context)
  File "/home/moin/tmp/moin-1.9.2/MoinMoin/action/SyncPages.py", line 511, in execute
    ActionClass(pagename, request).render()
  File "/home/moin/tmp/moin-1.9.2/MoinMoin/action/SyncPages.py", line 209, in render
    remote = MoinRemoteWiki(self.request, params["remoteWiki"], params["remotePrefix"], params["pageList"], name, password, verbose=debug)
  File "/home/moin/tmp/moin-1.9.2/MoinMoin/wikisync.py", line 176, in __init__
    self.connection = self.createConnection()
  File "/home/moin/tmp/moin-1.9.2/MoinMoin/wikisync.py", line 208, in createConnection
    return xmlrpclib.ServerProxy(self.xmlrpc_url, allow_none=True, verbose=self.verbose)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1463, in __init__
    raise IOError, "unsupported XML-RPC protocol"
IOError: unsupported XML-RPC protocol

ReimarBauer/Photo/img.png -- ReimarBauer 2012-02-05 11:57:22

Plan


CategoryMoinMoinBug

MoinMoin: MoinMoinBugs/1.9WikiSyncCorruptedSynctags (last edited 2012-02-05 13:18:17 by RudolfReuter)