oTree Forum >

Heroku error messages on large database production

#1 by AndreL

I am in the process of creating a very large session with >2000 subjects.

Everything works fine when building a database for just 200, 400 subjects.

I am using Postgres Standard-3 and professional Dynos, via oTree Hub to deploy.

When creating the session, I get stuck on this animated slider loop, up to 2 hours. If I download the empty dataset, all lines are filled and it seems nothing is wrong there. I can easily test with a few dozen subjects getting links and filling it: no errors when subjects are on the experiment live.

This is the error from SENTRY below.

Any ideas is this is really some hidden issue that will affect using the database to deploy, or just some minor error message when building the table? Reseting the db works always fine without errors.

___________________________
websockets/legacy/server.py in handshake at line 596

            warnings.warn("declare process_request as a coroutine", DeprecationWarning)
            early_response = early_response_awaitable  # type: ignore
        # The connection may drop while process_request is running.
        if self.state is State.CLOSED:
            raise self.connection_closed_exc()  # pragma: no cover
        # Change the response to a 503 error if the server is shutting down.
        if not self.ws_server.is_serving():
            early_response = (
                http.HTTPStatus.SERVICE_UNAVAILABLE,
available_extensions    
[
<websockets.extensions.permessage_deflate.ServerPerMessageDeflateFactory object at 0x7fde93fd8880>
]
available_subprotocols    
None
early_response    
None
early_response_awaitable    
<coroutine object WebSocketProtocol.process_request at 0x7fdeb014e840>
extra_headers    
None
origins    
None
path    
'/create_session'
request_headers    
{
accept-encoding: 'gzip, deflate, br', 
accept-language: 'en-US,en;q=0.9', 
cache-control: 'no-cache', 
connection: 'Upgrade', 
host: 'snf-savliq.herokuapp.com', 
origin: 'https://snf-savliq.herokuapp.com', 
pragma: 'no-cache', 
sec-websocket-version: '13', 
upgrade: 'websocket', 
user-agent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36'
}
self    
<uvicorn.protocols.websockets.websockets_impl.WebSocketProtocol object at 0x7fdeb01e8b20>


And this is the handler:
______________________________________________________________
websockets/legacy/server.py in handler at line 162

        """
        try:
            try:
                await self.handshake(
                    origins=self.origins,
                    available_extensions=self.available_extensions,
                    available_subprotocols=self.available_subprotocols,
                    extra_headers=self.extra_headers,
                )
exc    
ConnectionClosedError(None, None, None)
self    
<uvicorn.protocols.websockets.websockets_impl.WebSocketProtocol object at 0x7fdeb01e8b20>

#2 by Chris_oTree

It’s possible that the session was correctly created, but the “creating session” page disconnected from the server due to a websocket timeout so it stays stuck. If you reload the page after some time and you see the session admin page with start links etc, then I expect this issue not to affect participants.

#3 by AndreL

That is what I imagined. Always good to have some reassurance nonetheless, Chris. Thanks.

Write a reply

Set forum username