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

Bug: Docker install process does not work #15916

Open
amityweb opened this issue May 1, 2024 · 10 comments
Open

Bug: Docker install process does not work #15916

amityweb opened this issue May 1, 2024 · 10 comments

Comments

@amityweb
Copy link

amityweb commented May 1, 2024

What are you trying to achieve?

Install Saleor using the documentation here https://docs.saleor.io/docs/3.x/setup/docker-compose

The first hurdle is that "docker compose build" throws a version error and stops. Removing the version line then it just does nothing. Absolutely nothing.

Verbose output just says:
DEBU[0000] Enabled Docker Desktop integration (experimental) @ unix:///Users/me/Library/Containers/com.docker.docker/Data/docker-cli.sock

So instead of building from the files from Github, within Docker I search for Saleor in the repos there and find the mirumee/saleor one and it does download and builds the image OK. I do have to specify a port when I run it, else there is no port assigned and localhost does not work. When I assign a custom port it works.

But when i run it, the webpage and logs show the following error in that it cannot connect to port 5432 (I think postgres)

OperationalError at /
could not connect to server: Connection refused
	Is the server running on host "localhost" (::1) and accepting
	TCP/IP connections on port 5432?
could not connect to server: Connection refused
	Is the server running on host "localhost" (127.0.0.1) and accepting
	TCP/IP connections on port 5432?
Request Method:	GET
Request URL:	http://localhost:8080/
Django Version:	3.2.7
Exception Type:	OperationalError
Exception Value:	
could not connect to server: Connection refused
	Is the server running on host "localhost" (::1) and accepting
	TCP/IP connections on port 5432?
could not connect to server: Connection refused
	Is the server running on host "localhost" (127.0.0.1) and accepting
	TCP/IP connections on port 5432?
Exception Location:	/usr/local/lib/python3.9/site-packages/psycopg2/__init__.py, line 122, in connect
Python Executable:	/usr/local/bin/python
Python Version:	3.9.7
Python Path:	
['/app',
 '/app',
 '/usr/local/bin',
 '/usr/local/lib/python39.zip',
 '/usr/local/lib/python3.9',
 '/usr/local/lib/python3.9/lib-dynload',
 '/usr/local/lib/python3.9/site-packages']
Server time:	Wed, 01 May 2024 01:50:16 +0000

The logs show this:

