Black Lives Matter. Please consider donating to Black Girls Code today.
Dash HoloViews is now available! Check out the docs.

502 errors on trying to save images

I keep getting the following error when I try to save an image (using plotly_IMAGE in R):

<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>502 Server Error</title>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Server Error</h1>
<h2>The server encountered a temporary error and could not complete your request.<p>Please try again in 30 seconds.</h2>

I have updated to the latest version of the R library from github, and it hasn’t helped. Waiting 30s as suggested in the error message doesn’t help. Occasionally, I get lucky and an image is produced, but on most attempts I get this error. This has persisted for several days. Is there a fix?

Replying to myself: the solution was to reduce the complexity of the plots by reducing the number of traces.