boxyhq / saas-starter-kit

🔥 Enterprise SaaS Starter Kit - Kickstart your enterprise app development with the Next.js SaaS boilerplate 🚀
https://boxyhq.com/blog/enterprise-ready-saas-starter-kit
Apache License 2.0
3.22k stars 725 forks source link

psycopg not found on local install #306

Closed kubeworkz closed 1 year ago

kubeworkz commented 1 year ago

I'm trying a fresh install locally and after I run ./setup.sh http://localhost then docker compose up I get the following error when it tried to load the apiserver:

plane-createbuckets-1 exited with code 0
plane-db               | 2023-07-17 15:59:35.674 UTC [23] LOG:  database system was not properly shut down; automatic recovery in progress
plane-db               | 2023-07-17 15:59:35.680 UTC [23] LOG:  redo starts at 0/19319F0
plane-db               | 2023-07-17 15:59:35.680 UTC [23] LOG:  invalid record length at 0/1931A28: wanted 24, got 0
plane-db               | 2023-07-17 15:59:35.680 UTC [23] LOG:  redo done at 0/19319F0 system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s
plane-db               | 2023-07-17 15:59:35.706 UTC [21] LOG:  checkpoint starting: end-of-recovery immediate wait
plane-db               | 2023-07-17 15:59:35.815 UTC [21] LOG:  checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.057 s, sync=0.013 s, total=0.121 s; sync files=2, longest=0.011 s, average=0.007 s; distance=0 kB, estimate=0 kB
plane-db               | 2023-07-17 15:59:35.841 UTC [1] LOG:  database system is ready to accept connections
planefrontend          | + /usr/local/bin/replace-env-vars.sh http://localhost:8000 http://localhost
planefrontend          | Replacing all statically built instances of http://localhost:8000 with this string http://localhost .
planebgworker          | Traceback (most recent call last):
planebackend           | Traceback (most recent call last):
planebgworker          |   File "/usr/local/lib/python3.11/site-packages/django/db/backends/postgresql/base.py", line 25, in <module>
planebackend           |   File "/usr/local/lib/python3.11/site-packages/django/db/backends/postgresql/base.py", line 25, in <module>
planebackend           |     import psycopg as Database
planebackend           |   File "/usr/local/lib/python3.11/site-packages/psycopg/__init__.py", line 9, in <module>
planebackend           |     from . import pq  # noqa: F401 import early to stabilize side effects
planebgworker          |     import psycopg as Database
planebgworker          |   File "/usr/local/lib/python3.11/site-packages/psycopg/__init__.py", line 9, in <module>
planebackend           |     ^^^^^^^^^^^^^^^^
planebackend           |   File "/usr/local/lib/python3.11/site-packages/psycopg/pq/__init__.py", line 114, in <module>
planebgworker          |     from . import pq  # noqa: F401 import early to stabilize side effects
planebgworker          |     ^^^^^^^^^^^^^^^^
planebgworker          |   File "/usr/local/lib/python3.11/site-packages/psycopg/pq/__init__.py", line 114, in <module>
planebackend           |     import_from_libpq()
planebackend           |   File "/usr/local/lib/python3.11/site-packages/psycopg/pq/__init__.py", line 106, in import_from_libpq
planebgworker          |     import_from_libpq()
planebackend           |     raise ImportError(
planebackend           | ImportError: no pq wrapper available.
planebgworker          |   File "/usr/local/lib/python3.11/site-packages/psycopg/pq/__init__.py", line 106, in import_from_libpq
planebgworker          |     raise ImportError(
planebgworker          | ImportError: no pq wrapper available.
planebgworker          | Attempts made:
planebgworker          | - couldn't import psycopg 'c' implementation: No module named 'psycopg_c'
planebgworker          | - couldn't import psycopg 'binary' implementation: No module named 'psycopg_binary'
planebgworker          | - couldn't import psycopg 'python' implementation: libpq library not found
planebgworker          | 
planebgworker          | During handling of the above exception, another exception occurred:
planebgworker          | 
planebgworker          | Traceback (most recent call last):
planebgworker          |   File "/usr/local/lib/python3.11/site-packages/django/db/backends/postgresql/base.py", line 27, in <module>
planebgworker          |     import psycopg2 as Database
planebgworker          | ModuleNotFoundError: No module named 'psycopg2'
planebgworker          | 
planebgworker          | During handling of the above exception, another exception occurred:
planebgworker          | 
planebgworker          | Traceback (most recent call last):
planebgworker          |   File "/code/manage.py", line 17, in <module>
planebgworker          |     execute_from_command_line(sys.argv)
planebgworker          |   File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
planebackend           | Attempts made:
planebackend           | - couldn't import psycopg 'c' implementation: No module named 'psycopg_c'
planebackend           | - couldn't import psycopg 'binary' implementation: No module named 'psycopg_binary'
planebackend           | - couldn't import psycopg 'python' implementation: libpq library not found
planebackend           | 
planebackend           | During handling of the above exception, another exception occurred:
planebackend           | 
planebackend           | Traceback (most recent call last):
planebackend           |   File "/usr/local/lib/python3.11/site-packages/django/db/backends/postgresql/base.py", line 27, in <module>
planebackend           |     import psycopg2 as Database
planebackend           | ModuleNotFoundError: No module named 'psycopg2'
planebackend           | 
planebackend           | During handling of the above exception, another exception occurred:
planebackend           | 
planebackend           | Traceback (most recent call last):
planebackend           |   File "/code/manage.py", line 17, in <module>
planebackend           |     execute_from_command_line(sys.argv)
planebackend           |   File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
planebgworker          |     utility.execute()
planebgworker          |   File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 416, in execute
planebackend           |     utility.execute()
planebackend           |   File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 416, in execute
planebackend           |     django.setup()
planebackend           |   File "/usr/local/lib/python3.11/site-packages/django/__init__.py", line 24, in setup
planebgworker          |     django.setup()
planebgworker          |   File "/usr/local/lib/python3.11/site-packages/django/__init__.py", line 24, in setup
planebgworker          |     apps.populate(settings.INSTALLED_APPS)
planebgworker          |   File "/usr/local/lib/python3.11/site-packages/django/apps/registry.py", line 116, in populate
planebgworker          |     app_config.import_models()
planebgworker          |   File "/usr/local/lib/python3.11/site-packages/django/apps/config.py", line 269, in import_models
planebgworker          |     self.models_module = import_module(models_module_name)
deepakprabhakara commented 1 year ago

Thanks @kubeworkz, we'll investigate this issue shortly.

deepakprabhakara commented 1 year ago

@kubeworkz Could you please give us more context, the logs indicate Django framework which should have nothing to do with this service?

kubeworkz commented 1 year ago

oops, I'm losing it. Posted to the wrong repo. Ignore the message...sorry

On Wed, Jul 19, 2023 at 8:09 AM Deepak Prabhakara @.***> wrote:

@kubeworkz https://github.com/kubeworkz Could you please give us more context, the logs indicate Django framework which should have nothing to do with this service?

— Reply to this email directly, view it on GitHub https://github.com/boxyhq/saas-starter-kit/issues/306#issuecomment-1641968575, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVJQ5HZT7G5YN5M7BN753B3XQ7E7ZANCNFSM6AAAAAA2NE47VY . You are receiving this because you were mentioned.Message ID: @.***>

deepakprabhakara commented 1 year ago

@kubeworkz Haha, no worries at all :-)