AECgeeks / ifc-pipeline

Processing queue and front-end for visualizing BIM models with IfcOpenShell, Docker Compose and Flask
MIT License
155 stars 44 forks source link

FATAL: database "bimsurfer2" does not exist #1

Closed Moult closed 4 years ago

Moult commented 4 years ago

Upon attempting an installation, no errors during running init.sh and docker-compose up -d. When I view the homepage (i.e. the domain I specified), I see a file browse and a submit query button.

If I attempt to upload an IFC, I get a 500 internal server error. Checking docker logs reveal:

FATAL:  database "bimsurfer2" does not exist

... and in Python ...

[2020-08-07 05:51:24,442] ERROR in app: Exception on / [POST]                                                                                                                                                                        [636/1813]
Traceback (most recent call last):                                                                                                                                                                                                             
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/engine/base.py", line 2339, in _wrap_pool_connect            
    return fn()                                                                                                        
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/pool/base.py", line 364, in connect                          
    return _ConnectionFairy._checkout(self)                                                                            
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/pool/base.py", line 778, in _checkout                        
    fairy = _ConnectionRecord.checkout(pool)                                                                                                                                                                                                     File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/pool/base.py", line 495, in checkout                         
    rec = pool._do_get()                                                                                                                                                                                                                       
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/pool/impl.py", line 140, in _do_get                          
    self._dec_overflow()                                                                                                                                                                                                                       
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__                                                                                                                                           
    exc_value, with_traceback=exc_tb,                                                                                  
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/util/compat.py", line 178, in raise_                         
    raise exception                                                                                                                                                                                                                            
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/pool/impl.py", line 137, in _do_get                                                                                                                                                  
    return self._create_connection()                                                                                                                                                                                                           
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/pool/base.py", line 309, in _create_connection               
    return _ConnectionRecord(self)                                                                                     
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/pool/base.py", line 440, in __init__                         
    self.__connect(first_connect_check=True)                                                                                                                                                                                                   
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/pool/base.py", line 661, in __connect                                                                                                                                                
    pool.logger.debug("Error on connect(): %s", e)                                                                                                                                                                                             
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__                                                                                                                                           
    exc_value, with_traceback=exc_tb,                                                                                  
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/util/compat.py", line 178, in raise_                                                                                                                                                 
    raise exception                                                                                                                                                                                                                            
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/pool/base.py", line 656, in __connect                                                                                                                                                
    connection = pool._invoke_creator(self)                                                                            
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/engine/strategies.py", line 114, in connect           
    return dialect.connect(*cargs, **cparams)                                                                                                                                                                                                  
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/engine/default.py", line 493, in connect                                                                                                                                             
    return self.dbapi.connect(*cargs, **cparams)                                                                       
  File "/usr/local/lib/python3.7/dist-packages/psycopg2/__init__.py", line 127, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)                                  
psycopg2.OperationalError: FATAL:  database "bimsurfer2" does not exist

Is there potentially missing instructions on setting up the database in the docker setup?

aothms commented 4 years ago

I remember seeing this. My interpretation is that it simply takes a while for the database server to initialize and I didn't accomodate for this. Can you try docker-compose down and another up -d?

Moult commented 4 years ago

@aothms you are correct :) Up and running now! http://view.blenderbim.org:8089/