Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails due to OpenSSL and database configuration issues #261

Open
ashutosh-fyi opened this issue Jul 8, 2023 · 2 comments
Open

Build fails due to OpenSSL and database configuration issues #261

ashutosh-fyi opened this issue Jul 8, 2023 · 2 comments

Comments

@ashutosh-fyi
Copy link

While trying to set up the PostHog locally, I encountered a series of issues related to OpenSSL and the database configuration.

Here is a brief description of what happened:

  1. After resolving a few package-related issues, I ran into an error related to OpenSSL. The error message was:
Error: Configuration property "enable.ssl.certificate.verification" not supported in this build: OpenSSL not available at build time
   at HighLevelProducer.Client (/path/to/plugin-server/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/node-rdkafka-acosom/lib/client.js:54:18)
   at HighLevelProducer.Producer (/path/to/plugin-server/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/node-rdkafka-acosom/lib/producer.js:75:10)
   at new HighLevelProducer (/path/to/plugin-server/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/node-rdkafka-acosom/lib/producer/high-level-producer.js:93:12)
   at createKafkaProducer (/path/to/plugin-server/src/kafka/producer.ts:16:22)
   at createHub (/path/to/plugin-server/src/utils/db/hub.ts:130:47)
   at processTicksAndRejections (node:internal/process/task_queues:95:5)
   at startPluginsServer (/path/to/plugin-server/src/main/pluginsServer.ts:232:56)

I've tried re-installing rdkafka and OpenSSL - found this thread which helped me install OpenSSL without errors but I'm not sure if it completely fixed the root cause as I'm still facing the same issue.

  1. Lastly, I encountered an error related to a missing database table graphile_worker.jobs. The error message was:

    psycopg2.errors.UndefinedTable: relation "graphile_worker.jobs" does not exist
    

I tried to troubleshoot this, but I'm not certain whether it's due to missing database migrations, a misconfiguration, or some other reason.

Can someone please help? TIA.

@daibhin
Copy link

daibhin commented Jul 11, 2023

Hey 👋

I ran into this exact same issue today. Eventually solved it (with the help of @benjackwhite)

Make sure you have these ENV variables set in your .zshrc (or equivalent) file:

export PATH="/opt/homebrew/opt/openssl@3/bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@3/lib/pkgconfig"

Then purge the node_modules in your plugin-server and re-install them without the cache:

(env) ➜  posthog git:(master) cd plugin-server && rm -rf node_modules/ && cd ..
(env) ➜  posthog git:(master) pnpm i --force --dir plugin-server

You should see Kafka running an install script

node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/node-rdkafka-acosom: Running install script

@xrdt
Copy link

xrdt commented Oct 25, 2023

I had to also rebuild rdkafka in the plugin-server directory.

cd plugin-server && pnpm rebuild node-rdkafka

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants