Technosoft2000 / docker-calibre-web

Docker image for Calibre Web https://github.com/janeczku/calibre-web/, based on docker image of Alpine
273 stars 58 forks source link

sqlite3.OperationalError: unable to open database file #91

Closed McEyes closed 3 years ago

McEyes commented 3 years ago
Traceback (most recent call last):                                                                                                                                                                                                            
  File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2336, in _wrap_pool_connect                                                                                                                                         
    return fn()                                                                                                                                                                                                                               
  File "/usr/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 364, in connect                                                                                                                                                       
    return _ConnectionFairy._checkout(self)                                                                                                                                                                                                   
  File "/usr/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 778, in _checkout                                                                                                                                                     
    fairy = _ConnectionRecord.checkout(pool)                                                                                                                                                                                                  
  File "/usr/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 495, in checkout                                                                                                                                                      
    rec = pool._do_get()                                                                                                                                                                                                                      
  File "/usr/lib/python3.8/site-packages/sqlalchemy/pool/impl.py", line 241, in _do_get                                                                                                                                                       
    return self._create_connection()                                                                                                                                                                                                          
  File "/usr/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 309, in _create_connection                                                                                                                                            
    return _ConnectionRecord(self)                                                                                                                                                                                                            
  File "/usr/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 440, in __init__                                                                                                                                                      
    self.__connect(first_connect_check=True)                                                                                                                                                                                                  
  File "/usr/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 661, in __connect                                                                                                                                                     
    pool.logger.debug("Error on connect(): %s", e)                                                                                                                                                                                            
  File "/usr/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__                                                                                                                                                
    compat.raise_(                                                                                                                                                                                                                            
  File "/usr/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_                                                                                                                                                      
    raise exception                                                                                                                                                                                                                           
  File "/usr/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 656, in __connect                                                                                                                                                     
    connection = pool._invoke_creator(self)                                                                                                                                                                                                   
  File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect                                                                                                                                               
    return dialect.connect(*cargs, **cparams)                                                                                                                                                                                                 
  File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 493, in connect                                                                                                                                                  
    return self.dbapi.connect(*cargs, **cparams)                                                                                                                                                                                              
sqlite3.OperationalError: unable to open database file  

The above exception was the direct cause of the following exception:                                                                                                                                                                          

Traceback (most recent call last):                                                                                                                                                                                                            
  File "/calibre-web/app/cps.py", line 34, in <module>                                                                                                                                                                                        
    from cps import create_app                                                                                                                                                                                                                
  File "/calibre-web/app/cps/__init__.py", line 72, in <module>                                                                                                                                                                               
    ub.init_db(cli.settingspath)                                                                                                                                                                                                              
  File "/calibre-web/app/cps/ub.py", line 737, in init_db                                                                                                                                                                                     
    Base.metadata.create_all(engine)                       
  File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2339, in _wrap_pool_connect                                                                                                                                         
    Connection._handle_dbapi_exception_noconnection(                                                                                                                                                                                          
  File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1583, in _handle_dbapi_exception_noconnection                                                                                                                       
    util.raise_(                                                                                                                                                                                                                              
  File "/usr/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_                                                                                                                                                      
    raise exception                                                                                                                                                                                                                           
  File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2336, in _wrap_pool_connect                                                                                                                                         
    return fn()                                                                                                                                                                                                                               
  File "/usr/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 364, in connect                                                                                                                                                       
    return _ConnectionFairy._checkout(self)                                                                                                                                                                                                   
  File "/usr/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 778, in _checkout                                                                                                                                                     
    fairy = _ConnectionRecord.checkout(pool)                                                                                                                                                                                                  
  File "/usr/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 495, in checkout                                                                                                                                                      
    rec = pool._do_get()                                                                                                                                                                                                                      
  File "/usr/lib/python3.8/site-packages/sqlalchemy/pool/impl.py", line 241, in _do_get                                                                                                                                                       
    return self._create_connection()                                                                                                                                                                                                          
  File "/usr/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 309, in _create_connection                                                                                                                                            
    return _ConnectionRecord(self)                                                                                                                                                                                                            
  File "/usr/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 440, in __init__                                                                                                                                                      
    self.__connect(first_connect_check=True)                                                                                                                                                                                                  
  File "/usr/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 661, in __connect                                                                                                                                                     
    pool.logger.debug("Error on connect(): %s", e)                                                                                                                                                                                            
  File "/usr/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__                                                                                                                                                
    compat.raise_(                                                                                                                                                                                                                            
  File "/usr/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_                                                                                                                                                      
    raise exception                                                                                                                                                                                                                           
  File "/usr/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 656, in __connect                                                                                                                                                     
    connection = pool._invoke_creator(self)                                                                                                                                                                                                   
  File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect                                                                                                                                               
    return dialect.connect(*cargs, **cparams)                                                                                                                                                                                                 
  File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 493, in connect                                                                                                                                                  
    return self.dbapi.connect(*cargs, **cparams)                                                                                                                                                                                              
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file                                                                                                                                                      
(Background on this error at: http://sqlalche.me/e/13/e3q8) 
> due this the Calibre books directory /books will be used to store the configuration                                                                                                                                                         
[INFO] Checking permissions of the config directory: /books                                                                                                                                                                                   
> Output is: 777 UNKNOWN 1003 root 0                                                                                                                                                                                                          
> Permissions: 777                                                                                                                                                                                                                            
> Assigned group: UNKNOWN                                                                                                                                                                                                                     
> Assigned group ID: 1003                                                                                                                                                                                                                     
> Assigned owner: root                                                                                                                                                                                                                        
> Assigned owner ID: 0                                                                                                                                                                                                                        
> Using permissions for checks: 0777                                                                                                                                                                                                          
> Everyone has write access at /books                                                                                                                                                                                                         
[INFO] 'app.db' and 'gdrive.db' will be linked into /books                                                                                                                                                                                    
> create 'app.db' link /calibre-web/app/app.db assigned to source /books/app.db                                                                                                                                                               
> change the ownership of /calibre-web/app/app.db to calibre:calibre                                                                                                                                                                          
ln: failed to create symbolic link '/calibre-web/app/app.db': File exists                                                                                                                                                                     
ln: failed to create symbolic link '/calibre-web/app/gdrive.db': File exists                                                                                                                                                                  
> create 'gdrive.db' link /calibre-web/app/gdrive.db assigned to source /books/gdrive.db                                                                                                                                                      
> change the ownership of /calibre-web/app/gdrive.db to calibre:calibre                                                                                                                                                                       
[INFO] Checking permissions of the books directory: /books                                                                                                                                                                                    
> Output is: 777 UNKNOWN 1003 root 0                                                                                                                                                                                                          
> Permissions: 777                                                                                                                                                                                                                            
> Assigned group: UNKNOWN                                                                                                                                                                                                                     
> Assigned group ID: 1003                                                                                                                                                                                                                     
> Assigned owner: root                                                                                                                                                                                                                        
> Assigned owner ID: 0                                                                                                                                                                                                                        
> Using permissions for checks: 0777                                                                                                                                                                                                          
> Everyone has write access at /books  
McEyes commented 3 years ago

问题找到了,是由于路径有中文的原因