Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

部署报错 你现在处于部署环境None #10

Open
hausen1012 opened this issue Mar 5, 2024 · 7 comments
Open

部署报错 你现在处于部署环境None #10

hausen1012 opened this issue Mar 5, 2024 · 7 comments

Comments

@hausen1012
Copy link

No description provided.

@jaaksii
Copy link
Owner

jaaksii commented Mar 5, 2024

这是哪一步

@hausen1012
Copy link
Author

这是哪一步

docker 启动报错

@luoxufeiyan
Copy link

同样的问题,日志如下:

docker logs

ubuntu@abby-zetland:~/sublink$ docker logs sublink
[2024-03-15 13:49:46 +0800] [7] [INFO] Starting gunicorn 21.2.0
[2024-03-15 13:49:46 +0800] [7] [INFO] Listening at: http://0.0.0.0:5000 (7)
[2024-03-15 13:49:46 +0800] [7] [INFO] Using worker: sync
[2024-03-15 13:49:46 +0800] [9] [INFO] Booting worker with pid: 9
[2024-03-15 13:49:46 +0800] [10] [INFO] Booting worker with pid: 10
[2024-03-15 13:49:46 +0800] [11] [INFO] Booting worker with pid: 11
[2024-03-15 13:49:46 +0800] [12] [INFO] Booting worker with pid: 12
[2024-03-15 13:49:47 +0800] [9] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1965, in _exec_single_context
self.dialect.do_execute(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 921, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: table user already exists

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

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker
worker.init_process()
File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 134, in init_process
self.load_wsgi()
File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
self.wsgi = self.app.wsgi()
File "/usr/local/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
return self.load_wsgiapp()
File "/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
return util.import_app(self.app_uri)
File "/usr/local/lib/python3.8/site-packages/gunicorn/util.py", line 371, in import_app
mod = importlib.import_module(module)
File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 843, in exec_module
File "", line 219, in _call_with_frames_removed
File "/app/run.py", line 5, in
create_db()
File "/app/app/model.py", line 30, in create_db
db.create_all() # 创建所有表
File "/usr/local/lib/python3.8/site-packages/flask_sqlalchemy/extension.py", line 900, in create_all
self._call_for_binds(bind_key, "create_all")
File "/usr/local/lib/python3.8/site-packages/flask_sqlalchemy/extension.py", line 881, in _call_for_binds
getattr(metadata, op_name)(bind=engine)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/schema.py", line 5813, in create_all
bind._run_ddl_visitor(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 3239, in _run_ddl_visitor
conn._run_ddl_visitor(visitorcallable, element, **kwargs)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2443, in _run_ddl_visitor
visitorcallable(self.dialect, self, **kwargs).traverse_single(element)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/visitors.py", line 670, in traverse_single
return meth(obj, **kw)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 922, in visit_metadata
self.traverse_single(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/visitors.py", line 670, in traverse_single
return meth(obj, **kw)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 955, in visit_table
CreateTable(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 315, in _invoke_with
return bind.execute(self)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1412, in execute
return meth(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 181, in _execute_on_connection
return connection._execute_ddl(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1524, in _execute_ddl
ret = self._execute_context(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1844, in _execute_context
return self._exec_single_context(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1984, in _exec_single_context
self._handle_dbapi_exception(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2339, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1965, in _exec_single_context
self.dialect.do_execute(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 921, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) table user already exists
[SQL:
CREATE TABLE user (
id INTEGER NOT NULL,
username VARCHAR(40),
password VARCHAR(40),
name VARCHAR(40),
PRIMARY KEY (id)
)

]
(Background on this error at: https://sqlalche.me/e/20/e3q8)
[2024-03-15 13:49:47 +0800] [9] [INFO] Worker exiting (pid: 9)
你现在处于部署环境None
[2024-03-15 13:49:47 +0800] [7] [ERROR] Worker (pid:9) exited with code 3
[2024-03-15 13:49:47 +0800] [10] [INFO] Worker exiting (pid: 10)
[2024-03-15 13:49:47 +0800] [11] [INFO] Worker exiting (pid: 11)
你现在处于部署环境None
你现在处于部署环境None
初始化用户表
[2024-03-15 13:49:47 +0800] [12] [INFO] Worker exiting (pid: 12)
你现在处于部署环境None
[2024-03-15 13:49:47 +0800] [7] [ERROR] Shutting down: Master
[2024-03-15 13:49:47 +0800] [7] [ERROR] Reason: Worker failed to boot.

@jaaksii
Copy link
Owner

jaaksii commented Mar 16, 2024

重新启动试试

@zishuai-hao
Copy link

重新启动试试

重新登录可以解决

@WangLiW
Copy link

WangLiW commented May 7, 2024

我也遇到了同样的问题,重启没用

@baqiansan
Copy link

我重启也没有用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants