I once in a while get 500 request errors when running a script that writes output to a Google spreadsheet: The first one looks like this:
gspread.exceptions.RequestError: (500, '500: This server no longer owns the lock of [my db name]')
The second one prints out a large block of html along with the error message and part of it says "Google Docs encountered an error. Please try reloading this page, or coming back to it in a few minutes." The first error often goes away when I just run the script again but the second one sometimes persists.
Does anyone know if there's anything I can do to prevent these errors?