I found a previous thread here with similar error issue. Seems to relate to accessing database rather than issues with rendering any data you might have successfully downloaded. A simple thing might be to write some print statements in your code highlighting the milestones of your code. That way you can see how far it gets before going wrong when you check the logs.