2024-05-01 02:50:16 ERROR django.request Internal Server Error: /favicon.ico [PID:9:ThreadPoolExecutor-8_0]
2024-05-01 02:50:16 Traceback (most recent call last):
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
2024-05-01 02:50:16     self.connect()
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
2024-05-01 02:50:16     return func(*args, **kwargs)
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 200, in connect
2024-05-01 02:50:16     self.connection = self.get_new_connection(conn_params)
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
2024-05-01 02:50:16     return func(*args, **kwargs)
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
2024-05-01 02:50:16     connection = Database.connect(**conn_params)
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/psycopg2/__init__.py", line 122, in connect
2024-05-01 02:50:16     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
2024-05-01 02:50:16 psycopg2.OperationalError: could not connect to server: Connection refused
2024-05-01 02:50:16     Is the server running on host "localhost" (::1) and accepting
2024-05-01 02:50:16     TCP/IP connections on port 5432?
2024-05-01 02:50:16 could not connect to server: Connection refused
2024-05-01 02:50:16     Is the server running on host "localhost" (127.0.0.1) and accepting
2024-05-01 02:50:16     TCP/IP connections on port 5432?
2024-05-01 02:50:16 
2024-05-01 02:50:16 
2024-05-01 02:50:16 The above exception was the direct cause of the following exception:
2024-05-01 02:50:16 
2024-05-01 02:50:16 Traceback (most recent call last):
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/asgiref/sync.py", line 482, in thread_handler
2024-05-01 02:50:16     raise exc_info[1]
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 38, in inner
2024-05-01 02:50:16     response = await get_response(request)
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 263, in _get_response_async
2024-05-01 02:50:16     response = await sync_to_async(response.render, thread_sensitive=True)()
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/asgiref/sync.py", line 444, in __call__
2024-05-01 02:50:16     ret = await asyncio.wait_for(future, timeout=None)
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/asyncio/tasks.py", line 442, in wait_for
2024-05-01 02:50:16     return await fut
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/asgiref/current_thread_executor.py", line 22, in run
2024-05-01 02:50:16     result = self.fn(*self.args, **self.kwargs)
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/asgiref/sync.py", line 486, in thread_handler
2024-05-01 02:50:16     return func(*args, **kwargs)
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/template/response.py", line 105, in render
2024-05-01 02:50:16     self.content = self.rendered_content
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/template/response.py", line 83, in rendered_content
2024-05-01 02:50:16     return template.render(context, self._request)
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/template/backends/django.py", line 61, in render
2024-05-01 02:50:16     return self.template.render(context)
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 168, in render
2024-05-01 02:50:16     with context.bind_template(self):
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/contextlib.py", line 119, in __enter__
2024-05-01 02:50:16     return next(self.gen)
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/debug_toolbar/panels/templates/panel.py", line 46, in _request_context_bind_template
2024-05-01 02:50:16     context = processor(self.request)
2024-05-01 02:50:16   File "/app/saleor/site/context_processors.py", line 13, in site
2024-05-01 02:50:16     site = get_current_site(request)
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/contrib/sites/shortcuts.py", line 13, in get_current_site
2024-05-01 02:50:16     return Site.objects.get_current(request)
2024-05-01 02:50:16   File "/app/saleor/site/patch_sites.py", line 25, in new_get_current
2024-05-01 02:50:16     site = self.prefetch_related("settings").filter(pk=site_id)[0]
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 317, in __getitem__
2024-05-01 02:50:16     qs._fetch_all()
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 1324, in _fetch_all
2024-05-01 02:50:16     self._result_cache = list(self._iterable_class(self))
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 51, in __iter__
2024-05-01 02:50:16     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1173, in execute_sql
2024-05-01 02:50:16     cursor = self.connection.cursor()
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
2024-05-01 02:50:16     return func(*args, **kwargs)
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 259, in cursor
2024-05-01 02:50:16     return self._cursor()
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 235, in _cursor
2024-05-01 02:50:16     self.ensure_connection()
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
2024-05-01 02:50:16     return func(*args, **kwargs)
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
2024-05-01 02:50:16     self.connect()
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
2024-05-01 02:50:16     raise dj_exc_value.with_traceback(traceback) from exc_value
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
2024-05-01 02:50:16     self.connect()
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
2024-05-01 02:50:16     return func(*args, **kwargs)
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 200, in connect
2024-05-01 02:50:16     self.connection = self.get_new_connection(conn_params)
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
2024-05-01 02:50:16     return func(*args, **kwargs)
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
2024-05-01 02:50:16     connection = Database.connect(**conn_params)
2024-05-01 02:50:16   File "/usr/local/lib/python3.9/site-packages/psycopg2/__init__.py", line 122, in connect
2024-05-01 02:50:16     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
2024-05-01 02:50:16 django.db.utils.OperationalError: could not connect to server: Connection refused
2024-05-01 02:50:16     Is the server running on host "localhost" (::1) and accepting
2024-05-01 02:50:16     TCP/IP connections on port 5432?
2024-05-01 02:50:16 could not connect to server: Connection refused
2024-05-01 02:50:16     Is the server running on host "localhost" (127.0.0.1) and accepting
2024-05-01 02:50:16     TCP/IP connections on port 5432?

Steps to reproduce the problem

The steps as per the steps here https://docs.saleor.io/docs/3.x/setup/docker-compose

What did you expect to happen?

Install Saleor and get a working Saleor install at the localhost:8000 or whatever port used

Logs

OperationalError at /
could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
Request Method: GET
Request URL: http://localhost:8080/
Django Version: 3.2.7
Exception Type: OperationalError
Exception Value:
could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
Exception Location: /usr/local/lib/python3.9/site-packages/psycopg2/init.py, line 122, in connect
Python Executable: /usr/local/bin/python
Python Version: 3.9.7
Python Path:
['/app',
'/app',
'/usr/local/bin',
'/usr/local/lib/python39.zip',
'/usr/local/lib/python3.9',
'/usr/local/lib/python3.9/lib-dynload',
'/usr/local/lib/python3.9/site-packages']
Server time: Wed, 01 May 2024 01:50:16 +0000

