Uploaded image for project: 'Livy'
  1. Livy
  2. LIVY-525

Response Content-Type is application/json, but a simple string gets returned

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.5.0
    • Fix Version/s: 0.6.0
    • Component/s: Server
    • Labels:
      None

      Description

      When trying to execute a script that is not whitlisted, the error response has content type application/json, but the content is in fact just a plain string:

      $> curl -v -X POST --data '{"file": "/root/NoAccess.R"}' -H "Content-Type: application/json" <SERVER>:8998/batches
      Note: Unnecessary use of -X or --request, POST is already inferred.
      *   Trying <IP ADDRESS>...
      * TCP_NODELAY set
      * Connected to <SERVER> (<IP ADDRESS>) port 8998 (#0)
      > POST /batches HTTP/1.1
      > Host: <SERVER>:8998
      > User-Agent: curl/7.55.1
      > Accept: /
      > Content-Type: application/json
      > Content-Length: 28
      {{> }}
      * upload completely sent off: 28 out of 28 bytes
      < HTTP/1.1 400 Bad Request
      < Date: Tue, 09 Oct 2018 08:20:12 GMT
      < Content-Type: application/json; charset=UTF-8
      < Content-Length: 83
      < Server: Jetty(9.2.16.v20160414)
      {{< }}
      * Connection #0 to host <SERVER> left intact
      "requirement failed: Local path /root/NoAccess.R cannot be added to user sessions."

       

      https://github.com/apache/incubator-livy/blob/master/server/src/main/scala/org/apache/livy/sessions/Session.scala#L131

       

        Attachments

          Activity

            People

            • Assignee:
              IngoSchuster Ingo Schuster
              Reporter:
              IngoSchuster Ingo Schuster
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: