Can't deploy with render, promethus db lookup fails

未关闭
#7,329 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
prometheus, python

调研方向

从 common/core/metrics.py 开始,traceback 显示 advertise() 正在创建 flagsmith_build_info 指标;检查 /tmp/prometheus 附近 prometheus_client 的多进程初始化过程。复现 Render 的一键部署,并验证它能否成功启动,或者确认是否已记录所需的处理说明。

由索引模型根据 Issue 内容生成。

描述

How are you running Flagsmith
  • Self Hosted with Docker
  • Self Hosted with Kubernetes
  • SaaS at flagsmith.com
  • Some other way (add details in description below)
Describe the bug

im trying to deploy flagsmith to render and getting this error

?: (axes.W004) You have a deprecated setting AXES_ONLY_USER_FAILURES configured in your project settings
Menu
?: (axes.W006) AXES_LOCKOUT_PARAMETERS does not contain 'ip_address'. This configuration allows attackers to bypass rate limits by rotating User-Agents or Cookies.
	HINT: Add 'ip_address' to AXES_LOCKOUT_PARAMETERS.
Traceback (most recent call last):
  File "/usr/local/bin/flagsmith", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/build/.venv/lib/python3.13/site-packages/common/core/main.py", line 149, in main
    execute_from_command_line(argv)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/build/.venv/lib/python3.13/site-packages/common/core/main.py", line 129, in execute_from_command_line
    django_execute_from_command_line(argv)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/build/.venv/lib/python3.13/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
    ~~~~~~~~~~~~~~~^^
  File "/build/.venv/lib/python3.13/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/build/.venv/lib/python3.13/site-packages/django/core/management/base.py", line 420, in run_from_argv
    self.execute(*args, **cmd_options)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/build/.venv/lib/python3.13/site-packages/django/core/management/base.py", line 464, in execute
    output = self.handle(*args, **options)
  File "/build/.venv/lib/python3.13/site-packages/common/core/management/commands/start.py", line 51, in handle
    self.initialise()
    ~~~~~~~~~~~~~~~^^
  File "/build/.venv/lib/python3.13/site-packages/common/core/management/commands/start.py", line 40, in initialise
    autodiscover_modules(
    ~~~~~~~~~~~~~~~~~~~~^
        "metrics",
        ^^^^^^^^^^
        "tasks",
        ^^^^^^^^
    )
    ^
  File "/build/.venv/lib/python3.13/site-packages/django/utils/module_loading.py", line 58, in autodiscover_modules
    import_module("%s.%s" % (app_config.name, module_to_search))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1395, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1023, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/build/.venv/lib/python3.13/site-packages/common/core/metrics.py", line 25, in <module>
    advertise()
    ~~~~~~~~~^^
  File "/build/.venv/lib/python3.13/site-packages/common/core/metrics.py", line 18, in advertise
    flagsmith_build_info.labels(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        ci_commit_sha=version_info["ci_commit_sha"],
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        version=version_info.get("package_versions", {}).get(".") or "unknown",
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ).set(1)
    ^
  File "/build/.venv/lib/python3.13/site-packages/prometheus_client/metrics.py", line 203, in labels
    self._metrics[labelvalues] = self.__class__(
                                 ~~~~~~~~~~~~~~^
        self._name,
        ^^^^^^^^^^^
    ...<4 lines>...
        **self._kwargs
        ^^^^^^^^^^^^^^
    )
    ^
  File "/build/.venv/lib/python3.13/site-packages/prometheus_client/metrics.py", line 399, in __init__
    super().__init__(
    ~~~~~~~~~~~~~~~~^
        name=name,
        ^^^^^^^^^^
    ...<6 lines>...
        _labelvalues=_labelvalues,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/build/.venv/lib/python3.13/site-packages/prometheus_client/metrics.py", line 151, in __init__
    self._metric_init()
    ~~~~~~~~~~~~~~~~~^^
  File "/build/.venv/lib/python3.13/site-packages/prometheus_client/metrics.py", line 413, in _metric_init
    self._value = values.ValueClass(
                  ~~~~~~~~~~~~~~~~~^
        self._type, self._name, self._name, self._labelnames, self._labelvalues,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self._documentation, multiprocess_mode=self._multiprocess_mode
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/build/.venv/lib/python3.13/site-packages/prometheus_client/values.py", line 68, in __init__
    self.__reset()
    ~~~~~~~~~~~~^^
  File "/build/.venv/lib/python3.13/site-packages/prometheus_client/values.py", line 82, in __reset
    files[file_prefix] = MmapedDict(filename)
                         ~~~~~~~~~~^^^^^^^^^^
  File "/build/.venv/lib/python3.13/site-packages/prometheus_client/mmap_dict.py", line 64, in __init__
    self._f = open(filename, 'rb' if read_mode else 'a+b')
              ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/prometheus/gauge_livemax_1.db'
Steps To Reproduce
  1. One-click deploy to render
  2. check the logs
Expected behavior

it boots up or there are instructions for handling this scenario

Screenshots

No response

主要语言
Python
星标
9.9k
派生
658
平均合并
1 天 15 小时
30 天内合并 PR
171

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Flagsmith/flagsmith 的其他 Issue

查看 Flagsmith/flagsmith 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。