2024-05-01 02:50:16 ERROR django.request Internal Server Error: /favicon.ico [PID:9:ThreadPoolExecutor-8_0]
2024-05-01 02:50:16 Traceback (most recent call last):
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
2024-05-01 02:50:16 self.connect()
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
2024-05-01 02:50:16 return func(*args, **kwargs)
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 200, in connect
2024-05-01 02:50:16 self.connection = self.get_new_connection(conn_params)
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
2024-05-01 02:50:16 return func(*args, **kwargs)
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
2024-05-01 02:50:16 connection = Database.connect(**conn_params)
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/psycopg2/init.py", line 122, in connect
2024-05-01 02:50:16 conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
2024-05-01 02:50:16 psycopg2.OperationalError: could not connect to server: Connection refused
2024-05-01 02:50:16 Is the server running on host "localhost" (::1) and accepting
2024-05-01 02:50:16 TCP/IP connections on port 5432?
2024-05-01 02:50:16 could not connect to server: Connection refused
2024-05-01 02:50:16 Is the server running on host "localhost" (127.0.0.1) and accepting
2024-05-01 02:50:16 TCP/IP connections on port 5432?
2024-05-01 02:50:16
2024-05-01 02:50:16
2024-05-01 02:50:16 The above exception was the direct cause of the following exception:
2024-05-01 02:50:16
2024-05-01 02:50:16 Traceback (most recent call last):
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/asgiref/sync.py", line 482, in thread_handler
2024-05-01 02:50:16 raise exc_info[1]
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 38, in inner
2024-05-01 02:50:16 response = await get_response(request)
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 263, in _get_response_async
2024-05-01 02:50:16 response = await sync_to_async(response.render, thread_sensitive=True)()
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/asgiref/sync.py", line 444, in call
2024-05-01 02:50:16 ret = await asyncio.wait_for(future, timeout=None)
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/asyncio/tasks.py", line 442, in wait_for
2024-05-01 02:50:16 return await fut
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/asgiref/current_thread_executor.py", line 22, in run
2024-05-01 02:50:16 result = self.fn(*self.args, **self.kwargs)
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/asgiref/sync.py", line 486, in thread_handler
2024-05-01 02:50:16 return func(*args, **kwargs)
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/template/response.py", line 105, in render
2024-05-01 02:50:16 self.content = self.rendered_content
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/template/response.py", line 83, in rendered_content
2024-05-01 02:50:16 return template.render(context, self._request)
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/template/backends/django.py", line 61, in render
2024-05-01 02:50:16 return self.template.render(context)
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 168, in render
2024-05-01 02:50:16 with context.bind_template(self):
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/contextlib.py", line 119, in enter
2024-05-01 02:50:16 return next(self.gen)
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/debug_toolbar/panels/templates/panel.py", line 46, in _request_context_bind_template
2024-05-01 02:50:16 context = processor(self.request)
2024-05-01 02:50:16 File "/app/saleor/site/context_processors.py", line 13, in site
2024-05-01 02:50:16 site = get_current_site(request)
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/contrib/sites/shortcuts.py", line 13, in get_current_site
2024-05-01 02:50:16 return Site.objects.get_current(request)
2024-05-01 02:50:16 File "/app/saleor/site/patch_sites.py", line 25, in new_get_current
2024-05-01 02:50:16 site = self.prefetch_related("settings").filter(pk=site_id)[0]
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 317, in getitem
2024-05-01 02:50:16 qs._fetch_all()
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 1324, in _fetch_all
2024-05-01 02:50:16 self._result_cache = list(self._iterable_class(self))
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 51, in iter
2024-05-01 02:50:16 results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1173, in execute_sql
2024-05-01 02:50:16 cursor = self.connection.cursor()
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
2024-05-01 02:50:16 return func(*args, **kwargs)
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 259, in cursor
2024-05-01 02:50:16 return self._cursor()
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 235, in _cursor
2024-05-01 02:50:16 self.ensure_connection()
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
2024-05-01 02:50:16 return func(*args, **kwargs)
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
2024-05-01 02:50:16 self.connect()
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 90, in exit
2024-05-01 02:50:16 raise dj_exc_value.with_traceback(traceback) from exc_value
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
2024-05-01 02:50:16 self.connect()
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
2024-05-01 02:50:16 return func(*args, **kwargs)
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 200, in connect
2024-05-01 02:50:16 self.connection = self.get_new_connection(conn_params)
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
2024-05-01 02:50:16 return func(*args, **kwargs)
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
2024-05-01 02:50:16 connection = Database.connect(**conn_params)
2024-05-01 02:50:16 File "/usr/local/lib/python3.9/site-packages/psycopg2/init.py", line 122, in connect
2024-05-01 02:50:16 conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
2024-05-01 02:50:16 django.db.utils.OperationalError: could not connect to server: Connection refused
2024-05-01 02:50:16 Is the server running on host "localhost" (::1) and accepting
2024-05-01 02:50:16 TCP/IP connections on port 5432?
2024-05-01 02:50:16 could not connect to server: Connection refused
2024-05-01 02:50:16 Is the server running on host "localhost" (127.0.0.1) and accepting
2024-05-01 02:50:16 TCP/IP connections on port 5432?

