mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-21 08:15:23 -04:00
[GH-ISSUE #37] [Bug]: in docker log pentAGI have error: Unable to create langfuse client: failed to create langfuse client: public key is required service ssl crt and key already exist #17
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @khomkrit-xfinit on GitHub (Apr 28, 2025).
Original GitHub issue: https://github.com/vxcontrol/pentagi/issues/37
Originally assigned to: @asdek on GitHub.
Affected Component
Core Services (Frontend UI/Backend API)
Describe the bug
when "docker compose up -d" everything look fine. but pentagi container loop restart. i try to read log on this container it have "Unable to create langfuse client: failed to create langfuse client: public key is required service ssl crt and key already exist" i don't know how to fix it.
Steps to Reproduce
try to remove all volume, image and container. and retry command from quick start guide
System Configuration
Deployment Type : Docker compose
environment: macOS 15.4.1 (intel)
Logs and Artifacts
2025/04/28 08:18:52 Unable to create langfuse client: failed to create langfuse client: public key is required
Screenshots or Recordings
Verification
@asdek commented on GitHub (Apr 28, 2025):
Hello @khomkrit-xfinit
Thank you for reporting this issue! The problem relates to the Langfuse client configuration in your
.envfile. The error message "Unable to create langfuse client: failed to create langfuse client: public key is required" indicates that your container is trying to initialize the Langfuse client but cannot do so without proper configuration.You have two options:
Option 1: Disable Langfuse Integration (Simpler)
If you don't need Langfuse observability, ensure Langfuse-related environment variable
LANGFUSE_BASE_URLis completely empty. Double-check that there are no trailing spaces or newlines after the equals sign in your.envfile for these variables.For example, make sure each line looks exactly like:
Option 2: Set Up Langfuse Integration (More Features)
If you want to integrate PentAGI with Langfuse for observability features, follow the instructions in the Langfuse Integration section of the README.
Your configuration should look something like:
Then, run the Langfuse stack alongside PentAGI:
With this setup, you can access the Langfuse Web UI at http://localhost:4000 to analyze execution traces.
Additional Troubleshooting
If you're still experiencing issues after trying the above solutions:
Update your
.envfile with the proper configuration (make sure to properly set the required LLM provider like OpenAI or Anthropic).Start again with a clean configuration:
This should resolve the issue with the container restarting in a loop. Please, let me know if you need further assistance!
@khomkrit-xfinit commented on GitHub (Apr 28, 2025):
oh thank can i ask you something. how can i generate inital langfuse public key and secret key to improve security deploy?
@asdek commented on GitHub (Apr 28, 2025):
@khomkrit-xfinit You have two main options too 😄
Option 1: Manual generate custom keys by yourself (Simpler)
You can generate your own custom keys and update them in both the Langfuse initialization variables and in the PentAGI configuration:
Generate a unique project ID (can be a UUID or a custom format):
Generate public and secret keys with the appropriate format:
Update these values in your
.envfile for both initialization and usage:These values need to match between initialization and usage to ensure proper connection.
Option 2: Create keys through the Langfuse UI (Official Method)
If you prefer using the official Langfuse UI to manage your keys:
First, deploy the Langfuse stack alongside PentAGI:
Access the Langfuse web interface at http://localhost:4000
Sign up for a new account (for first-time setup) or use LANGFUSE_INIT_USER_NAME and LANGFUSE_INIT_USER_PASSWORD variables
Create a new organization and project:
Generate API keys:
pk-lf-) and secret key (starts withsk-lf-)Update your
.envfile with these new values:Restart your containers:
@khomkrit-xfinit commented on GitHub (May 5, 2025):
okay i tried from your recommend but have new error langfuse web can't access and pentagi too.
@asdek commented on GitHub (May 5, 2025):
Hello @khomkrit-xfinit
Could you show me logs from langfuse-web container?
I think that it was not start correctly.
@khomkrit-xfinit commented on GitHub (May 5, 2025):
oh... it fix by step 1. i try "docker compose up -d" by i config .env (just api key for AI) without langfuse config (make sure pentagi work nomally). and step 2. i config .env about langfuse config. and "docker compose -f docker-compose.yml -f docker-compose-langfuse.yml up -d" it can't deploy sametime like config .env pentagi and langfuse and single command "docker compose -f docker-compose.yml -f docker-compose-langfuse.yml up -d". i don't know why this step it work?
@asdek commented on GitHub (May 5, 2025):
Great to hear you've resolved the issue! Let me clarify what happened:
The
.envfile is shared between alldocker-compose*.ymlfiles and it should be consistent for all services. When configuring services that depend on each other, the order of operations matters.Here's why your two-step approach worked:
Docker Compose creates networks defined in the compose files. The
docker-compose.ymlfile creates thepentagi-network, while thedocker-compose-langfuse.ymlfile relies on this network to function properly.When you first ran only PentAGI (
docker compose up -d) with just the AI API keys, it created the necessary network infrastructure.Then, after configuring Langfuse parameters in the
.envfile and running both stacks together (docker compose -f docker-compose.yml -f docker-compose-langfuse.yml up -d), the Langfuse services could properly connect to the existing network.If you try to do everything in one step without proper configuration, the container initialization fails because the Langfuse client in PentAGI attempts to connect before everything is ready.
For the future, you can use this two-step process:
After that you can just apply new images/changes like these:
@khomkrit-xfinit commented on GitHub (May 6, 2025):
okay i found another error when try Monitoring and Observability setup have loop error and produce error log
otel log:
2025-05-06 12:28:23.826 | Error: failed to get config: cannot resolve the configuration: cannot retrieve the configuration: unable to read the file file:/etc/otel/config.yml: open /etc/otel/config.yml: no such file or directory
2025-05-06 12:28:23.826 | 2025/05/06 05:28:23 collector server run finished with error: failed to get config: cannot resolve the configuration: cannot retrieve the configuration: unable to read the file file:/etc/otel/config.yml: open /etc/otel/config.yml: no such file or directory
loki log:
failed parsing config: read /etc/loki/config.yml: is a directory. Use
-config.expand-env=trueflag if you want to expand environment variables in your config filejaeger log:
2025/05/06 05:33:15 maxprocs: Leaving GOMAXPROCS=16: CPU quota undefined
2025/05/06 05:33:15 application version: git-commit=ecbae67ea32f189df1ddb4ec2da46d5fcd328b03, git-version=v1.56.0, build-date=2024-04-03T19:57:40Z
{"level":"info","ts":1746509595.9415228,"caller":"flags/service.go:110","msg":"Mounting metrics handler on admin server","route":"/metrics"}
{"level":"info","ts":1746509595.9416108,"caller":"flags/service.go:116","msg":"Mounting expvar handler on admin server","route":"/debug/vars"}
{"level":"info","ts":1746509595.9419613,"caller":"flags/admin.go:130","msg":"Mounting health check on admin server","route":"/"}
{"level":"info","ts":1746509595.9420395,"caller":"flags/admin.go:144","msg":"Starting admin HTTP server","http-addr":":14269"}
{"level":"info","ts":1746509595.942083,"caller":"flags/admin.go:122","msg":"Admin server started","http.host-port":"[::]:14269","health-status":"unavailable"}
{"level":"info","ts":1746509595.942255,"caller":"grpc@v1.62.1/clientconn.go:429","msg":"[core][Channel #1] Channel created","system":"grpc","grpc_log":true}
{"level":"info","ts":1746509595.942348,"caller":"grpc@v1.62.1/clientconn.go:1724","msg":"[core][Channel #1] original dial target is: "localhost:4317"","system":"grpc","grpc_log":true}
{"level":"info","ts":1746509595.9423869,"caller":"grpc@v1.62.1/clientconn.go:1731","msg":"[core][Channel #1] parsed dial target is: resolver.Target{URL:url.URL{Scheme:"localhost", Opaque:"4317", User:(*url.Userinfo)(nil), Host:"", Path:"", RawPath:"", OmitHost:false, ForceQuery:false, RawQuery:"", Fragment:"", RawFragment:""}}","system":"grpc","grpc_log":true}
{"level":"info","ts":1746509595.9424033,"caller":"grpc@v1.62.1/clientconn.go:1745","msg":"[core][Channel #1] fallback to scheme "passthrough"","system":"grpc","grpc_log":true}
{"level":"info","ts":1746509595.942416,"caller":"grpc@v1.62.1/clientconn.go:1753","msg":"[core][Channel #1] parsed dial target is: passthrough:///localhost:4317","system":"grpc","grpc_log":true}
{"level":"info","ts":1746509595.9424262,"caller":"grpc@v1.62.1/clientconn.go:1876","msg":"[core][Channel #1] Channel authority set to "localhost:4317"","system":"grpc","grpc_log":true}
{"level":"info","ts":1746509595.9426208,"caller":"grpc@v1.62.1/resolver_wrapper.go:197","msg":"[core][Channel #1] Resolver state updated: {\n "Addresses": [\n {\n "Addr": "localhost:4317",\n "ServerName": "",\n "Attributes": null,\n "BalancerAttributes": null,\n "Metadata": null\n }\n ],\n "Endpoints": [\n {\n "Addresses": [\n {\n "Addr": "localhost:4317",\n "ServerName": "",\n "Attributes": null,\n "BalancerAttributes": null,\n "Metadata": null\n }\n ],\n "Attributes": null\n }\n ],\n "ServiceConfig": null,\n "Attributes": null\n} (resolver returned new addresses)","system":"grpc","grpc_log":true}
{"level":"info","ts":1746509595.9427135,"caller":"grpc@v1.62.1/balancer_wrapper.go:161","msg":"[core][Channel #1] Channel switches to new LB policy "pick_first"","system":"grpc","grpc_log":true}
{"level":"info","ts":1746509595.942885,"caller":"grpc@v1.62.1/balancer_wrapper.go:213","msg":"[core][Channel #1 SubChannel #2] Subchannel created","system":"grpc","grpc_log":true}
{"level":"info","ts":1746509595.942941,"caller":"grpc@v1.62.1/clientconn.go:532","msg":"[core][Channel #1] Channel Connectivity change to CONNECTING","system":"grpc","grpc_log":true}
{"level":"info","ts":1746509595.9429898,"caller":"grpc@v1.62.1/clientconn.go:335","msg":"[core][Channel #1] Channel exiting idle mode","system":"grpc","grpc_log":true}
{"level":"info","ts":1746509595.943188,"caller":"grpc@v1.62.1/clientconn.go:1223","msg":"[core][Channel #1 SubChannel #2] Subchannel Connectivity change to CONNECTING","system":"grpc","grpc_log":true}
{"level":"info","ts":1746509595.94326,"caller":"grpc@v1.62.1/clientconn.go:1338","msg":"[core][Channel #1 SubChannel #2] Subchannel picks a new address "localhost:4317" to connect","system":"grpc","grpc_log":true}
2025/05/06 05:33:15 (deprecated, will be removed after 2024-03-01) using sidecar model of grpc-plugin storage, please upgrade to 'reomte' gRPC storage. https://github.com/jaegertracing/jaeger/issues/4647
{"level":"warn","ts":1746509595.9466314,"caller":"grpc@v1.62.1/clientconn.go:1400","msg":"[core][Channel #1 SubChannel #2] grpc: addrConn.createTransport failed to connect to {Addr: "localhost:4317", ServerName: "localhost:4317", }. Err: connection error: desc = "transport: Error while dialing: dial tcp [::1]:4317: connect: connection refused"","system":"grpc","grpc_log":true}
{"level":"info","ts":1746509595.9467044,"caller":"grpc@v1.62.1/clientconn.go:1225","msg":"[core][Channel #1 SubChannel #2] Subchannel Connectivity change to TRANSIENT_FAILURE, last error: connection error: desc = "transport: Error while dialing: dial tcp [::1]:4317: connect: connection refused"","system":"grpc","grpc_log":true}
{"level":"info","ts":1746509595.9467242,"caller":"grpc@v1.62.1/clientconn.go:532","msg":"[core][Channel #1] Channel Connectivity change to TRANSIENT_FAILURE","system":"grpc","grpc_log":true}
{"level":"fatal","ts":1746509595.9472194,"caller":"all-in-one/main.go:114","msg":"Failed to init storage factory","error":"grpc-plugin builder failed to create a store: error attempting to connect to plugin rpc client: fork/exec /etc/jaeger/bin/jaeger-clickhouse-linux-amd64: no such file or directory","stacktrace":"main.main.func1\n\tgithub.com/jaegertracing/jaeger/cmd/all-in-one/main.go:114\ngithub.com/spf13/cobra.(*Command).execute\n\tgithub.com/spf13/cobra@v1.8.0/command.go:983\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tgithub.com/spf13/cobra@v1.8.0/command.go:1115\ngithub.com/spf13/cobra.(*Command).Execute\n\tgithub.com/spf13/cobra@v1.8.0/command.go:1039\nmain.main\n\tgithub.com/jaegertracing/jaeger/cmd/all-in-one/main.go:249\nruntime.main\n\truntime/proc.go:271"}
grafana log:
You may have issues with file permissions, more information here: http://docs.grafana.org/installation/docker/#migrate-to-v51-or-later
logger=settings t=2025-05-06T05:37:20.835021825Z level=error msg="failed to parse "/etc/grafana/grafana.ini": open /etc/grafana/grafana.ini: no such file or directory"
@asdek commented on GitHub (Jun 3, 2025):
Hello @khomkrit-xfinit
I see the issue now! Based on the error logs, it looks like you're missing the configuration files that should be mounted into the containers. All errors point to missing files:
This happens because you need the actual
observabilitydirectory from the PentAGI repository. When these files don't exist on your host but are defined as volumes in docker-compose, Docker creates empty directories instead of files.To fix this:
Clone the PentAGI repository or download it as a ZIP from GitHub:
or download from https://github.com/vxcontrol/pentagi/archive/refs/heads/master.zip
Copy just the
observabilitydirectory to your PentAGI installation location:Then try running the compose commands again:
The observability directory contains all the configuration files that need to be mounted into the containers. Without these files, the services can't start properly.
Let me know if this resolves your issue!
@ibndias commented on GitHub (Jul 24, 2025):
Changing the langfuse to cloud seems to be fine
in .env
LANGFUSE_BASE_URL=https://cloud.langfuse.com@asdek commented on GitHub (Jul 24, 2025):
@ibndias tnx for this check, I'll get the hint into README