docker-magento icon indicating copy to clipboard operation
docker-magento copied to clipboard

No products when starting a project

Open g5wx opened this issue 3 years ago • 9 comments

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

  1. Create a new project by following the (manual setup)
  2. Install Magento sample data
  3. Run bin/magento indexer:reindex
  4. Check some category on https://magento.test (products should be visible)
  5. Stop the project with bin/stop
  6. Start the project again with bin/start
  7. 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.

g5wx avatar Apr 02 '22 15:04 g5wx

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.

markshust avatar Apr 12 '22 16:04 markshust

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.

Axel29 avatar May 26 '22 16:05 Axel29

What operating system is everyone running? Normal setup with Docker Desktop?

markshust avatar May 27 '22 02:05 markshust

Yup, clean install: MacOs 12.3.1 and Docker Desktop 20.10.14.

g5wx avatar May 28 '22 10:05 g5wx

On my side I'm using Ubuntu 21.10 but using Docker Engine, not Docker Desktop.

Axel29 avatar May 28 '22 21:05 Axel29

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

mnieznanski avatar Jun 10 '22 16:06 mnieznanski

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?

markshust avatar Jun 13 '22 19:06 markshust

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/start
  • bin/restart => no more products
  • bin/magento indexer:reindex
  • bin/stop
  • bin/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.

elasticsearch-logs.txt

Axel29 avatar Jun 13 '22 21:06 Axel29

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).

enalettoWalit avatar Sep 07 '23 09:09 enalettoWalit