ArchiveLabs / pragma.archivelab.org

An API for citing Wayback snapshots with OpenAnnotations
https://pragma.archivelab.org
GNU General Public License v3.0
22 stars 3 forks source link

500 Internal Server Error #6

Closed csarven closed 5 years ago

csarven commented 6 years ago

I'm currently getting a 500. The following used to work:

POST / HTTP/1.1
Host: pragma.archivelab.org
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0
Accept: */*
Accept-Language: en-CA,en;q=0.7,en-US;q=0.3
Accept-Encoding: gzip, deflate, br
Referer: https://dokie.li/
content-type: application/json
link: <http://www.w3.org/ns/ldp#Resource>; rel="type"
origin: https://dokie.li
Content-Length: 223
DNT: 1
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

{"url":"https://dokie.li/","annotation":{"@context":"http://www.w3.org/ns/anno.jsonld","@type":"Annotation","motivation":"linking","target":"https://dokie.li/","rights":"https://creativecommons.org/publicdomain/zero/1.0/"}}

Response:

HTTP/1.1 500 INTERNAL SERVER ERROR
Server: nginx/1.4.6 (Ubuntu)
Date: Tue, 10 Jul 2018 07:56:40 GMT
Content-Type: text/html
Content-Length: 291
Connection: keep-alive
Access-Control-Allow-Origin: https://dokie.li

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request.  Either the server is overloaded or there is an error in the application.</p>

I'm also experiencing the same issue with the example request in the README:

$ curl -iX POST -H "Content-Type: application/json" -d '{"url": "google.com", "annotation": {"id": "lst-ib", "message": "Theres a microphone button in the searchbox"}}' https://pragma.archivelab.org
HTTP/1.1 500 INTERNAL SERVER ERROR
Server: nginx/1.4.6 (Ubuntu)
Date: Tue, 10 Jul 2018 08:06:54 GMT
Content-Type: text/html
Content-Length: 291
Connection: keep-alive

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request.  Either the server is overloaded or there is an error in the application.</p>
csarven commented 6 years ago

Apparently the annotation / archive snapshot was created but the response was still 500. From https://pragma.archivelab.org/annotations :

    {
      "annotation": {
        "@context": "http://www.w3.org/ns/anno.jsonld",
        "@id": "https://pragma.archivelab.org/annotations/3159",
        "@type": "Annotation",
        "annotatedAt": "Tue Jul 10 07:56:41 2018",
        "hasTarget": {
          "hasSource": {
            "@id": "http://web.archive.org/web/20180710075630/https://dokie.li/",
            "originalUrl": "https://dokie.li/"
          }
        },
        "motivation": "linking",
        "rights": "https://creativecommons.org/publicdomain/zero/1.0/",
        "target": "https://dokie.li/"
      },
      "canvas_id": null,
      "id": 3159,
      "is_crosslink": false
    }

I think the current hasTarget should be body simply pointing at the archve.org URL. Is there a need for originalUrl (which is not a Web Annotation term) when there is already target (https://dokie.li/)? See also https://github.com/ArchiveLabs/pragma.archivelab.org/issues/3#issuecomment-318325469

mekarpeles commented 5 years ago

Thanks for reporting @csarven! Given there's a target I don't think originalUrl is necessary and can be removed. It's also recoverable from the@id. We can also changehasTargettobody-- cc: @aeschyllus in casehasTarget` is something we were using for IIIF annotation demos.

csarven commented 5 years ago

@mekarpeles Any progress on resolving the 500 error? Did the request parameters towards a successful response change?

mekarpeles commented 5 years ago

I think we have a full disk issue, trying to address this asap (I don't have perms to grow the disk but someone from our devops team is on it this week)

mekarpeles commented 5 years ago

p.s. sorry!!!