lando / platformsh

The Official Platform.sh Lando Plugin
https://docs.lando.dev/platformsh
GNU General Public License v3.0
6 stars 4 forks source link

Error on build at /snapshot/cli/lib/shell.js #22

Closed gabrovex closed 2 years ago

gabrovex commented 2 years ago

Using lando v3.4.1 on Linux Mint 18.2 because on the last version (>=v3.4.2) im experiencing this error. recipe: platformsh.

Error on lando rebuild:

Rising anew like a fire phoenix from the ashes! Rebuilding app...
No stopped containers
Pulling cacheredis ... done
Pulling surveylab  ... done
Pulling mysql      ... done
surveylab uses an image, skipping
cacheredis uses an image, skipping
mysql uses an image, skipping
Recreating landoproxyhyperion5000gandalfedition_proxy_1 ... done
ERROR ==> You cannot assign url testlando.lndo.site/:80 to more than one service! 
Creating network "testlando_default" with the default driver
Creating volume "testlando_data_surveylab" with default driver
Creating volume "testlando_home_surveylab" with default driver
Creating volume "testlando_data_mysql" with default driver
Creating volume "testlando_home_mysql" with default driver
Creating volume "testlando_data_cacheredis" with default driver
Creating volume "testlando_home_cacheredis" with default driver
Creating testlando_surveylab_1 ... done
ERROR ==>  message=, stack=Error
    at /snapshot/cli/lib/shell.js
From previous event:
    at Shell.sh (/snapshot/cli/lib/shell.js)
    at Object.dc (/snapshot/cli/lib/bootstrap.js)
    at compose (/snapshot/cli/lib/bootstrap.js)
From previous event:
    at /snapshot/cli/lib/router.js
    at processImmediate (internal/timers.js:464:21)
From previous event:
    at Object.run (/snapshot/cli/lib/router.js)
    at run (/snapshot/cli/lib/engine.js)
    at /snapshot/cli/lib/router.js
From previous event:
    at Object.eventWrapper (/snapshot/cli/lib/router.js)
    at Engine.engineCmd (/snapshot/cli/lib/engine.js)
    at Engine.run (/snapshot/cli/lib/engine.js)
    at Object.runBuild (/snapshot/cli/plugins/lando-services/lib/utils.js)
    at AsyncEvents.<anonymous> (/snapshot/cli/plugins/lando-services/app.js)
    at AsyncEvents.handle (/snapshot/cli/lib/events.js)
    at /snapshot/cli/lib/events.js
From previous event:
    at AsyncEvents.emit (/snapshot/cli/lib/events.js)
From previous event:
    at App.start (/snapshot/cli/lib/app.js)
    at /snapshot/cli/lib/app.js
From previous event:
    at App.rebuild (/snapshot/cli/lib/app.js)
    at Object.run (/snapshot/cli/plugins/lando-core/tasks/rebuild.js)
From previous event:
    at /snapshot/cli/lib/cli.js
From previous event:
    at Object.handler (/snapshot/cli/lib/cli.js)
    at Object.runCommand (/snapshot/cli/node_modules/yargs/lib/command.js:238:44)
    at Object.parseArgs [as _parseArgs] (/snapshot/cli/node_modules/yargs/yargs.js:1063:30)
    at Function.get [as argv] (/snapshot/cli/node_modules/yargs/yargs.js:1004:21)
    at Cli.init (/snapshot/cli/lib/cli.js)
    at Cli.run (/snapshot/cli/lib/cli.js)
From previous event:
    at /snapshot/cli/bin/lando.js
From previous event:
    at Object.<anonymous> (/snapshot/cli/bin/lando.js)
    at Module._compile (pkg/prelude/bootstrap.js:1751:22)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Function.runMain (pkg/prelude/bootstrap.js:1804:12)
    at internal/main/run_main_module.js:17:47, __stackCleaned__=true
Creating testlando_mysql_1      ... done
Creating testlando_cacheredis_1 ... done
Opening platform.sh containers... this may take a bit...
Scanning to determine which services are ready... Please standby...

[2021-10-26 14:35:51.067701] Launching command 'set -e
cd
# Wait a few seconds until DB container is running, otherwise phinx migrate fails on lando
if [ "$PLATFORM_ENVIRONMENT" = "lando" ]; then echo "Sleeping to wait for DB container..."; sleep 15; fi
vendor/bin/phing run-migrations
vendor/bin/phing clear-data
vendor/bin/doctrine orm:generate-proxies
vendor/bin/phing clear-caches
vendor/bin/phing import-project
vendor/bin/phing reset-accounts
'.

Sleeping to wait for DB container...
/bin/dash: 5: vendor/bin/phing: not found

This is our stripped down lando.yaml:

name: testlando
recipe: platformsh

services:
  surveylab:
    # Configure xdebug, see https://docs.lando.dev/config/php.html#configuration
    xdebug: "debug,develop"
    run:
      # Print deploy log, see https://github.com/cloud-solutions/blueprint/issues/583
      - cat /var/log/deploy.log

config:
  id: bftge3smv4qgi
  variables:
    surveylab:
      php:
        # Needed for debugging laminas-cli commands (not working).
        # xdebug.start_with_request: yes
  overrides:
    surveylab:
      runtime:
        extensions:
          - igbinary  # Required by redis, see https://github.com/lando/lando/issues/2788
          - redis
          - xdebug
          # Make xdebug work. Resources:
          # - https://docs.lando.dev/guides/lando-phpstorm.html
          # - https://untoldhq.com/blog/2019/08/02/when-lando-phpstorm-and-xdebug-setup-gets-hairy

env_file:
  - .env
jamac commented 2 years ago

I also ran into this issue yesterday. I've removed and reinstalled lando and docker and ran lando start but I get the following each time.

Digest: sha256:d7f12ed78cc14d488cf41ae5c6946b121e885d0b734847a7c5880556061dff45
Status: Downloaded newer image for devwithlando/php:7.3-fpm-3
Creating school_appserver_1 ...

ERROR: for school_appserver_1  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=300)

ERROR: for appserver  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=300)
ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 300).
ERROR ==>  message=, stack=Error
    at /snapshot/cli/lib/shell.js
From previous event:
    at Shell.sh (/snapshot/cli/lib/shell.js)
    at Object.dc (/snapshot/cli/lib/bootstrap.js)
    at compose (/snapshot/cli/lib/bootstrap.js)
    at /snapshot/cli/lib/router.js

I'm going to try completely obliterating lando and docker (find / -iname "*lando*" -o -iname "*docker*"), reinstall and try running a basic lando init, lando start

MacOS 10.15.7, Intel, Lando 3.4.3

reynoldsalec commented 2 years ago

@jamac that looks like a connectivity issue, perhaps you're unable to connect with Docker Hub for some reason? Could you also confirm that you're having that issue on a Platform.sh recipe?

@gabrovex based on that output, I'm guessing your problem is occurring within custom steps specified in your .platform.app.yaml. Looks like you work with @aimfeld...maybe he has feedback on that?

For both of you I'd suggest joining the Slack community and asking questions there to get support: https://launchpass.com/devwithlando. As far as I can tell these aren't core Lando issues and are probably related to specific factors in your use.

jamac commented 2 years ago

I'm my case platform.sh was not involved.

pirog commented 2 years ago

@jamac AFAICT what you posted is unrelated

gabrovex commented 2 years ago

@reynoldsalec, thanks for answering. Yes, @aimfeld is my colleague. He is experiencing the same issue (and also other colleagues are). We have several project running on platformsh. The old ones created before this issue start appearing (I can't tell you exactly with which lando version, but with the same .platform.app.yaml), are still running and capable to complete a lando rebuild without throwing any error. This is an error that happen just when we try to create a brand new project.

The error you see at the end /bin/dash: 5: vendor/bin/phing: not found is from our .platform.app.yaml deploy hook but it happens because vendor folder is not even created.

markushausammann commented 2 years ago

@reynoldsalec I'd like to just emphasise that we're talking about composer not being able to run, which seems very close to the core of that recipe, composer being the package manager of PHP. Platform.sh doesn't usually answer lando related question, so who actually claims ownership of that recipe?

gabrovex commented 2 years ago

@reynoldsalec why is this issue closed?

reynoldsalec commented 2 years ago

@gabrovex my original assumption was that something is failing in the custom steps specified in your .platform.app.yaml. I know your team has since found that removing the set -e can help some of your builds pass, is that the case with this one?

If you're still interested in this issue you can ping me on the Lando Slack (https://launchpass.com/devwithlando) we can try to figure out steps for replication on this and debug further. I think it might make sense to keep it closed, since if the problem is stemming from the workaround scripts we had to implement to get certs working on the P.sh images, that problem will be resolved once the new P.sh images are compatible with Lando and we can eliminate that hack.

@markushausammann P.sh has been nice enough to sponsor the integration work and the Lando core team has given a shload of time supporting things. P.sh has steadily been getting more involved in helping maintain the integration as use grows; since this integration actually uses P.sh's production images, that help is vital, since the Lando team doesn't have access to the source of the images (it's kind of a black box).

artiswilliams commented 2 years ago

I finally figured it out! This error is caused by .platform/routes.yaml having both https://{default} and http://{default}} routes. This is an old pattern in Platform.sh routes.yaml. Lando's Proxy must be interpreting them as the same and the error causes other issues. Once I fixed this by removing the http://{default} route all the other "strange" issues I had were resolved.

ERROR ==> You cannot assign url <site>.lndo.site/:80 to more than one service!

reynoldsalec commented 2 years ago

Interesting, @gabrovex does the solution @artiswilliams posted work for you?

gabrovex commented 2 years ago

hey @reynoldsalec, the url assignment error always happened, even before when everything worked smoothly, and it's unrelated in my case to the issue i reported. good news is we found out what was the problem. it was related to the node installation on the build hook on our platform.app.yaml. updating that part to what shown on the official platformsh doc solved this issue and the other linked one. now we are running lando 3.5.1.