mozilla-services / syncserver

Run-Your-Own Firefox Sync Server
Mozilla Public License 2.0
1.86k stars 142 forks source link

Not running from a recent docker build #272

Open michaelschefczyk opened 3 years ago

michaelschefczyk commented 3 years ago

Dear All,

I did run this for many months based on internal docker builds - thanks!! The last running build was a week old. A new build does no longer seem to run, probably based on python 2.7 issues. The log shows:

File "/usr/local/lib/python2.7/site-packages/sqlalchemy/pool/base.py", line 639, in __connect connection = pool._invoke_creator(self) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect return dialect.connect(*cargs, *cparams) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 453, in connect return self.dbapi.connect(cargs, **cparams) OperationalError: (sqlite3.OperationalError) unable to open database file (Background on this error at: http://sqlalche.me/e/e3q8)

That does not seem to have anything to do with my mysql setup because this container https://github.com/crazy-max/docker-firefox-syncserver does run when putting the same sqlalchemy string in its environment variable.

Regards,

Michael Schefczyk

pwlgrzs commented 3 years ago

Hi, I am seeing same error: [2021-07-11 09:06:36 +0000] [8] [INFO] Starting gunicorn 19.10.0 [2021-07-11 09:06:36 +0000] [8] [INFO] Listening at: http://0.0.0.0:5000 (8) [2021-07-11 09:06:36 +0000] [8] [INFO] Using worker: sync [2021-07-11 09:06:36 +0000] [16] [INFO] Booting worker with pid: 16 [2021-07-11 09:06:37 +0000] [16] [ERROR] Exception in worker process Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 586, i n spawn_worker worker.init_process() File "/usr/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 1 35, in init_process self.load_wsgi() File "/usr/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 1 44, in load_wsgi self.wsgi = self.app.wsgi() File "/usr/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, i n wsgi self.callable = self.load() File "/usr/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52 , in load return self.load_wsgiapp() File "/usr/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41 , in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python2.7/site-packages/gunicorn/util.py", line 350, in i mport_app import(module) File "/app/syncserver/wsgi_app.py", line 2, in application = syncserver.main() File "/app/syncserver/init.py", line 281, in main config = get_configurator(global_config, settings) File "/app/syncserver/init.py", line 273, in get_configurator config.include(includeme) File "/usr/local/lib/python2.7/site-packages/pyramid/config/init.py", line 676, in include c(configurator) File "/app/syncserver/init.py", line 158, in includeme config.include("syncstorage", route_prefix="/storage") File "/usr/local/lib/python2.7/site-packages/pyramid/config/init.py", line 676, in include c(configurator) File "/usr/local/lib/python2.7/site-packages/syncstorage/init.py", line 18 , in includeme config.include("syncstorage.storage") File "/usr/local/lib/python2.7/site-packages/pyramid/config/init.py", line 676, in include c(configurator) File "/usr/local/lib/python2.7/site-packages/syncstorage/storage/init.py", line 576, in includeme storage = load_storage_from_settings("storage", settings) File "/usr/local/lib/python2.7/site-packages/syncstorage/storage/init.py", line 600, in load_storage_from_settings return klass(section_settings) File "/usr/local/lib/python2.7/site-packages/syncstorage/storage/sql/init. py", line 137, in init self.dbconnector = DBConnector(sqluri, dbkwds) File "/usr/local/lib/python2.7/site-packages/syncstorage/storage/sql/dbconnect .py", line 385, in init collections.create(self.engine, checkfirst=True) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/sql/schema.py", line 8 60, in create bind._run_visitor(ddl.SchemaGenerator, self, checkfirst=checkfirst) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2032, in _run_visitor with self._optional_conn_ctx_manager(connection) as conn: File "/usr/local/lib/python2.7/contextlib.py", line 17, in enter return self.gen.next() File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2024, in _optional_conn_ctx_manager with self._contextual_connect() as conn: File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2226, in _contextual_connect self._wrap_pool_connect(self.pool.connect, None), File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2266, in _wrap_pool_connect e, dialect, self File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1536, in _handle_dbapi_exception_noconnection util.raise_from_cause(sqlalchemy_exception, exc_info) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 383, in raise_from_cause reraise(type(exception), exception, tb=exc_tb, cause=cause) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2262, in _wrap_pool_connect return fn() File "/usr/local/lib/python2.7/site-packages/sqlalchemy/pool/base.py", line 36 3, in connect return _ConnectionFairy._checkout(self) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/pool/base.py", line 76 0, in _checkout fairy = _ConnectionRecord.checkout(pool) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/pool/base.py", line 49 2, in checkout rec = pool._do_get() File "/usr/local/lib/python2.7/site-packages/mozsvc/metrics.py", line 183, in timed_func return func(*args, kwds) File "/usr/local/lib/python2.7/site-packages/syncstorage/storage/sql/dbconnect .py", line 305, in _do_get return QueuePool._do_get(self) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/pool/impl.py", line 13 9, in _do_get self._dec_overflow() File "/usr/local/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py", line 68, in exit compat.reraise(exc_type, exc_value, exc_tb) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/pool/impl.py", line 13 6, in _do_get return self._create_connection() File "/usr/local/lib/python2.7/site-packages/sqlalchemy/pool/base.py", line 30 8, in _create_connection return _ConnectionRecord(self) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/pool/base.py", line 43 7, in init self.connect(first_connect_check=True) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/pool/base.py", line 63 9, in connect connection = pool._invoke_creator(self) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect return dialect.connect(*cargs, *cparams) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", li ne 453, in connect return self.dbapi.connect(cargs, cparams) OperationalError: (sqlite3.OperationalError) unable to open database file (Background on this error at: http://sqlalche.me/e/e3q8) [2021-07-11 09:06:37 +0000] [16] [INFO] Worker exiting (pid: 16) [2021-07-11 09:06:38 +0000] [8] [INFO] Shutting down: Master [2021-07-11 09:06:38 +0000] [8] [INFO] Reason: Worker failed to boot.**

BartekWolv commented 3 years ago

Did you fix guys this issue? I had working container before but yesterday I did clean install of system and now I can't manage it to work while I'm using clean docker image :/

JXGA commented 3 years ago

I had this issue - re-read the docs and realised the issue...

There is experimental support for running the server inside a Docker container. The docker image runs with UID/GID 1001/1001.

A quick id 1001 and chown fixed the issue.

BartekWolv commented 3 years ago

I had this issue - re-read the docs and realised the issue...

There is experimental support for running the server inside a Docker container. The docker image runs with UID/GID 1001/1001.

A quick id 1001 and chown fixed the issue.

within container? or where?

JXGA commented 3 years ago

I had this issue - re-read the docs and realised the issue...

There is experimental support for running the server inside a Docker container. The docker image runs with UID/GID 1001/1001.

A quick id 1001 and chown fixed the issue.

within container? or where?

On the host file system, or use a different database address (MySQL might work fine with SQLAlchemy)

gmolveau commented 2 years ago

any updates on this issue ? I'm still getting the error unable to open database file when using a volume with docker-compose

BartekWolv commented 2 years ago

I give up with this official Docker, I use instead Docker created by Docker employee: https://registry.hub.docker.com/r/crazymax/firefox-syncserver/ https://github.com/crazy-max/docker-firefox-syncserver Works fine since then (except somehow not works on phone, not sure why).

gmolveau commented 2 years ago

Thank's for your answer. I gave it a try and managed to make it work with MariaDB instead of sqlite.

https://github.com/gmolveau/mozilla_syncserver

jcleng commented 1 year ago

the mozilla/syncserver:latest same