philschatz / octokat.js

:octocat: Github API Client using Promises or callbacks. Intended for the browser or NodeJS.
http://philschatz.com/2014/05/25/octokat/
MIT License
421 stars 133 forks source link

413 Request Entity Too Large - nginx #169

Closed SleepyBandit closed 7 years ago

SleepyBandit commented 7 years ago

I've been using octokat in an app for about 2 years, so my code is based on ^0.4.6 of octokat. I have made no changes to the codebase in a long time, and it runs on a linux server in AWS that has not been updated in just as long.

I manage the file everyday so its size is always below 1MB to ensure I wouldn't run into a "too large" issue when committing it to github daily. This is easy because it is an XML file with predictable node elements. When I add one node, I remove one node, so total file size only fluctuates by a few bytes each day and never grows above 950kb. This has worked flawlessly for almost 2 years.

Until yesterday, when it attempts to commit to github it now returns a 413 error. This is the error message I have gotten 2 days in a row now.

{ [Error: <html>
<head><title>413 Request Entity Too Large</title></head>
<body bgcolor="white">
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx</center>
</body>
</html>
] status: 413 }

I even shrunk the file size to 700kb to allow for possible overhead, but it is still returning an error.

Edit: I also get the same error running the code from my local machine. That is two separate environments having the same result. I also updated the octokat package to 3.10.0 and still get the error.

From what I understand, github runs on nginx, and my server (and local machine too) does not appear to have or use nginx. So is this a change to the github API? I have little knowledge on what nginx is or how it would suddenly impact my code like this. I just know the error occurs when my code uses octokat. Anyone have tips for troubleshooting or solving?

SleepyBandit commented 7 years ago

I have gotten a successful call when I shrink the file to under 700kb, so this is definitely a size related issue. I am also confident that it is not a Octokat issue, since I receive the same 413 status when I do a CURL PUT request using the GitHub API. The only thing I do not know is what has changed with GitHub's API to make this suddenly start occurring 2 days ago. Like I said previously, this has worked with a 950KB file for the last 2 years with zero issues.

I will leave this issue open until I get a response from GitHub and then I can hopefully provide their technical response and close this issue out with an actual resolution. Unless the Octokat team would prefer to close it now.

SleepyBandit commented 7 years ago

See shiftkey's reference for another issue thread with additional information. This was an issue with something on GitHub's servers and has since been fixed. Updating this here to provide an answer and close it out.