TeamWiseFlow / wiseflow

Wiseflow is an agile information mining tool that extracts concise messages from various sources such as websites, WeChat official accounts, social platforms, etc. It automatically categorizes and uploads them to the database.
Other
4.85k stars 811 forks source link

wiseflow可以启动,但start_backedn.sh 和start_tasks.sh报错。 #118

Closed linux2002 closed 1 week ago

linux2002 commented 3 weeks ago

我是windows10专业版,全部用docker启动wiseflow和pocketbase,我主要参考Wiseflow 的readme,有些不清楚的地方参考了这个文章 https://blog.homo.moe/wiseflow-tutorial?locale=en

compose.yaml文件如下: services: core: build: dockerfile: Dockerfile image: wiseflow:latest tty: true stdin_open: true entrypoint: bash docker_entrypoint.sh env_file:

但使用docker compose up 后,在Docker中看到wiseflow和pocketbase都启动起来了,http://127.0.0.1:8090/_/ 可以访问,使用admin的用户名和密码可以登录并且配置 sites 和tags也可以配置。但启动的时候console会报错: PS D:\development\finace\wiseflow> docker compose up [+] Running 2/2 ✔ Container wiseflow-pocketbase-1 Recreated 0.2s ✔ Container wiseflow-core-1 Recreated 0.2s Attaching to core-1, pocketbase-1 pocketbase-1 | 2024/10/30 22:38:44 Server started at https://serve pocketbase-1 | ├─ REST API: https://serve/api/ pocketbase-1 | └─ Admin UI: https://serve/_/ core-1 | 2024/10/30 22:38:44 Server started at http://0.0.0.0:8090 core-1 | ├─ REST API: http://0.0.0.0:8090/api/ core-1 | └─ Admin UI: http://0.0.0.0:8090/_/ core-1 | INFO: Will watch for changes in these directories: ['/app'] core-1 | INFO: Uvicorn running on http://0.0.0.0:8077 (Press CTRL+C to quit) core-1 | INFO: Started reloader process [1] using StatReload core-1 | 2024-10-30 22:38:45.691 | DEBUG | utils.pb_api:init:12 - initializing pocketbase client: http://127.0.0.1:8091 core-1 | Traceback (most recent call last): core-1 | File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 72, in map_httpcore_exceptions core-1 | yield core-1 | File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 236, in handle_request core-1 | resp = self._pool.handle_request(req) core-1 | File "/usr/local/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py", line 216, in handle_request core-1 | raise exc from None core-1 | File "/usr/local/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py", line 196, in handle_request core-1 | response = connection.handle_request( core-1 | File "/usr/local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 99, in handle_request core-1 | raise exc core-1 | File "/usr/local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 76, in handle_request core-1 | stream = self._connect(request) core-1 | File "/usr/local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 122, in _connect core-1 | stream = self._network_backend.connect_tcp(kwargs) core-1 | File "/usr/local/lib/python3.10/site-packages/httpcore/_backends/sync.py", line 205, in connect_tcp core-1 | with map_exceptions(exc_map): core-1 | File "/usr/local/lib/python3.10/contextlib.py", line 153, in exit core-1 | self.gen.throw(typ, value, traceback) core-1 | File "/usr/local/lib/python3.10/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions core-1 | raise to_exc(exc) from exc core-1 | httpcore.ConnectError: [Errno 111] Connection refused core-1 | core-1 | The above exception was the direct cause of the following exception: core-1 | core-1 | Traceback (most recent call last): core-1 | File "/usr/local/lib/python3.10/site-packages/pocketbase/client.py", line 94, in _send core-1 | response = self.http_client.request( core-1 | File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 837, in request core-1 | return self.send(request, auth=auth, follow_redirects=follow_redirects) core-1 | File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 926, in send core-1 | response = self._send_handling_auth( core-1 | File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 954, in _send_handling_auth core-1 | response = self._send_handling_redirects( core-1 | File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 991, in _send_handling_redirects core-1 | response = self._send_single_request(request) core-1 | File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1027, in _send_single_request core-1 | response = transport.handle_request(request) core-1 | File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 235, in handle_request core-1 | with map_httpcore_exceptions(): core-1 | File "/usr/local/lib/python3.10/contextlib.py", line 153, in exit core-1 | self.gen.throw(typ, value, traceback) core-1 | File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 89, in map_httpcore_exceptions core-1 | raise mapped_exc(message) from exc core-1 | httpx.ConnectError: [Errno 111] Connection refused core-1 | core-1 | During handling of the above exception, another exception occurred: core-1 | core-1 | Traceback (most recent call last): core-1 | File "/app/tasks.py", line 2, in core-1 | from insights import pipeline, pb, logger core-1 | File "/app/insights/init.py", line 5, in core-1 | from .get_info import get_info, pb, project_dir, logger, info_rewrite core-1 | File "/app/insights/get_info.py", line 26, in core-1 | pb = PbTalker(logger) core-1 | File "/app/utils/pb_api.py", line 24, in init core-1 | user_data = self.client.collection("users").auth_with_password(email, password) core-1 | File "/usr/local/lib/python3.10/site-packages/pocketbase/services/record_service.py", line 191, in auth_with_password core-1 | response_data = self.client.send( core-1 | File "/usr/local/lib/python3.10/site-packages/pocketbase/client.py", line 118, in send core-1 | response = self._send(path, req_config) core-1 | File "/usr/local/lib/python3.10/site-packages/pocketbase/client.py", line 105, in _send core-1 | raise ClientResponseError( core-1 | pocketbase.utils.ClientResponseError: General request error. Original error: [Errno 111] Connection refused core-1 | 2024-10-30 22:38:46.075 | DEBUG | utils.pb_api:init:12 - initializing pocketbase client: http://127.0.0.1:8091 core-1 | Process SpawnProcess-1: core-1 | Traceback (most recent call last): core-1 | File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 72, in map_httpcore_exceptions core-1 | yield core-1 | File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 236, in handle_request core-1 | resp = self._pool.handle_request(req) core-1 | File "/usr/local/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py", line 216, in handle_request core-1 | raise exc from None core-1 | File "/usr/local/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py", line 196, in handle_request core-1 | response = connection.handle_request( core-1 | File "/usr/local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 99, in handle_request core-1 | raise exc core-1 | File "/usr/local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 76, in handle_request core-1 | stream = self._connect(request) core-1 | File "/usr/local/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 122, in _connect core-1 | stream = self._network_backend.connect_tcp(kwargs) core-1 | File "/usr/local/lib/python3.10/site-packages/httpcore/_backends/sync.py", line 205, in connect_tcp core-1 | with map_exceptions(exc_map): core-1 | File "/usr/local/lib/python3.10/contextlib.py", line 153, in exit core-1 | self.gen.throw(typ, value, traceback) core-1 | File "/usr/local/lib/python3.10/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions core-1 | raise to_exc(exc) from exc core-1 | httpcore.ConnectError: [Errno 111] Connection refused core-1 | core-1 | The above exception was the direct cause of the following exception: core-1 | core-1 | Traceback (most recent call last): core-1 | File "/usr/local/lib/python3.10/site-packages/pocketbase/client.py", line 94, in _send core-1 | response = self.http_client.request( core-1 | File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 837, in request core-1 | return self.send(request, auth=auth, follow_redirects=follow_redirects) core-1 | File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 926, in send core-1 | response = self._send_handling_auth( core-1 | File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 954, in _send_handling_auth core-1 | response = self._send_handling_redirects( core-1 | File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 991, in _send_handling_redirects core-1 | response = self._send_single_request(request) core-1 | File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1027, in _send_single_request core-1 | response = transport.handle_request(request) core-1 | File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 235, in handle_request core-1 | with map_httpcore_exceptions(): core-1 | File "/usr/local/lib/python3.10/contextlib.py", line 153, in exit core-1 | self.gen.throw(typ, value, traceback) core-1 | File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 89, in map_httpcore_exceptions core-1 | raise mapped_exc(message) from exc core-1 | httpx.ConnectError: [Errno 111] Connection refused core-1 | core-1 | During handling of the above exception, another exception occurred: core-1 | core-1 | Traceback (most recent call last): core-1 | File "/usr/local/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap core-1 | self.run() core-1 | File "/usr/local/lib/python3.10/multiprocessing/process.py", line 108, in run core-1 | self._target(*self._args, **self._kwargs) core-1 | File "/usr/local/lib/python3.10/site-packages/uvicorn/_subprocess.py", line 80, in subprocess_started core-1 | target(sockets=sockets) core-1 | File "/usr/local/lib/python3.10/site-packages/uvicorn/server.py", line 65, in run core-1 | return asyncio.run(self.serve(sockets=sockets)) core-1 | File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run core-1 | return loop.run_until_complete(main) core-1 | File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete core-1 | return future.result() core-1 | File "/usr/local/lib/python3.10/site-packages/uvicorn/server.py", line 69, in serve core-1 | await self._serve(sockets) core-1 | File "/usr/local/lib/python3.10/site-packages/uvicorn/server.py", line 76, in _serve core-1 | config.load() core-1 | File "/usr/local/lib/python3.10/site-packages/uvicorn/config.py", line 434, in load core-1 | self.loaded_app = import_from_string(self.app) core-1 | File "/usr/local/lib/python3.10/site-packages/uvicorn/importer.py", line 19, in import_from_string core-1 | module = importlib.import_module(module_str) core-1 | File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module core-1 | return _bootstrap._gcd_import(name[level:], package, level) core-1 | File "", line 1050, in _gcd_import core-1 | File "", line 1027, in _find_and_load core-1 | File "", line 1006, in _find_and_load_unlocked core-1 | File "", line 688, in _load_unlocked core-1 | File "", line 883, in exec_module core-1 | File "", line 241, in _call_with_frames_removed core-1 | File "/app/backend.py", line 5, in core-1 | from insights import message_manager core-1 | File "/app/insights/init.py", line 5, in core-1 | from .get_info import get_info, pb, project_dir, logger, info_rewrite core-1 | File "/app/insights/get_info.py", line 26, in core-1 | pb = PbTalker(logger) core-1 | File "/app/utils/pb_api.py", line 24, in init core-1 | user_data = self.client.collection("users").auth_with_password(email, password) core-1 | File "/usr/local/lib/python3.10/site-packages/pocketbase/services/record_service.py", line 191, in auth_with_password core-1 | response_data = self.client.send( core-1 | File "/usr/local/lib/python3.10/site-packages/pocketbase/client.py", line 118, in send core-1 | response = self._send(path, req_config) core-1 | File "/usr/local/lib/python3.10/site-packages/pocketbase/client.py", line 105, in _send core-1 | raise ClientResponseError( core-1 | pocketbase.utils.ClientResponseError: General request error. Original error: [Errno 111] Connection refused

pocketbase在compose.yaml文件中配置在8091端口了 http://127.0.0.1:8091/_/ 启动后这个不可访问。 将start_backend.sh和 start_tasks.sh 也移动到wiseflow\core 目录下了,两个script文件中的使用...env ,寻找env文件,因为start_tasks.sh和start_backend.sh在wiseflow\core目录下,而.env在wiseflow目录下,这么配置没有错可以找到.env文件。 PS D:\development\finace\wiseflow\core> sh .\start_backend.sh INFO: Will watch for changes in these directories: ['D:\development\finace\wiseflow\core'] INFO: Uvicorn running on http://localhost:8077 (Press CTRL+C to quit) INFO: Started reloader process [8152] using StatReload 2024-10-30 15:46:08.181 | DEBUG | utils.pb_api:init:12 - initializing pocketbase client: http://127.0.0.1:8091 Process SpawnProcess-1: Traceback (most recent call last): File "D:\development\finace\wiseflow\core\utils\pb_api.py", line 20, in init admin_data = self.client.admins.auth_with_password(email, password) File "C:\Users\hongli\AppData\Local\Programs\Python\Python313\Lib\site-packages\pocketbase\services\admin_service.py", line 87, in auth_with_password response_data = self.client.send( self.base_crud_path() + "/auth-with-password", ...<5 lines>... }, ) File "C:\Users\hongli\AppData\Local\Programs\Python\Python313\Lib\site-packages\pocketbase\client.py", line 124, in send raise ClientResponseError( ...<4 lines>... ) pocketbase.utils.ClientResponseError: Response error. Status code:400

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\hongli\AppData\Local\Programs\Python\Python313\Lib\multiprocessing\process.py", line 313, in _bootstrap self.run()


  File "C:\Users\hongli\AppData\Local\Programs\Python\Python313\Lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\hongli\AppData\Local\Programs\Python\Python313\Lib\site-packages\uvicorn\_subprocess.py", line 80, in subprocess_started
    target(sockets=sockets)
    ~~~~~~^^^^^^^^^^^^^^^^^
  File "C:\Users\hongli\AppData\Local\Programs\Python\Python313\Lib\site-packages\uvicorn\server.py", line 65, in run
    return asyncio.run(self.serve(sockets=sockets))
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\hongli\AppData\Local\Programs\Python\Python313\Lib\asyncio\runners.py", line 194, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "C:\Users\hongli\AppData\Local\Programs\Python\Python313\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "C:\Users\hongli\AppData\Local\Programs\Python\Python313\Lib\asyncio\base_events.py", line 721, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "C:\Users\hongli\AppData\Local\Programs\Python\Python313\Lib\site-packages\uvicorn\server.py", line 69, in serve
    await self._serve(sockets)
  File "C:\Users\hongli\AppData\Local\Programs\Python\Python313\Lib\site-packages\uvicorn\server.py", line 76, in _serve
    config.load()
    ~~~~~~~~~~~^^
  File "C:\Users\hongli\AppData\Local\Programs\Python\Python313\Lib\site-packages\uvicorn\config.py", line 434, in load
    self.loaded_app = import_from_string(self.app)
                      ~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "C:\Users\hongli\AppData\Local\Programs\Python\Python313\Lib\site-packages\uvicorn\importer.py", line 19, in import_from_string
    module = importlib.import_module(module_str)
  File "C:\Users\hongli\AppData\Local\Programs\Python\Python313\Lib\importlib\__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, 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 1022, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "D:\development\finace\wiseflow\core\backend.py", line 5, in <module>
    from insights import message_manager
  File "D:\development\finace\wiseflow\core\insights\__init__.py", line 5, in <module>
    from .get_info import get_info, pb, project_dir, logger, info_rewrite
  File "D:\development\finace\wiseflow\core\insights\get_info.py", line 26, in <module>
    pb = PbTalker(logger)
  File "D:\development\finace\wiseflow\core\utils\pb_api.py", line 24, in __init__
    user_data = self.client.collection("users").auth_with_password(email, password)
  File "C:\Users\hongli\AppData\Local\Programs\Python\Python313\Lib\site-packages\pocketbase\services\record_service.py", line 191, in auth_with_password
    response_data = self.client.send(
        self.base_collection_path() + "/auth-with-password",
    ...<5 lines>...
        },
    )
  File "C:\Users\hongli\AppData\Local\Programs\Python\Python313\Lib\site-packages\pocketbase\client.py", line 124, in send
    raise ClientResponseError(
    ...<4 lines>...
    )
pocketbase.utils.ClientResponseError: Response error. Status code:400

请各位帮忙看看究竟是什么问题,应该如何修改?后续还要做什么操作?另外ollama pull qwen2:7b 也下载到本地了。qwen2还需要启动起来吗?
bigbrother666sh commented 3 weeks ago

你在 wiseflows 下没必要用 docker 启动 pocketbase 服务啊……直接下载 pb 客户端启动就行了。如果要用 docker 的话,pb 的 docker 和 wiseflow 的 docker 要组网,不然是不通的