Topic on Extension talk:Collection

Render server error - Collection - mwlib

2
Pharao~mediawikiwiki (talkcontribs)

I don't found a solution to my Render server error:
This is my error in the MediaWiki Collection windows:

An error occurred on the render server: RuntimeError: RuntimeError: command failed with returncode 256: ['mw-zip', '-o', '/data1/mwcache/81/81d87747ac2c5510/collection.zip', '-m', '/data1/mwcache/81/81d87747ac2c5510/metabook.json', '--status', 'qserve://localhost:14311/81d87747ac2c5510:makezip', '--config', 'http://wiki.server.local/wiki', '--template-blacklist', 'MediaWiki:PDF Template Blacklist', '--template-exclusion-category', 'Exclude in print', '--print-template-prefix', 'Print', '--print-template-pattern', '$1/Print', '--username', 'user1', '--password', '{OMITTED}'] Last Output: 3-03-06T16:33:59 mwlib.options.warn >> Both --print-template-pattern and --print-template-prefix (deprecated) specified. Using --print-template-pattern only. 1% /usr/lib/python2.6/site-packages/mwlib-0.14.3-py2.6-linux-x86_64.egg/mwlib/metabook.py:225: DeprecationWarning: deprecated call get('mw_license_url') if l.get('mw_license_url'): /usr/lib/python2.6/site-packages/mwlib-0.14.3-py2.6-linux-x86_64.egg/mwlib/metabook.py:240: DeprecationWarning: deprecated call get('mw_rights_text') if l.get('mw_rights_text'): /usr/lib/python2.6/site-packages/mwlib-0.14.3-py2.6-linux-x86_64.egg/mwlib/metabook.py:242: DeprecationWarning: deprecated call get('mw_rights_page') if l.get('mw_rights_page'): /usr/lib/python2.6/site-packages/mwlib-0.14.3-py2.6-linux-x86_64.egg/mwlib/metabook.py:244: DeprecationWarning: deprecated call get('mw_rights_url') if l.get('mw_rights_url'): Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/gevent-0.13.8-py2.6-linux-x86_64.egg/gevent/greenlet.py", line 390, in run result = self._run(*self.args, **self.kwargs) File "/usr/lib/python2.6/site-packages/mwlib-0.14.3-py2.6-linux-x86_64.egg/mwlib/apps/make_nuwiki.py", line 118, in run api = self.get_api() File "/usr/lib/python2.6/site-packages/mwlib-0.14.3-py2.6-linux-x86_64.egg/mwlib/apps/make_nuwiki.py", line 28, in get_api api.login(self.username, self.password, self.domain) File "/usr/lib/python2.6/site-packages/mwlib-0.14.3-py2.6-linux-x86_64.egg/mwlib/net/sapi.py", line 183, in login res = self._post(**args) File "/usr/lib/python2.6/site-packages/mwlib-0.14.3-py2.6-linux-x86_64.egg/mwlib/net/sapi.py", line 106, in _post res = loads(self._fetch(req)) File "/usr/lib/python2.6/site-packages/mwlib-0.14.3-py2.6-linux-x86_64.egg/mwlib/net/sapi.py", line 72, in _fetch f = self.opener.open(url) File "/usr/lib64/python2.6/urllib2.py", line 391, in open response = self._open(req, data) File "/usr/lib64/python2.6/urllib2.py", line 409, in _open '_open', req) File "/usr/lib64/python2.6/urllib2.py", line 369, in _call_chain result = func(*args) File "/usr/lib64/python2.6/urllib2.py", line 1190, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib64/python2.6/urllib2.py", line 1165, in do_open raise URLError(err) URLError: <urlopen error [Errno 3] name does not exist> <Greenlet at 0x1942550: <bound method start_fetcher.run of <mwlib.apps.make_nuwiki.start_fetcher object at 0x1960910>>> failed with URLError creating nuwiki in u'/data1/mwcache/81/81d87747ac2c5510/tmpwhPxWD/nuwiki' removing tmpdir u'/data1/mwcache/81/81d87747ac2c5510/tmpwhPxWD' memory used: res=17.1 virt=237.0 1% error Traceback (most recent call last): File "/usr/bin/mw-zip", line 5, in <module> pkg_resources.run_script('mwlib==0.14.3', 'mw-zip') File "/usr/lib/python2.6/site-packages/distribute-0.6.35-py2.6.egg/pkg_resources.py", line 505, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python2.6/site-packages/distribute-0.6.35-py2.6.egg/pkg_resources.py", line 1245, in run_script execfile(script_filename, namespace, namespace) File "/usr/lib/python2.6/site-packages/mwlib-0.14.3-py2.6-linux-x86_64.egg/EGG-INFO/scripts/mw-zip", line 6, in <module> main() File "/usr/lib/python2.6/site-packages/mwlib-0.14.3-py2.6-linux-x86_64.egg/mwlib/apps/buildzip.py", line 155, in main make_zip(output, options, env.metabook, podclient=podclient, status=status) File "/usr/lib/python2.6/site-packages/mwlib-0.14.3-py2.6-linux-x86_64.egg/mwlib/apps/buildzip.py", line 50, in make_zip make_nuwiki(fsdir, metabook=metabook, options=options, podclient=podclient, status=status) File "/usr/lib/python2.6/site-packages/mwlib-0.14.3-py2.6-linux-x86_64.egg/mwlib/apps/make_nuwiki.py", line 193, in make_nuwiki pool.join(raise_error=True) File "/usr/lib/python2.6/site-packages/gevent-0.13.8-py2.6-linux-x86_64.egg/gevent/pool.py", line 101, in join raise greenlet.exception urllib2.URLError: <urlopen error [Errno 3] name does not exist> in function system, file /usr/lib/python2.6/site-packages/mwlib-0.14.3-py2.6-linux-x86_64.egg/EGG-INFO/scripts/nslave.py, line 64 in function qaddw, file /usr/lib/python2.6/site-packages/qs/slave.py, line 66

Installation:
OS: CentOS ver.6.3 64bit
Wiki: MediaWiki ver.1.20.2
Mediawiki Extension: Collection ver.1.10
Mwlib: mwlib: ver.0.14.3
mwlib.rl: ver.0.14.1
mwlib.ext: ver.0.12.4

I use the following installation manual http://mwlib.readthedocs.org/en/latest/installation.html.

I make the following local tests on the server:
Testing Code: mw-zip -c :en -o test.zip Acdc Number
Result:
creating nuwiki in u'tmpBPUvNY/nuwiki'
2013-03-06T16:06:19 mwlib.utils.info >> fetching 'http://en.wikipedia.org/w/index.php?title=Help:Books
/License&action=raw&templates=expand'
removing tmpdir u'tmpBPUvNY'
memory used: res=24.0 virt=239.2

Testing Code: mw-render -c test.zip -o test.pdf -w rl
Result:
MISSING FONTS: 'Nazli','Arundina Serif','Sarai','Kedage'
reading /tmp/tmp-mw-rendergU9zQV/tmp0ENG39/revisions-1.txt
set locale to 'en_ZW.UTF-8' based on the language 'en'
2013-03-06T16:07:55 rlwriter.info >> rendering: 'http://en.wikipedia.org/w/index.php?title=Acdc'
2013-03-06T16:07:56 rlwriter.warning >> invalid image url (obj.target: u'File:ACDC - Toronto November 7,2008.JPG')
2013-03-06T16:07:59 rlwriter.info >> rendering: 'http://en.wikipedia.org/w/index.php?title=Number'
2013-03-06T16:08:01 rlwriter.info >> rendering: u'License'
2013-03-06T16:08:01 rlwriter.warning >> invalid image url (obj.target: u'File:Cc.logo.circle.svg')
2013-03-06T16:08:01 rlwriter.warning >> invalid image url (obj.target: u'Image:Ambox warning yellow.svg')
2013-03-06T16:08:01 rlwriter.warning >> invalid image url (obj.target: u'Image:Ambox warning yellow.svg')
2013-03-06T16:08:01 rlwriter.info >> start rendering: u'/etc/rc.d/init.d/tmpPL_CQt.pdf'
2013-03-06T16:08:02 rlwriter.info >> memory usage after laying out: 329.109375
2013-03-06T16:08:05 rlwriter.warning >> TOC not rendered. Probably pdftk is not properly installed. returncode: 1
2013-03-06T16:08:05 rlwriter.info >> memory usage after reportlab rendering: 336.98828125
2013-03-06T16:08:05 rlwriter.info >> RENDERING OK
removing '/tmp/tmp-mw-rendergU9zQV/tmp0ENG39'

After this tests i open the generate PDF without problem.

This post was posted by Pharao~mediawikiwiki, but signed as Pharao.

WessexOne (talkcontribs)

Hi,

I know this thread is quite old but encountered this problem and none of the suggested fixes worked for me. Just in case anyone else has the same issue still, I thought I'd post my solution.

I'm running a private render server on the same server as our Wiki. CentOS 6.5 x64 MediaWiki 1.22.6 PHP 5.3.3 MySQL 5.1.73 Collection Version 1.6.1

The first step is to ensure SELINUX is disabled. If it was not, the curl_exec($ch) didn't work for me (and I couldn't figure out how to make it work with SELinux).

The second step is to edit

$IP/extensions/Collection/Collection.body.php

In the function

static function mwServeCommand( $command, $args ) {

Replace

$serveURL = $wgCollectionMWServeURL;

with

$serveURL = 'myservername:8899/';

For me, this got rid of the "RuntimeError: command failed with returncode 256" error as it seems that, regardless of what is set in LocalSettings.php, $wgCollectionMWServeURL was being set to pediapress. However, I was then left with the "The POST request to server:8899/ failed ($2)" error. I fixed this by replacing

$response = Http::post($serveURL, array('postData' => $args));

with

$boundary = '--myboundary-bps';
$retval= '';
foreach($args as $key => $value){
    $retval .= "--$boundary\nContent-Disposition: form-data; name=\"$key\"\n\n$value\n";
}
$retval .= "--$boundary--";
$body = $retval;
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: multipart/form-data; boundary=$boundary"));
curl_setopt($ch, CURLOPT_URL, $serveURL);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );
$response = curl_exec($ch);


I got the code from this site and tweaked it http://scraperblog.blogspot.co.uk/2013/07/php-curl-multipart-form-posting.html

Reply to "Render server error - Collection - mwlib"