Debugging "500: Internal Server Error"

Hi all,

I have spun up a single IPFS host in AWS (instance type m4.large). I am only using this for experimental purposes and have not connected it to the larger IPFS global network. I am running into an issue when adding files to IPFS, but I am unsure how to debug this.

I am able to consistently add and get a simple hello_world.txt. However, I cannot add a larger, package.tar.gz file. I simply get a 500 Server Error: Internal Server Error for url: https://<endpoint>:443/api/v0/add

Checking response body, I only see the following <html>\r\n<head><title>500 Internal Server Error</title></head>\r\n<body>\r\n<center><h1>500 Internal Server Error</h1></center>\r\n<hr><center>nginx/1.16.1</center>\r\n</body>\r\n</html>\r\n

The IPFS daemon logs on the host itself aren’t very helpful either. When I send my failing request, all I see is ipfs[8548]: 2020-10-21T20:58:55.831Z DEBUG cmds/http http/handler.go:90 incoming API request: /add. I don’t see any obvious error logs in the vicinity of that log.

So, to my question: What else can I do to debug my issue? Are there logs I am not aware of? Are there known issues that cause 500 errors? In general, I’m a bit stuck.

Any help is greatly appreciated.

Additional Information

Can you redproduce without using the py-ipfs-http-client?

Can you reproduce with progress=false (https://github.com/ipfs/go-ipfs/issues/6402)?

Can you reproduce with IPFS version 0.7.0?

Can you reproduce with the combinations above but removing nginx from the equation?

Thanks for the quick response and some good ideas.

When I open a tunnel directly to IPFS (not going through nginx), I am able to upload the file!

The issue persists even when I only use cURL (with my nginx proxy) and setting progress to False:

curl -X POST -F file=@/path/to/file.tar.gz "https://<endpoint>:443/api/v0/add?progress=false"

<html>
<head><title>500 Internal Server Error</title></head>
<body>
<center><h1>500 Internal Server Error</h1></center>
<hr><center>nginx/1.16.1</center>
</body>
</html>

I’ll keep poking around the various IPFS forums for nginx-specific fixes.

Solved!

In the end, my issue was specific to my SSL proxy (which runs on nginx). When browsing the logs specific to nginx, it was as simple as changing the permissions for my /var/lib/nginx/tmp/client_body folder.

Thanks for the help!