lando / lando

A development tool for all your projects that is fast, easy, powerful and liberating
https://lando.dev
GNU General Public License v3.0
4.03k stars 541 forks source link

Error from invalid YAML in lando.yml doesn't indicate invalid lando.yml is to blame. #457

Closed Shelob9 closed 6 years ago

Shelob9 commented 6 years ago

The more steps you complete the more likely we are to address your issue!

  1. Make lando.yml improper syntax
  2. Run lando rebuild or something.
  3. See a bunch of node errors.

Bug Report

What is your lando version and operating system? 3.0.0-beta.22 on Ubuntu

Tell us about your .lando.yml

Paste in the contents of your .lando.yml this is SUPER HELPFUL for us.

Example:

name: lamp2
recipe: lamp
config:
  php: '5.6'
  webroot: www
  database: mysql
  xdebug: true
  conf:
    server: config/lamp.conf
    database: config/mysql
    php: config/php.ini

It is also helpful to include other relevant config files. For example, include pantheon.yml for a pantheon recipe if applicable. Include php.ini or mysql.cnf if you are overriding our defualt config.

Tell us about the command you were running

Paste in a series of commands that caused the bug.

Example:

lando init mysite --recipe lamp --webroot web
lando start
# Edited my lando.yml as above
lando rebuild -y

Tell us about the error you got

error:  TypeError: Cannot read property 'split' of undefined
    at Object.build (/snapshot/cli/plugins/lando-services/lib/services.js:257:23)
    at /snapshot/cli/plugins/lando-services/lib/config.js:29:41
    at isBind (/snapshot/cli/node_modules/lodash/lodash.js:4944:15)
    at baseForOwn (/snapshot/cli/node_modules/lodash/lodash.js:3001:24)
    at index (/snapshot/cli/node_modules/lodash/lodash.js:4913:18)
    at Function.forEach (/snapshot/cli/node_modules/lodash/lodash.js:9359:14)
    at AsyncEvents.<anonymous> (/snapshot/cli/plugins/lando-services/lib/config.js:21:9)
    at AsyncEvents.handle (/snapshot/cli/lib/events.js:109:19)
    at /snapshot/cli/lib/events.js:170:19
    at runCallback (timers.js:800:20)
    at tryOnImmediate (timers.js:762:5)
From previous event:
    at AsyncEvents.emit (/snapshot/cli/lib/events.js:161:18)
    at /snapshot/cli/lib/app.js:156:25
From previous event:
    at instantiate (/snapshot/cli/lib/app.js:155:4)
    at /snapshot/cli/lib/app.js:340:16
From previous event:
    at Object.exports.get (/snapshot/cli/lib/app.js:324:4)
    at AsyncEvents.<anonymous> (/snapshot/cli/plugins/lando-tooling/lib/bootstrap.js:33:22)
    at AsyncEvents.handle (/snapshot/cli/lib/events.js:109:19)
    at /snapshot/cli/lib/events.js:170:19
From previous event:
    at AsyncEvents.emit (/snapshot/cli/lib/events.js:161:18)
    at /snapshot/cli/lib/bootstrap.js:125:25
    at runCallback (timers.js:800:20)
    at tryOnImmediate (timers.js:762:5)
    at processImmediate [as _immediateCallback] (timers.js:733:5)
From previous event:
    at /snapshot/cli/lib/bootstrap.js:123:4
    at bitmask (/snapshot/cli/node_modules/lodash/lodash.js:10067:25)
    at Object.<anonymous> (/snapshot/cli/bin/lando.js:17:1)
    at Module._compile (pkg/prelude/bootstrap.js:1226:22)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Function.Module.runMain (pkg/prelude/bootstrap.js:1281:12)
    at startup (bootstrap_node.js:200:16)
    at bootstrap_node.js:617:3

Tell us generally about your bug

I think "Your lando.yml" is invalid would have been more useful. Maybe a --verbose flag would allow this output.

Tell us more

Could better documentation have prevented this issue? if so what should we change?

No, I was just cutting and pasting it wrong :)

Does this bug prevent you from using lando?

Nope, I fixed it.

pirog commented 6 years ago

@Shelob9 are you sure that is the offending yaml file? because it definitely passes http://www.yamllint.com/ and is reported as a valid yaml file.

Also worth pointing out that there are multiple verbose flags that you can use. Your usage appears to be incorrect. https://docs.devwithlando.io/cli/usage.html#global-options

pirog commented 6 years ago

@Shelob9 so when i use an invalid yaml file i actually get pretty decent feedback

warn: Problem parsing /Users/pirog/Desktop/work/lando/examples/lamp/.lando.yml with bad indentation of a mapping entry at line 57, column 3:
      database:

although im going to change this from a warning to an error.

If you figure out the actual reason you got that error, with steps to replicate, def open up a new ticket