Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(hobby-installer): fix GeoIP install failure and kafka-init compose variable escaping (#59903)

Suyadi6b49672e2801
diff --git a/bin/hobby-installer/core/geoip.go b/bin/hobby-installer/core/geoip.go
index 7603c58e54a6..ae7eb6d15d35 100644
--- a/bin/hobby-installer/core/geoip.go
+++ b/bin/hobby-installer/core/geoip.go
@@ -62,15 +62,22 @@ func DownloadGeoIP() error {
func installGeoIPDeps() error {
logger := GetLogger()
-
if _, err := exec.LookPath("brotli"); err == nil {
logger.Debug("brotli already installed")
return nil
}
-
+ if err := RequireRoot("install GeoIP dependencies"); err != nil {
+ return err
+ }
+ if err := exec.Command("apt-get", "update").Run(); err != nil {
+ return fmt.Errorf("failed to update apt cache: %w", err)
+ }
logger.Debug("Installing brotli")
cmd := exec.Command("apt-get", "install", "-y", "--no-install-recommends", "brotli")
- return cmd.Run()
+ if err := cmd.Run(); err != nil {
+ return fmt.Errorf("failed to install brotli: %w", err)
+ }
+ return nil
}
func GeoIPExists() bool {
diff --git a/docker-compose.hobby.yml b/docker-compose.hobby.yml
index 6b79b4b369ed..4044ef32924a 100644
--- a/docker-compose.hobby.yml
+++ b/docker-compose.hobby.yml
@@ -503,11 +503,11 @@ services:
# Use rpk topic list as the readiness check - it's a simple operation
# that confirms the broker is accepting Kafka protocol requests
until rpk topic list --brokers kafka:9092 2>/dev/null; do
- echo "Kafka broker not ready yet (elapsed: ${ELAPSED}s)..."
+ echo "Kafka broker not ready yet (elapsed: $${ELAPSED}s)..."
sleep 2
- ELAPSED=$((ELAPSED + 2))
- if [ $ELAPSED -ge $TIMEOUT ]; then
- echo "Timeout waiting for Kafka broker after ${TIMEOUT}s"
+ ELAPSED=$$((ELAPSED + 2))
+ if [ $$ELAPSED -ge $$TIMEOUT ]; then
+ echo "Timeout waiting for Kafka broker after $${TIMEOUT}s"
echo "Final attempt to list topics:"
rpk topic list --brokers kafka:9092 || true
exit 1