Jump to content

Topic on Extension talk:Collection

The file you are trying to download does not exist...

8
Jongfeli (talkcontribs)

Hello. I have tried the mwlib mailing list first but it seems to be rather "dead". We have been using the Collection extension and our own render server for some time now (on Ubuntu Server 12.04 LTS). It generates pdf's and it worke(d) like a charm. We recently encountered a strange problem, we noticed that it was still possible to render a page or book but it was not possible to download the pdf anymore. When you then press "Download the file" the following message pops up:

File not found:

The file you are trying to download does not exist: Maybe it has been deleted and needs to be regenerated.
Return to ........

We have been updating to MW 1.22.0 recently but we noticed this behavior also in MW.1.21.x. To make a long story a little shorter, I can get it working again when I open (reload) our wiki's "main page" in a browser on the Web server itself. After that I can download generated pdf files again from any computer on the network. But after a couple of minutes it stops working again.

In Collection.body.php I found 'coll-download_notfound_text' which is probably responsible for the message:

        $info = false;
        if ( isset( $r['url'] ) ) {
            $req = MWHttpRequest::factory( $r['url'] );
            $req->setCallback( array( $this, 'writeToTempFile' ) );
            if ( $req->execute()->isOK() ) {
                $info = true;
            }
            $content_type = $r['content_type'];
            $content_length = $r['content_length'];
            $content_disposition = $r['content_disposition'];
        } else {
            $info = self::mwServeCommand( 'download', array(
                'collection_id' => $request->getVal( 'collection_id' ),
                'writer' => $request->getVal( 'writer' ),
            ) );
            $content_type = $info['content_type'];
            $content_length = $info['download_content_length'];
            $content_disposition = null;
        }
        if ( !$info ) {
            $this->getOutput()->showErrorPage( 'coll-download_notfound_title', 'coll-download_notfound_text' );
            return;
        }

I am not a programmer but does anyone know what the above code does and in witch situation it will show the message ('coll-download_notfound_text'): 'The file you are trying to download does not exist'?

We are running our Wiki on Windows Server 2008 and are using XCache but we have been using XCache for some time now and never encountered problems like this before. It also makes no difference if I run the Wiki with the caching disabled. I also tried several versions of the Collection extension form Git but to no avail. Any help would be appreciated. Thanks.

Qgil-WMF (talkcontribs)

I have seen this problem today for the first time at http://espiral.org

We still haven't succeed downloading a proper PDF (not true, I just got one for a stub, next to +20 failed attempts).

I wonder whether such PDF is supposed to be found in the PediaPress servers, or in my host.

This post was posted by Qgil-WMF, but signed as Qgil.

86.31.250.143 (talkcontribs)

Hi Felipe,

I have the same problem... Did you find a solution?

Thanks

Pivic

Jongfeli (talkcontribs)

Hello Pivic. No I did not find a proper solution yet. I must say that I did not spend or had any time on finding one. Our quick and dirty one was and still is a job that re-load's the main wiki page on the server every 2 minutes. What would be interesting is what the message exactly means. Is the download url "broken"? If so what is wrong with it? Regards.

81.107.138.208 (talkcontribs)

Hi,

I tried your technique but I don't get it to work... I wonder how to double check the URL.. When I look at it, it does not make sense... Maybe someone can post his working URL to see if they are completely diffrent?

The Download button points to: http://www.WEBSITENAME.co.uk/wiki/index.php?title=Special:Book&bookcmd=download&collection_id=9b69472ee6d59d3e&writer=rl&return_to=ARTICLE_NAME

When I try to download my file from my wiki, the render server shows: 213.251.182.12 - - [2014-09-20 14:35:53] "POST /cache/ HTTP/1.0" 200 496 0.049885

Pivicalex (talkcontribs)

But if I type:

192.168.0.7:8898/cache/9b/9b69472ee6d59d3e/output.rl in the browser on my personnal render server then I can download the PDF....

Then if I replace 192.168.0.7 by what google gives me as "what's my IP", then I can download the file with my phone on 3G.

How can I get the URL from my wiki to point to the actual file correctly?

Pivicalex (talkcontribs)

To carry on the debug, in Collection.body.php I added echo " $url " at line 1164 (in the if(!info){}) and read: http://192.168.0.7:8898/cache/9b/9b69472ee6d59d3e/output.rl I read this from my phone on 3G, from a computer connected to the same router and also if I do it from the render server itself.

This URL works (I can download the rendered file) if I type it in the browser of my server and other computers on the local network. But it wouldn't work from anywhere else (i.e. on 3G)..

I think I should see My Actual IP instead of the 192.168.0.7 local one... And also, I should not be reaching this "if(!info) {} as it is an error..

What is the reason for $url = $r->get( 'url' ); to fetch the file address with the render server local IP? How can I fix it? And how can the Download button on mediawiki triggers a "file not found" from computers on the local network even though the $url is correct?

Legaulph (talkcontribs)

I was able to resolve this by changing the port for nslave

mw-qserve&nserve --port 8080&nslave --cachedir ~/cache/ --serve-files-port 80&postman&

Reply to "The file you are trying to download does not exist..."