Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Can't download bitstream from API #262

@nholthaus

Description

@nholthaus

version: 3.4.2

host: Ubuntu 14.04 (VM)

I have what I believe to be a working instance of Midas running. I'm able to upload/download files successfully when using the web interface.

However, I can't seem to download files via the API, which is what I really care about since I want to use Midas as a CMake external data store.

I have a bitstream, "10", which exists and returns the following from GET /rest/bitstream/10:

{
    "data":
    {
        "id":"10",
        "item_id":"10",
        "itemrevision_id":"9",
        "name":"singleFileTestPDWData_20160601.tar.gz",
        "mimetype":"application\/x-gzip",
        "size":"8395640",
        "md5":"74b552573f3ac17f4a270f5f38c6c442",
        "date_created":"2016-10-20 17:44:07",
        "date_updated":"2016-10-20 17:44:07"
    }
}

But when I try to access the file via the download URLs, either:

"http://midas.mit.edu/rest/bitstream/download/10"

or

"http://midas.mit.edu/rest/bitstream/download?checksum=74b552573f3ac17f4a270f5f38c6c442"

I get the following error:

The system has encountered the following error:

Call to undefined method Zend_Controller_Request_Http::dispatchError()
In /var/www/midas.mit.edu/html/library/REST/Controller/Plugin/RestHandler.php, line: 176
At 12:28:03 2016-10-21

Please notify your administrator with this information. 

And if I try to curl it, nothing is downloaded, and I get the following:

$ curl -vvv -o file.tar.gz "http://midas.mit.edu/rest/bitstream/download/10"`

> GET /rest/bitstream/download/10 HTTP/1.1
> User-Agent: curl/7.35.0
> Host: midas.mit.edu
> Accept: */*
> 
< HTTP/1.1 302 Found
< Date: Fri, 21 Oct 2016 12:44:23 GMT
* Server Apache/2.4.7 (Ubuntu) is not blacklisted
< Server: Apache/2.4.7 (Ubuntu)
< X-Powered-By: PHP/5.5.9-1ubuntu4.20
< Set-Cookie: PHPSESSID=3thup2nfv4arsbc9jq0djf1e75; path=/; HttpOnly
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< Pragma: no-cache
< Vary: Accept
< Access-Control-Max-Age: 86400
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Headers: Authorization, X-Authorization, Origin, Accept, Content-Type, X-Requested-With, X-HTTP-Method-Override
< Access-Control-Allow-Methods: OPTIONS, HEAD, GET, PUT, DELETE, POST
< Location: /download/?bitstream=10&offset=0&name=singleFileTestPDWData_20160601.tar.gz
< Content-Length: 0
< Content-Type: application/json
< 
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Connection #0 to host midas.mit.edu left intact

and the production.log file shows:

2016-10-21T12:09:07+00:00 CRIT (2): Fatal Error: Array
(
    [type] =&gt; 1
    [message] =&gt; Call to undefined method Zend_Controller_Request_Http::dispatchError()
    [file] =&gt; /var/www/midas.mit.edu/html/library/REST/Controller/Plugin/RestHandler.php
    [line] =&gt; 176
    [typeText] =&gt; E_ERROR
)


URL: http://midas.mit.edu/rest/bitstream/download?checksum=74b552573f3ac17f4a270f5f38c6c442

Server time: 2016-10-21 12:09:07
Parameters (post): Array
(
)
Parameters (get): Array
(
    [checksum] =&gt; 74b552573f3ac17f4a270f5f38c6c442
)

The permissions on the file are set to public, and I've tried the download with an authorization token as well, with the same results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions