PatZilla does not serve requests when started in development mode

未关闭
#52 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
python
领域
backend

调研方向

The traceback identifies patzilla/navigator/templates/site.mako and the missing patzilla.navigator:templates/urlcleaner.js template. Start by checking how that include is packaged and resolved in development mode, then compare it with the installed template files. Done when the /navigator/ request succeeds with the development configuration and the template can be found.

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

描述

Hi there,

following up on the report #51 by @think-nice-things, we tried to reproduce the problem. We installed the software with:

virtualenv --python=python2 .venv2
source .venv2/bin/activate
pip install patzilla
pip install 'urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1'  # Just a fix to adjust some dependency woes.

Then, we created the configuration file patzilla.ini

patzilla make-config development > patzilla.ini

and adjusted a single line, adding the depatech data source like:

[ip_navigator]
datasources = ops, depatisnet, depatech

With that, PatZilla seems to start successfully.

pserve patzilla.ini
2022-04-28 18:26:07,646 INFO     [patzilla.navigator.settings             ][MainThread] Root configuration file is /path/to/patzilla.ini
2022-04-28 18:26:07,646 INFO     [patzilla.util.config                    ][MainThread] Requested configuration files: /path/to/patzilla.ini
2022-04-28 18:26:07,650 INFO     [patzilla.util.config                    ][MainThread] Effective configuration files: /path/to/patzilla.ini
2022-04-28 18:26:09,184 INFO     [patzilla.access.epo.ops.client          ][MainThread] Creating OpsClientPool
2022-04-28 18:26:09,186 INFO     [patzilla.access.depatech.clientpool     ][MainThread] Creating DepaTechClientPool
Starting server in PID 89804.
Serving on http://0.0.0.0:6543

However, when invoking a request to http://localhost:6543/navigator/, the application croaks like

Traceback (most recent call last):
  File "/Users/amo/dev/tmp/testdrive/tmp/.venv2/lib/python2.7/site-packages/pyramid_mako/__init__.py", line 148, in __call__
    result = template.render_unicode(**system)
  File "/Users/amo/dev/tmp/testdrive/tmp/.venv2/lib/python2.7/site-packages/mako/template.py", line 479, in render_unicode
    self, self.callable_, args, data, as_unicode=True
  File "/Users/amo/dev/tmp/testdrive/tmp/.venv2/lib/python2.7/site-packages/mako/runtime.py", line 883, in _render
    **_kwargs_for_callable(callable_, data)
  File "/Users/amo/dev/tmp/testdrive/tmp/.venv2/lib/python2.7/site-packages/mako/runtime.py", line 920, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/Users/amo/dev/tmp/testdrive/tmp/.venv2/lib/python2.7/site-packages/mako/runtime.py", line 947, in _exec_template
    callable_(context, *args, **kwargs)
  File "/Users/amo/dev/tmp/testdrive/tmp/.venv2/lib/python2.7/site-packages/patzilla/navigator/templates/site.mako", line 29, in render_body
    <%include file="urlcleaner.js"/>
  File "/Users/amo/dev/tmp/testdrive/tmp/.venv2/lib/python2.7/site-packages/mako/runtime.py", line 782, in _include_file
    template = _lookup_template(context, uri, calling_uri)
  File "/Users/amo/dev/tmp/testdrive/tmp/.venv2/lib/python2.7/site-packages/mako/runtime.py", line 841, in _lookup_template
    raise exceptions.TemplateLookupException(str(compat.exception_as()))
TemplateLookupException: Can not locate template for uri 'patzilla.navigator:templates/urlcleaner.js'

With kind regards,
Andreas.

主要语言
Python
星标
123
派生
31
平均合并
3 小时 17 分钟
30 天内合并 PR
53

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

ip-tools/patzilla 的其他 Issue

查看 ip-tools/patzilla 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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