humanmade / altis-local-server

Local Server module for Altis
https://www.altis-dxp.com/resources/docs/local-server/
17 stars 4 forks source link

Misleading error when containers do not start successfully #557

Open kadamwhite opened 1 year ago

kadamwhite commented 1 year ago

If you have a working local environment and some containers do not start properly on composer server start, the error that is shown reads, "WordPress install failed." That is not correct, because we weren't installing WordPress, we were trying to start the containers to run an already-installed WordPress site.

% composer server start
Starting...
[+] Running 1/1
 ⠿ Container altis-proxy  Started                                                                                                                  0.2s
[+] Running 14/14
 ⠿ Container myproject-mailhog    Started       1.0s
 ⠿ Container myproject-tachyon    Started       0.7s
 ⠿ Container myproject-db         Healthy       5.6s
 ⠿ Container myproject-pinpoint   Running       0.0s
 ⠿ Container myproject-redis      Started       0.5s
 ⠿ Container myproject-cognito    Running       0.0s
 ⠿ Container myproject-xray       Started       0.9s
 ⠿ Container myproject-s3         Started       1.0s
 ⠿ Container myproject-es         Healthy       1.6s
 ⠿ Container myproject-kibana     Started       1.1s
 ⠿ Container myproject-php        Started       5.8s
 ⠿ Container myproject-nginx      Started       6.1s
 ⠿ Container myproject-s3-sync    Started       0.0s
 ⠿ Container myproject-cavalcade  Started       0.0s
WordPress install failed. Exited with error code 255

I would expect the error in this situation would be "Local Server failed to initialize properly." or "Failed to start, try running composer server start again." There is a chance (albeit small) that somebody would see the above error and think they needed to remove their DB or take some other destructive action to try to "reset" the environment and reinstall WP, when that should usually not be necessary.

jerico commented 1 year ago

The error is checking for a WordPress install by running a wp-cli command.

I'm thinking this is not just a change of error message, it's more of adding additional checks if the nginx/php container ran successfully.

veselala commented 1 year ago

Try and troubleshoot, it could be some of the services that it's not ready and we need to add some more additional checks in there.