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

2.4.14 paas部署失败,无法migrate和启动项目 #1004

Open
ZongweiBai opened this issue Jun 27, 2022 · 0 comments
Open

2.4.14 paas部署失败,无法migrate和启动项目 #1004

ZongweiBai opened this issue Jun 27, 2022 · 0 comments

Comments

@ZongweiBai
Copy link

paas版本:2.4.14
python版本:3.5.10

我这边从头初始化一个环境,之前没有任何已部署环境和依赖,按照文档部署bk-paas 2.4.14版本的login模块,在进行migrate的时候报错如下:

WARNINGS:
?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. You must put the values of the following settings into your default TEMPLATES dict: TEMPLATE_CONTEXT_PROCESSORS.
Operations to perform:
  Apply all migrations: admin, auth, bkaccount, contenttypes, sessions
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying admin.0001_initial...Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python3.5/site-packages/django/db/backends/mysql/base.py", line 101, in execute
    return self.cursor.execute(query, args)
  File "/usr/local/lib/python3.5/site-packages/pymysql/cursors.py", line 146, in execute
    result = self._query(query)
  File "/usr/local/lib/python3.5/site-packages/pymysql/cursors.py", line 296, in _query
    conn.query(q)
  File "/usr/local/lib/python3.5/site-packages/pymysql/connections.py", line 781, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/usr/local/lib/python3.5/site-packages/pymysql/connections.py", line 942, in _read_query_result
    result.read()
  File "/usr/local/lib/python3.5/site-packages/pymysql/connections.py", line 1138, in read
    first_packet = self.connection._read_packet()
  File "/usr/local/lib/python3.5/site-packages/pymysql/connections.py", line 906, in _read_packet
    packet.check_error()
  File "/usr/local/lib/python3.5/site-packages/pymysql/connections.py", line 367, in check_error
    err.raise_mysql_exception(self._data)
  File "/usr/local/lib/python3.5/site-packages/pymysql/err.py", line 120, in raise_mysql_exception
    _check_mysql_exception(errinfo)
  File "/usr/local/lib/python3.5/site-packages/pymysql/err.py", line 112, in _check_mysql_exception
    raise errorclass(errno, errorvalue)
pymysql.err.IntegrityError: (1215, 'Cannot add foreign key constraint')

然后我试着部署ccr.ccs.tencentyun.com/bk.io/paas-standalone:latest镜像版本,部署成功后复制镜像版本的mysql环境到2.4.14版本,然后直接启动 python manage.py runserver 8003,这次报错如下:

System check identified 1 issue (0 silenced).

You have 1 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): bkaccount.
Run 'python manage.py migrate' to apply them.

June 27, 2022 - 11:01:24
Django version 1.11.29, using settings 'settings'
Starting development server at http://127.0.0.1:8003/
Quit the server with CONTROL-C.
/bk-PaaS-2.14.14/paas2/login/wsgi.py:17: MonkeyPatchWarning: Monkey-patching outside the main native thread. Some APIs will not be available. Expect a KeyError to be printed at shutdown.
  monkey.patch_all()
/bk-PaaS-2.14.14/paas2/login/wsgi.py:17: MonkeyPatchWarning: Monkey-patching not on the main thread; threading.main_thread().join() will hang from a greenlet
  monkey.patch_all()
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7fe99e9ad158>
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/django/utils/autoreload.py", line 228, in wrapper
    fn(*args, **kwargs)
  File "/usr/local/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 146, in inner_run
    handler = self.get_handler(*args, **options)
  File "/usr/local/lib/python3.5/site-packages/django/contrib/staticfiles/management/commands/runserver.py", line 28, in get_handler
    handler = super(Command, self).get_handler(*args, **options)
  File "/usr/local/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 67, in get_handler
    return get_internal_wsgi_application()
  File "/usr/local/lib/python3.5/site-packages/django/core/servers/basehttp.py", line 47, in get_internal_wsgi_application
    return import_string(app_path)
  File "/usr/local/lib/python3.5/site-packages/django/utils/module_loading.py", line 20, in import_string
    module = import_module(module_path)
  File "/usr/local/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 985, in _gcd_import
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 171, in __exit__
  File "<frozen importlib._bootstrap>", line 123, in release
RuntimeError: cannot release un-acquired lock

我的疑问是2.4.14支持的具体python版本是多少?怎么样重新部署一个paas环境,是否只支持逐步从社区版部署进行替换的方式?

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

1 participant