Reaction Commerce Forums

Containers running but not showing in browser

I have reaction-platform running some weeks ago but on reinstalling I can no longer get it to work. I would appreciate some help.

When I go to the browser at localhost:4000 or :3000 I get no response with and error ERR_EMPTY_RESPONSE.

I have tried a variety of things, build clean, resetting docker, deleting all files and starting again from blank.

The containers seem to be running:

$ docker ps
CONTAINER ID        IMAGE                             COMMAND                  CREATED             STATUS              PORTS                                                      NAMES
c11a8cf61fcc        example-storefront_web            "tini -- ./.reaction…"   2 minutes ago       Up 2 minutes>4000/tcp                                     example-storefront_web_1
5cf276831419        reaction_reaction                 "bash -c 'time meteo…"   4 minutes ago       Up 3 minutes>3000/tcp,>9229/tcp             reaction_reaction_1
ed370220fb4e        mongo:3.6.3                       "docker-entrypoint.s…"   4 minutes ago       Up 4 minutes>27017/tcp                                   reaction_mongo_1
dded9797b5f5        oryd/hydra:v1.0.0-beta.9-alpine   "hydra serve all --d…"   15 minutes ago      Up 15 minutes>4444-4445/tcp,>5555/tcp   reaction-hydra_hydra_1
0b2b7d34ad52        postgres:10.3                     "docker-entrypoint.s…"   15 minutes ago      Up 15 minutes>5432/tcp                                    reaction-hydra_postgres_1

Although they appear to have different COMMAND values to that in the instructions.

These are the networks:

$ docker network ls
NETWORK ID          NAME                         DRIVER              SCOPE
ff880280ad0b        api.reaction.localhost       bridge              local
60dd0c68f3e2        auth.reaction.localhost      bridge              local
3e7b397c6b55        bridge                       bridge              local
7ddaa4817c64        host                         host                local
f38a355c22b1        none                         null                local
8299836b47fc        reaction-hydra_default       bridge              local
0e08c64fe88e        reaction_default             bridge              local
96bf5e57aafa        streams.reaction.localhost   bridge              local

The log in Reaction is too long to paste unless you need it. There is a bunch of reaction_1 lines of initialising followed some mongo_1 lines

The log in example-storefront shows it exited with and error:

web_1  | aborting instead of chowning to root.
web_1  | Found owner 0:0 on /usr/local/src/app.
web_1  | Installing dependencies...
web_1  | (Using Yarn because there is a yarn.lock file)
web_1  | yarn install v1.17.3
web_1  | [1/4] Resolving packages...
web_1  | [2/4] Fetching packages...
web_1  | info There appears to be trouble with your network connection. Retrying...
web_1  | info There appears to be trouble with your network connection. Retrying...
web_1  | info There appears to be trouble with your network connection. Retrying...
web_1  | info There appears to be trouble with your network connection. Retrying...
web_1  | info There appears to be trouble with your network connection. Retrying...
web_1  | error An unexpected error occurred: " ESOCKETTIMEDOUT".
web_1  | info If you think this is a bug, please open a bug report with the information provided in "/usr/local/src/app/yarn-error.log".
web_1  | info Visit for documentation about this command.
example-storefront_web_1 exited with code 1 

The hydra log shows a bunch of postgres_1, hydra-migrate_1 and hydra_1 lines that all seam ok.

Can anybody help me identify what my problem is?

Appreciate any help

Hi @Vortus, welcome to the Reaction Commerce community!

Can you please post the logs of the backend by doing a docker logs -f reaction_reaction_1? Only the last 10 lines or so will be enough.

Regarding your Yarn networking issue, I know this won’t be of any help, but I’ve already witnessed the same issue and it went away on its own after a day or so. I had also tried everything I could at the time but to no avail. Unfortunately, the issue filed on Yarn’s GitHub repo is filled of people just like you trying a bunch of different tricks but with no real solution.

1 Like

Thanks @loanlaux for your help.

I came into the office this morning and refreshed the browsers and lh:3000 loaded. The storefront still didn’t load. Nothing had changed apart from leaving the containers open over night.

I added --network-timeout 100000 as suggested in the thread recommend by @loanlaux to the two yarn lines in the storefront dockerfile and used Make again to try to get the storefront up.

It appears that the yarn problem is now fixed based on the logs.

lh:3000 wont load again now and the storefront log is showing it can not reach lh:3000.

After noticing that the lh:3000 loaded after leaving it overnight I also realised that my laptop fan was running hard after the Make process had finished. I checked out the processes.

The docker install appeared to be finished in the terminal and I was given the prompt back but com.docker.hyperkit was drawing 11.96GB memory and 457%CPU and as I write this I notice that the reaction log is still occasionally spewing out lines.

I have waited about an hour since the Make appeared to finish and both lh:3000 and lh:4000 now load.

It appears that everything is working correctly except when I log into the storefront I get an OAuth error InvalidClient which I guess is my project for today.

It doesn’t feel like this is normal behaviour but something happened.

Quite strange indeed. But glad the issues are now solved!

Regarding the OAuth error, I don’t know enough about your specific setup to provide any precise advice… But I can tell you to make sure the ./bin/create-hydra-client.js script is ran in the storefront container. By default, it should be as it’s in example-storefront/bin/start, but you never know.

If it is ran, try to look at the logs it prints (i.e. anything after Creating hydra client… and before Next.js starts up). Lastly, maybe try to run the script separately (you’ll need to set the OAUTH2_* env variables manually) and see what you’re getting out of that.

But this is weird. The client registration should be done without an issue out of the box. You shouldn’t have to struggle with that.

Once again, thanks @loanlaux

The hydra client did not appear to run in the storefront container. I ran the script manually and it told me it did not have access to port 4555.

Its obvious to me that there is some massive memory leak or something going on. Whenever I have the containers started my computer is so slow I have to wait for letters to appear on my screen when I type.

It is a 2012 macbook Pro retina 8gb ram. L

I have been playing around a lot and I am pretty novice so I don’t know what I may have installed stupidly. I decided to do a clean install of my os. I want to make sure what I am experiencing is from RC rather than me adding things to terminal when I didn’t know what I was doing.

Probably not useful to somebody else reading this unless my problems persist.

Will update when I see what occurs.

Ok so running clean now.

I have a fresh install with only the requirements to run RC. Things are happening a bit quicker now.

Installed and ran RC it took some time to load. Straight out of the box it did not work again.

I had to add the lines to prevent yarn from timing out and Make again. After 5 min of loading in the background I was able to access the front and back in the browser.

Was still getting the oAuth error when I clicked sign in on the storefront.

There was no Creating hydra client... in the storefront logs.


example-storefront$ docker exec -it example-storefront_web_1  ./bin/create-hydra-client.js
OK: hydra client created


1 Like

@Vortus Glad you got it to work! With version 3.0 coming out very soon, the onboarding process should be even easier/quicker for new projects.

If you’re planning to build custom plugins, I’d advise you to work on the release candidates of 3.0. It may be a bit rough around the edges now, but it’s moving fast and it’ll save you a lot of work with the migration from 2.9.1.