Environment

  • Docker Desktop 4.29.0 (145265)
  • ghcr.io/saleor/saleor:3.19.29
  • Mac Sanoma 14.4.1
@amityweb
Copy link
Author

amityweb commented May 5, 2024

Following on from this...

I think its working for me OK when I use Saleor Platform, and I expected something visible to happen when I typed "docker compose build" but nothing did. But if I proceed with the instructions it seems work then. I guess the issue above was I was only using Saleor Core but expected the database to be setup inside also? Maybe its not.

Although its working, during the build there are more errors now. Issues with the database tables?

worker-1     | 2024-05-05 12:03:50,095 INFO celery.beat beat: Starting... [PID:23:MainThread]
db-1         | 2024-05-05 12:03:50.922 UTC [60] ERROR:  relation "discount_promotion" does not exist at character 436
db-1         | 2024-05-05 12:03:50.922 UTC [60] STATEMENT:  SELECT "discount_promotion"."private_metadata", "discount_promotion"."metadata", "discount_promotion"."id", "discount_promotion"."name", "discount_promotion"."type", "discount_promotion"."description", "discount_promotion"."old_sale_id", "discount_promotion"."start_date", "discount_promotion"."end_date", "discount_promotion"."created_at", "discount_promotion"."updated_at", "discount_promotion"."last_notification_scheduled_at" FROM "discount_promotion" WHERE ((("discount_promotion"."last_notification_scheduled_at" IS NULL OR "discount_promotion"."last_notification_scheduled_at" < "discount_promotion"."start_date") AND "discount_promotion"."start_date" <= '2024-05-05T12:03:50.890496+00:00'::timestamptz) OR (("discount_promotion"."last_notification_scheduled_at" IS NULL OR "discount_promotion"."last_notification_scheduled_at" < "discount_promotion"."end_date") AND "discount_promotion"."end_date" <= '2024-05-05T12:03:50.892480+00:00'::timestamptz)) ORDER BY "discount_promotion"."name" ASC, "discount_promotion"."id" ASC
worker-1     | Process Beat:
worker-1     | Traceback (most recent call last):
worker-1     |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
worker-1     |     return self.cursor.execute(sql, params)
worker-1     | psycopg2.errors.UndefinedTable: relation "discount_promotion" does not exist
worker-1     | LINE 1: ..._promotion"."last_notification_scheduled_at" FROM "discount_...
worker-1     |                                                              ^
worker-1     | 
worker-1     | 
worker-1     | The above exception was the direct cause of the following exception:
worker-1     | 
worker-1     | Traceback (most recent call last):
worker-1     |   File "/usr/local/lib/python3.9/site-packages/billiard/process.py", line 323, in _bootstrap
worker-1     |     self.run()
worker-1     |   File "/usr/local/lib/python3.9/site-packages/celery/beat.py", line 718, in run
worker-1     |     self.service.start(embedded_process=True)
worker-1     |   File "/usr/local/lib/python3.9/site-packages/celery/beat.py", line 643, in start
worker-1     |     interval = self.scheduler.tick()
worker-1     |   File "/usr/local/lib/python3.9/site-packages/celery/beat.py", line 339, in tick
worker-1     |     self.populate_heap()
worker-1     |   File "/usr/local/lib/python3.9/site-packages/celery/beat.py", line 313, in populate_heap
worker-1     |     is_due, next_call_delay = entry.is_due()
worker-1     |   File "/usr/local/lib/python3.9/site-packages/celery/beat.py", line 161, in is_due
worker-1     |     return self.schedule.is_due(self.last_run_at)
worker-1     |   File "/app/saleor/core/schedules.py", line 80, in is_due
worker-1     |     if len(staring_promotions | ending_promotions) > PROMOTION_TOGGLE_BATCH_SIZE:
worker-1     |   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 262, in __len__
worker-1     |     self._fetch_all()
worker-1     |   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 1324, in _fetch_all
worker-1     |     self._result_cache = list(self._iterable_class(self))
worker-1     |   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 51, in __iter__
worker-1     |     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
worker-1     |   File "/usr/local/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
worker-1     |     cursor.execute(sql, params)
worker-1     |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 98, in execute
worker-1     |     return super().execute(sql, params)
worker-1     |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute
worker-1     |     return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
worker-1     |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
worker-1     |     return executor(sql, params, many, context)
worker-1     |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
worker-1     |     return self.cursor.execute(sql, params)
worker-1     |   File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
worker-1     |     raise dj_exc_value.with_traceback(traceback) from exc_value
worker-1     |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
worker-1     |     return self.cursor.execute(sql, params)
worker-1     | django.db.utils.ProgrammingError: relation "discount_promotion" does not exist
worker-1     | LINE 1: ..._promotion"."last_notification_scheduled_at" FROM "discount_...
worker-1     |                                                              ^
worker-1     | 
worker-1     | 2024-05-05 12:03:52,025 WARNING py.warnings /usr/local/lib/python3.9/site-packages/celery/worker/consumer/consumer.py:507: CPendingDeprecationWarning: The broker_connection_retry configuration setting will no longer determine
worker-1     | whether broker connection retries are made during startup in Celery 6.0 and above.
worker-1     | If you wish to retain the existing behavior for retrying connections on startup,
worker-1     | you should set broker_connection_retry_on_startup to True.
worker-1     |   warnings.warn(
worker-1     |  [PID:1:MainThread]
worker-1     | 2024-05-05 12:03:52,047 INFO celery.worker.consumer.connection Connected to redis://redis:6379/1 [PID:1:MainThread]
worker-1     | 2024-05-05 12:03:52,048 WARNING py.warnings /usr/local/lib/python3.9/site-packages/celery/worker/consumer/consumer.py:507: CPendingDeprecationWarning: The broker_connection_retry configuration setting will no longer determine
worker-1     | whether broker connection retries are made during startup in Celery 6.0 and above.
worker-1     | If you wish to retain the existing behavior for retrying connections on startup,
worker-1     | you should set broker_connection_retry_on_startup to True.
worker-1     |   warnings.warn(
worker-1     |  [PID:1:MainThread]
worker-1     | 2024-05-05 12:03:52,051 INFO celery.worker.consumer.mingle mingle: searching for neighbors [PID:1:MainThread]
worker-1     | 2024-05-05 12:03:53,063 INFO celery.worker.consumer.mingle mingle: all alone [PID:1:MainThread]
worker-1     | 2024-05-05 12:03:53,096 INFO celery.apps.worker celery@a66f6388d5de ready. [PID:1:MainThread]

@amityweb
Copy link
Author

We've abandoned Saleor now. I'm a web developer and its crazy the amount of time I spent trying to fix issues, or figure out the correct documentation etc. I switched to something else in a couple of days and all works fine now so I can get onto actually building the website.

@faizan2700
Copy link

  1. When you are using docker compose it is kind of expected that it iwll have mulitple containers including different one for db and different one for other services including web api, redis and everything. You can definitely configure this setup using dockerfile but for that you will have to do little bit of setup of setup for database, by default docker allows container to communicate with localhost, other than that you will have to take care of migrations (may be write entrypoint.sh file and run it once container is started to run migrations)

  2. In above setup where you have ran docker-compose, it is giving error that particular relation does not exists, it is because you have not run migrations. once run the command:
    docker-compose run --rm api python3 manage.py migrate
    It will run all the migrations to the database and now your saleor will start to work on port localhost:9000
    Optionally you can also populate database using this command:
    docker-compose run --rm api python3 manage.py populatedb

Works fine for me.

@amityweb
Copy link
Author

Dont want to waste any more time setting something up that has so many issues when other systems exist that do the exact same thing.

@mirekm
Copy link
Member

mirekm commented Jun 11, 2024

@faizan2700, thanks for providing your support!

@amityweb Thanks for the feedback; we will continue making our Docker setup bullet-proof and effortless for local Saleor development. There are systems with a lower entry threshold, for sure, and if you don't really aim for tech-agnostic, API-based extensibility, and your use case is fairly regular, Saleor may not be the first choice. In any case, keep us posted if you continue exploring it.

@amityweb
Copy link
Author

amityweb commented Jun 11, 2024

What does "lower entry threshold" even mean?! You mean systems that are easier to deply?

What does "tech-agnostic, API-based extensibility" even mean? You mean less technical than other systems, and that has an API? That statement is not true.

If using impressive non-layman terms gets companies to sign up to your expensive monthly fee then good on you! But ultimately, all the features Saleor has, can be done in many other common eCommerce systems. We need a backend solution for customers to take orders of products on a website. It must have standard features like stock control, variation's etc. Due to Saleor being such a PITA to setup, and the fact it is a backend system that no end user sees, and because we just need to build the website and not faff about with making systems work and struggling with documentation, we switched to WooCommerce for now nd it just works out of the box. I'd rather use something else but we can switch again in the future, but only to something that can be setup in an hour or two, not days or weeks. Customers dont really care what systems they use, as long as it works. Developers want something easy to build.

Thank you.

@mirekm
Copy link
Member

mirekm commented Jun 11, 2024

What does "lower entry threshold" even mean?! You mean systems that are easier to deploy?

It would be great to know if you encountered issues with the database migrations (as Faizan suggested above) or if there was something else that posed a challenge.

What does "tech-agnostic, API-based extensibility" even mean? You mean less technical than other systems, and that has an API? That statement is not true.

I'm not sure which statement you're referring to as untrue. What we mean by "tech-agnostic, API-based extensibility" is that Saleor allows you to extend its capabilities and execution flows using publicly available APIs in any language and stack of your choice, rather than relying on a plugin architecture. You can read more about the benefits (and disadvantages) of this approach here: Benefits of extending commerce via API over plugins

If using impressive non-layman terms gets companies to sign up to your expensive monthly fee then good on you!

I understand some things may look like unnecessary jargon. We use the term internally to differentiate our extensibility model (more in the link above). Anyway, feedback taken.

Saleor is fully open source. Companies (and individuals) use it for free and without limitation whenever and however they want. We don't discriminate between our open source API and Cloud version. Organizations can choose what works best for them: either investing in their own operations or opting for our Cloud service to focus on their customers instead of platform maintenance and reliability. In the case of Saleor, the evaluation is typically done by larger technical teams, and I believe marketing plays a minimal role in their decision.

But ultimately, all the features Saleor has, can be done in many other common eCommerce systems. We need a backend solution for customers to take orders of products on a website. It must have standard features like stock control, variation's etc.

That’s most probably true. Most features found in Saleor can be implemented in other ecommerce systems as well, just as they have been in the past. While we aim for Saleor to be the best choice for development teams dealing with all sorts of commerce complexities, we always advocate for finding the best fit for your specific requirements. E-commerce companies differ greatly in complexity and needs.

@amityweb
Copy link
Author

amityweb commented Jun 11, 2024

About "tech-agnostic, API-based extensibility" not being true, sorry I should have explained more. The statement implies if you want that then you use Saleor. But what I mean is, other systems have that too. Including "any language and stack of your choice, rather than relying on a plugin architecture". So its "untrue" to claim you use Saleor if you need a "tech-agnostic, API-based extensibility" system. I am using WooCommerce and use its API which allows me to build a website in Next.js. Its API and documentation and support is far better than Saleors!

I would have used Saleor if the installation and documentation was straight forward, but its not. I am not interested in wasting all the setup time, when I can have another system installed and working within an hour, and have the same features. If you want to expand your customer base you need to sort that out. My customer is a very large international agency and maybe we could have switched to your paid version but I told them to abandon Saleor because its too difficult to work with and provides no added benefits to other systems. Ultimately we have the same functionality now without Saleor.

I have had other issues, I have posted other GitHub topics and requested support over the past year or so on a couple of places, but no replies come, so support is also not good. I am using the free version not paid one, but if a company release a free/community one I expect them to support it and have good documentation, otherwise just dont provide it.

@amityweb
Copy link
Author

By the way, we did start with Saleor over a year ago, when the deploy process was via GitHub to Heroku. That just worked. I now have all these issues since your switch to Docker. So we switched eCommerce system and I just needed to update all my GraphQL queries to get data from elsewhere. Now I dont have the headaches of Docker.

@mirekm
Copy link
Member

mirekm commented Jun 11, 2024

Thank you for the additional context!

On the extensibility model – we don't mean API and async webhooks only. It's true that creating a storefront with Next.js should be possible with nearly any e-commerce API. This part is not always straightforward, but all you need is an API from which you can pull your data, plus all the basic cart and checkout mutations. By extensibility, in a nutshell, we mean the number of standard execution flows that you can influence in Saleor with our sync webhooks: Payment events, Shipping events, Tax events, Transaction events, Stored payment method events. This enables developers to plug into all standard execution flows in Saleor.

This approach is crucial when you need to integrate and stitch together various systems, such as third-party SaaS solutions (PIM, ERP, OMS, etc.), custom back-office applications, and other services in your e-commerce operation.

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

No branches or pull requests

3 participants