Dear all,

I'd like to inform you that in a particular authorization scenario the
error "Render server error" is thrown. Following example shows the
intricate issue that needs resolution.

*** Scenario Example: Create PDF for pages only accessible for loged-
in user **************************************

Logged-in users should be able to produce PDF or ODT files using
PediaPress's public rendering service for the page "Bibliography".
Anonymous access is govnerned via a white list.

## Authorized pages for anonymous user '*' ##############
$wgWhitelistRead = array(
                         "Main Page",
                         "Special:Userlogin",
                         "Special:UserLogout",
                         "Special:Book",
                         );

To effectively secure internal information all users must log on;
therefore the anonymous user group " * " has been deprived of read and
edit rights.

### User Groups ##################################
## * ############################################
$wgGroupPermissions['*']['createaccount'] = true; //Create new user
accounts
$wgGroupPermissions['*']['edit'] = false; //Edit pages
$wgGroupPermissions['*']['read'] = false; //Read pages

Since we know that the public rendering service needs unhindered
access to the site requesting the service or the rendering service
needs logon credentials for internal pages, we provide corresponding
values for php variable  $wgCollectionMWServeCredentials

### Collection
#################################################################
require_once("$IP/extensions/Collection/Collection.php");
$wgCollectionMWServeURL = "http://tools.pediapress.com/mw-serve/";;
# $wgCollectionMWServeCredentials = "testuser:init4711" ;
$wgCollectionFormats = array(
            'rl' => 'PDF',
            'odf' => 'ODT'

Despite all of our efforts, we receive following ugly error message:


" An error occured on the render server: traceback Traceback (most
recent call last): File "/home/tools/py25/lib/python2.5/site-packages/
mwlib-0.12.13-py2.5-linux-x86_64.egg/mwlib/apps/render.py", line 169,
in __call__ env = self.get_environment() File "/home/tools/py25/lib/
python2.5/site-packages/mwlib-0.12.13-py2.5-linux-x86_64.egg/mwlib/
apps/render.py", line 101, in get_environment self.zip_filename =
make_zip(output=self.options.keep_zip, options=self.options,
metabook=env.metabook, status=self.status) File "/home/tools/py25/lib/
python2.5/site-packages/mwlib-0.12.13-py2.5-linux-x86_64.egg/mwlib/
apps/buildzip.py", line 58, in make_zip make_nuwiki(fsdir,
metabook=metabook, options=options, podclient=podclient,
status=status) File "/home/tools/py25/lib/python2.5/site-packages/
mwlib-0.12.13-py2.5-linux-x86_64.egg/mwlib/apps/make_nuwiki.py", line
173, in make_nuwiki raise RuntimeError(str(val)) RuntimeError:
[Failure instance: Traceback: <type 'exceptions.RuntimeError'>: login
failed: {'login': {'cookieprefix': 'db97663x1249546_mw_', 'token':
'14b17ce7cb9283f4443bae63428ca645', 'sessionid':
'1a2ea575a7b80573a660f1c3587ad431', 'result': 'NeedToken'}} /home/
tools/py25/lib/python2.5/site-packages/Twisted-8.2.0-py2.5-linux-
x86_64.egg/twisted/web/client.py:152:handleResponse /home/tools/py25/
lib/python2.5/site-packages/Twisted-8.2.0-py2.5-linux-x86_64.egg/
twisted/web/client.py:304:page /home/tools/py25/lib/python2.5/site-
packages/Twisted-8.2.0-py2.5-linux-x86_64.egg/twisted/internet/
defer.py:243:callback /home/tools/py25/lib/python2.5/site-packages/
Twisted-8.2.0-py2.5-linux-x86_64.egg/twisted/internet/defer.py:
312:_startRunCallbacks --- <exception caught here> --- /home/tools/
py25/lib/python2.5/site-packages/Twisted-8.2.0-py2.5-linux-x86_64.egg/
twisted/internet/defer.py:328:_runCallbacks /home/tools/py25/lib/
python2.5/site-packages/mwlib-0.12.13-py2.5-linux-x86_64.egg/mwlib/net/
mwapi.py:198:got_page ] sys.argv=['/home/tools/py25/bin/mw-render', '--
logfile', '/home/tools/cache/mw-serve/ac/ac7f1ba78afd85c6/mw-
render.log.rl', '--error-file', '/home/tools/cache/mw-serve/ac/
ac7f1ba78afd85c6/errors.rl', '--status-file', '/home/tools/cache/mw-
serve/ac/ac7f1ba78afd85c6/status.rl', '--writer', 'rl', '--output', '/
home/tools/cache/mw-serve/ac/ac7f1ba78afd85c6/output.rl', '--pid-
file', '/home/tools/cache/mw-serve/ac/ac7f1ba78afd85c6/pid.rl', '--
metabook', '/home/tools/cache/mw-serve/ac/ac7f1ba78afd85c6/
metabook.json', '--keep-zip', '/home/tools/cache/mw-serve/ac/
ac7f1ba78afd85c6/collection.zip', '--config', 'https://
ssl-97663.1blu.de/mw', '--template-blacklist', 'MediaWiki:PDF Template
Blacklist', '--template-exclusion-category', 'Exclude in print', '--
print-template-prefix', 'Print', '--print-template-pattern', '$1/
Print', '--username', 'testuser', '--password', 'init4711', '--script-
extension', '.php', '--language', 'en'] "

Obviously, the user credentials provided php variable
$wgCollectionMWServeCredentials have been transmitted -> see last line
of error message, however the rendering service failed to produce a
PDF.

Changing the scenario the service works: if for user group " * "
variable is changed to true

  -->  $wgGroupPermissions['*']['read'] = true; //Read pages

then the rendering service produces correct results. I infer from
these tests, that the service works only if user group " * " has basic
"read" rights.

Am I mistaken?

Thanks and very kind regards,
Arthur

-- 
You received this message because you are subscribed to the Google Groups 
"mwlib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/mwlib?hl=en.

Reply via email to