https://www.ory.sh/ logo
#talk-kratos
Title
# talk-kratos
r

refined-room-36507

03/14/2022, 10:10 PM
G'day. I spun up a Kratos instance using the quickstart (using Postgres). Works fine, so was trying some other stuff. I `exec`ed into the Postgres image, installed
curl
, and called
Copy code
curl -s <http://kratos:4434/identities/c8d98079-c6c0-49e1-a034-92fa2269724b>
Nicely returned my identity (created by following the quickstart). Then I edited the JSON and tried updating it. Only I forgot to copy the file first, so
-d @file.json
just inserted an empty file. This caused Kratos to return an internal server error
How to replicate:
Copy code
curl -v -X PUT <http://kratos:4434/identities/c8d98079-c6c0-49e1-a034-92fa2269724b> -H "Accept: application/json" -d @~/Downloads/david.json
Output:
Copy code
Warning: Couldn't read data from file "~/Downloads/david.json", this makes an 
Warning: empty POST.
*   Trying 172.19.0.6...
* TCP_NODELAY set
* Connected to kratos (172.19.0.6) port 4434 (#0)
> PUT /identities/c8d98079-c6c0-49e1-a034-92fa2269724b HTTP/1.1
> Host: kratos:4434
> User-Agent: curl/7.52.1
> Accept: application/json
> Content-Length: 0
> Content-Type: application/x-www-form-urlencoded
> 
< HTTP/1.1 500 Internal Server Error
< Content-Type: application/json
< Date: Mon, 14 Mar 2022 22:10:02 GMT
< Content-Length: 72
* HTTP error before end of send, stop sending
< 
{"error":{"code":500,"status":"Internal Server Error","message":"EOF"}}
* Curl_http_done: called premature == 0
* Closing connection 0
I suspect kratos doesn't know how to handle an empty file.
Course, now that I figured out the problem I uploaded my file to the container and it worked great! So I don't actually need help getting it to work and should probably turn this into a GH issue. I'll go do that.
3 Views