Repository navigation
Docker cannot be deployed #4
Copy link
Copy link
Closed
Description
First of all, I am very grateful to the author for developing this bot.
Next I will describe my problem.
I consulted the tutorial and referenced the deployment case
我的部署命令如下:
docker run --rm -it --name allocator-bot \
-e HOST_URL=http://localhost:4322 \
-e APP_API_KEY=my_api_key \
-e OPENROUTER_API_KEY=my_api_key\
-e data_folder_path=/data \
-e S3_ENABLED=false \
-p 4299:4299 \
ghcr.io/piiq/allocator-bot:latest
The activation error code is as follows:
Traceback (most recent call last):
File "/app/.venv/bin/openbb-api", line 4, in <module>
from openbb_platform_api.main import main
File "/app/.venv/lib/python3.12/site-packages/openbb_platform_api/main.py", line 48, in <module>
kwargs = parse_args()
^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/openbb_platform_api/utils/api.py", line 408, in parse_args
_kwargs["app"] = import_app(_app_path, _name, _factory)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/openbb_platform_api/utils/api.py", line 341, in import_app
app = app_or_factory()
^^^^^^^^^^^^^^^^
File "/app/allocator_bot/__main__.py", line 19, in get_app
from .api import app
File "/app/allocator_bot/api.py", line 13, in <module>
from .agent import execution_loop
File "/app/allocator_bot/agent.py", line 30, in <module>
from .portfolio import prepare_allocation
File "/app/allocator_bot/portfolio.py", line 8, in <module>
from .config import config
File "/app/allocator_bot/config.py", line 9, in <module>
config = AppConfig(
^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/pydantic/main.py", line 253, in __init__
validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 2 validation errors for AppConfig
agent_host_url
Value error, agent_host_url environment variable is required. [type=value_error, input_value='', input_type=str]
For further information visit https://errors.pydantic.dev/2.11/v/value_error
data_folder_path
Value error, Data folder path must be set when S3 is not enabled. [type=value_error, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.11/v/value_error
The deployment environment is as follows:
OS: debian 12
Docker version 28.3.3, build 980b856
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
piiq commentedon Aug 21, 2025
Thanks for the issue. Need to check the readme - there might be an env variable missing in the documentation.
Fix Docker deployment and configuration documentation inconsistencies (…
piiq commentedon Aug 22, 2025
@fenglingR can you try using the instructions in the updated readme?
In your case
AGENT_HOST_URLinstead ofHOST_URLDATA_FOLDER_PATHshould be in capsI would also suggest you mount a folder to
/dataso that your info is persisted between container rebuildsso your command would look like:
This command will mount the folder you're launching it from into /data and the allocations will be saved there
fenglingR commentedon Aug 24, 2025
Thank you, I have successfully deployed it now.
But I now have a new problem.
As you can see, I can't use copilot.
I checked the docker logs and found that no requests were generated.
I have a question about the configuration side. Can APP_API_KEY set as a self-service password? Or use OpenAI's api_key? I can't troubleshoot the specific problem, please explain if you need to see my configuration.
Please help me, thank you
piiq commentedon Aug 24, 2025
The APP_API_KEY is any string that you use as an auth token to access the bot (so that it can be deployed beyond your local machine)
So when you're adding the bot, after you paste the URL you should click the "Add Authentication" button and specify the Authorization header so that you see something like this (this assumes that your APP_API_KEY variable is
my_api_key):Did this section of the readme help? https://github.com/piiq/allocator-bot?tab=readme-ov-file#adding-to-openbb-workspace
Note: the OPENROUTER_API_KEY is not the OpenAI API key. The bot in it's current state uses a DeepSeek-V3 model, not any of the OpenAI models. You can get an OpenRouter API key on https://openrouter.ai/
piiq commentedon Aug 26, 2025
@fenglingR
Did the suggestion above help?
fenglingR commentedon Sep 12, 2025
Hey, thank you for your concern.
I've been busy with work recently, so I've put this project aside.
Unfortunately, the problem has not been resolved.
I checked the format for adding components and found that there was an error in the key part, which made it impossible to access the data. After the correction, openbb was able to access the widget data.
But I still can't use this bot properly.
I added a layer of proxy on the host system of Docker, but found no commands to request the API.
I checked the backend API data of OPENROUTER and found that no requests were received. I believe it should be a network issue.
But the network environment I am in requires the use of a VPN to access the internet normally.
I need your further assistance, thank you.
piiq commentedon Sep 13, 2025
Hi @fenglingR
You actually pointed out a bug that resulted from OpenRouter model providers not advertising certain features their API supports. I've been able to reproduce it an I have fixed the bug in this PR #6
The new image has been built and published. I've just installed the new version to my deployment and I see it working correctly.
Please do
followed by
And tell me how it goes.
fenglingR commentedon Sep 14, 2025
Thank you for your reminder, I have received the update and redeployed the service.
Unfortunately, this update doesn't seem to have solved the problem.
First of all, the bot is still unable to call the LLM model and cannot respond.
OpenBB encountered a 500 error code when requesting historical data.
In addition, when I tried to view the /doc/ documentation of the deployment link, it returned: {"detail":"Not Found"}
I will put the error logs from the Docker run below. Thank you to the author for taking the time and effort to maintain this project amidst a busy schedule.
piiq commentedon Sep 14, 2025
@fenglingR
This
Means that the bot doesn't have the permission to read the folder that you have mounted.
Can you post the launch command you used?
piiq commentedon Sep 14, 2025
Also, was there any error in the logs when you tried calling the llm?
fenglingR commentedon Sep 15, 2025
I checked my deployment command, and it was a problem with the command for the file path of the persistent storage that caused a lack of permissions. But when calling the LLM, no command was sent and there was no error reported. It only reported the following error on the front end:
piiq commentedon Sep 16, 2025
Hey @fenglingR
I've added configuration validation on application startup in this PR #7
The new docker image has been published. When you use the new version at startup the app will check if the API keys that you have provided are valid. Once you run - can you paste the startup logs? This might give us an understanding of what's wrong with the LLM connection.