No products when starting a project
Description
First of all thank you for the effort by making Magento run on M1 + Docker. I'm not quite sure if it's some misconfiguration from my side but when installing sample data and starting the project with bin/start the products are not visible until bin/magento indexer:reindex is executed.
Steps To Reproduce
- Create a new project by following the (manual setup)
- Install Magento sample data
- Run
bin/magento indexer:reindex - Check some category on https://magento.test (products should be visible)
- Stop the project with
bin/stop - Start the project again with
bin/start - Check some category on https://magento.test (products are not visible)
Expected Result Products should be visible after stopping and then starting the project.
Actual Result
bin/magento indexer:reindex is required each time after starting the project.
This is really odd, and I'm unable to replicate this. I'll leave it open for a bit to see if anyone else is able to replicate, but everything is working fine for me.
Hi :)
First of all, thanks for your great docker configurations :)
I'm also facing the same issue, I have to reindex at every restart of my containers.
What operating system is everyone running? Normal setup with Docker Desktop?
Yup, clean install: MacOs 12.3.1 and Docker Desktop 20.10.14.
On my side I'm using Ubuntu 21.10 but using Docker Engine, not Docker Desktop.
I can replicate only if I remove all containers before start them again: .. 5. Stop the project with bin/stop Remove all containers with bin/remove 6. Start the project again with bin/start 7. Check some category on https://magento.test/ (products are not visible)
then need to reindex to see products in category
Ubuntu 22.04 Docker version 20.10.12
Thanks @mnieznanski -- that could lead us to clues as to what is happening for others.
To the others having these issues, are you doing anything other than stopping & starting the containers? Once you have all of the products indexed, if you run bin/restart, do they need to be indexed again?
Hi @markshust , that's really weird, I didn't get that bug since I first commented this post, so I've just tested it with the following order:
bin/startbin/restart=> no more productsbin/magento indexer:reindexbin/stopbin/start=> no more products neither
What's weird is that I've worked on that project for more than two weeks now and this is the first time that the bugs shows up again :sweat:
EDIT : I think I found a way to reproduce it!
I used a docker-compose logs --follow elasticsearch command and I noticed that after waiting for a few seconds, even if everything shows up as "Started", I get new logs that keep popping up and once they're done, the indexes are back up.
In a nutshell, it's just a question of patience :sweat_smile: Although I don't understand why...
If you're interested, I attached the logs that pops up after the start command.
Hi all, I also have a similar issue. Every time I restart the containers for a project, all the indexed data in Elasticsearch is deleted and I have to reindex it after every restart. I am currently on Arch Linux, with the following Docker version:
Client:
Version: 24.0.5
API version: 1.43
Go version: go1.20.6
Git commit: ced0996600
Built: Wed Jul 26 21:44:58 2023
OS/Arch: linux/amd64
Context: default
Server:
Engine:
Version: 24.0.5
API version: 1.43 (minimum version 1.12)
Go version: go1.20.6
Git commit: a61e2b4c9c
Built: Wed Jul 26 21:44:58 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.7.5
GitCommit: fe457eb99ac0e27b3ce638175ef8e68a7d2bc373.m
runc:
Version: 1.1.9
GitCommit:
docker-init:
Version: 0.19.0
GitCommit: de40ad0
and
Docker Compose version 2.20.3
Maybe it is something related to the recent versions of Docker.
I've managed to bypass this issue by adding the --no-recreate flag to the docker compose command, in the bin/start script. (this flag introduces some side issues, so you have to remember you added it if you want to upgrade your containers).