I'm sending image to my server for further processing. I'm using Python's requests
library:
path='/home/mark/Pictures/mike.jpeg'
pdb.set_trace()
image = {'image': open(path, 'rb')}
response = requests.post('http://localhost/image/upload', files=image)
if response:
print(response)
when I step through it with debugger it shows me:
/home/mark/front_end_android/venv/lib/python3.7/site-packages/requests/api.py(119)post()
-> return request('post', url, data=data, json=json, **kwargs)
Segmentation fault (core dumped)
The image is a standard jpeg file. What am I doing wrong here ?
Update:
I found this report from nginx:
nginx_1 | 2020/10/21 10:22:29 [warn] 19#19: *3 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000002, client: 172.18.0.1, server: , request: "POST /image/upload HTTP/1.1", host: "localhost"
^ Does this mean that the image is being held by Nginx proxy ?
Logs from the server:
nginx_1 | 2020/10/21 10:22:29 [warn] 19#19: *3 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000002, client: 172.18.0.1, server: , request: "POST /image/upload HTTP/1.1", host: "localhost"
users_1 | 172.18.0.4 - - [21/Oct/2020 10:22:29] "POST /image/upload HTTP/1.0" 500 -
nginx_1 | 172.18.0.1 - - [21/Oct/2020:10:22:29 +0000] "POST /image/upload HTTP/1.1" 500 39060 "-" "python-requests/2.24.0" "-"