dexplo / jupyter_to_medium

Python package for publishing Jupyter Notebooks as Medium blogposts
https://dexplo.org/jupyter_to_medium
MIT License
144 stars 13 forks source link

Got 413 Request Entity Too Large #21

Open thigm85 opened 3 years ago

thigm85 commented 3 years ago

Hi,

Thanks for writing this jupyter extension. I tried to publish this notebook but got Got 413 Request Entity Too Large as a result. My guess is that the plotly graph is causing the error. Follow more detailed output:

loading image to medium
loading image to medium

Image Storage Information from Medium
-------------------------------------

[
    {
        "data": {
            "url": "https://cdn-images-1.medium.com/proxy/1*yXIBPqsEnd3PECyrTTDkhQ.png",
            "md5": "yXIBPqsEnd3PECyrTTDkhQ"
        }
    },
    {
        "data": {
            "url": "https://cdn-images-1.medium.com/proxy/1*j5lD0dQRgcwHFIKSBgHIqQ.png",
            "md5": "j5lD0dQRgcwHFIKSBgHIqQ"
        }
    }
]
ValueError: Problem with posting:
<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>

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/jupyter_to_medium/_publish_to_medium.py", line 197, in publish_to_medium
    self.result = req.json()
  File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 898, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/jupyter_to_medium/_bundler.py", line 37, in upload
    data = publish(**kwargs)
  File "/usr/local/lib/python3.8/site-packages/jupyter_to_medium/_publish_to_medium.py", line 300, in publish
    p.main()
  File "/usr/local/lib/python3.8/site-packages/jupyter_to_medium/_publish_to_medium.py", line 222, in main
    self.publish_to_medium()
  File "/usr/local/lib/python3.8/site-packages/jupyter_to_medium/_publish_to_medium.py", line 199, in publish_to_medium
    raise ValueError('Problem with posting:\n' + req.text)
ValueError: Problem with posting:
<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>
tdpetrou commented 3 years ago

Thanks for reporting this. I've actually added support for plotly, but haven't had time to upload the latest changes. I'll keep this issue open until I do. Thanks for reporting this!

thigm85 commented 3 years ago

Great. Thanks for developing this.