lando / cli

The cli part of Lando
https://docs.lando.dev/cli
GNU General Public License v3.0
30 stars 33 forks source link

Lando update "Lando cannot write to /usr/local/bin!" #248

Closed CodiAsFox closed 7 months ago

CodiAsFox commented 7 months ago

When running lando update on macOS the update process fails since it cannot write /usr/local/bin to update the cli.

And of course, is not possible to run this using root. Since Lando should never ever be run as root, like ever.

The only way I can do the update is to manually download the cli release and manually copy it to /usr/local/bin after making it executable.

Here's what the debug says:

lando update --debug -v
  lando.js starting 'lando.js' version '3.21.0-beta.2' runtime selector... +0ms
  lando.js merged in additional config source from file '/snapshot/cli/config.yml' +13ms
  lando.js merged in additional config source from file '/Users/tay/.lando/config.yml' +0ms
  lando.js merged in additional config source from 'LANDO_*' envvars with data {} +0ms
  lando.js final assembled minconf is {
  lando.js   configSources: [ '/snapshot/cli/config.yml', '/Users/tay/.lando/config.yml' ],
  lando.js   envPrefix: 'LANDO',
  lando.js   landoFile: '.lando.yml',
  lando.js   preLandoFiles: [
  lando.js     '.lando.base.yml',
  lando.js     '.lando.dist.yml',
  lando.js     '.lando.recipe.yml',
  lando.js     '.lando.upstream.yml'
  lando.js   ],
  lando.js   postLandoFiles: [ '.lando.local.yml', '.lando.user.yml' ],
  lando.js   runtime: 3,
  lando.js   srcRoot: '/snapshot/cli',
  lando.js   userConfRoot: '/Users/tay/.lando',
  lando.js   product: 'lando',
  lando.js   hyperdrive: 'hyperdrive',
  lando.js   channel: 'stable',
  lando.js   domain: 'lndo.site',
  lando.js   mode: 'cli',
  lando.js   stats: [ { report: true, url: 'https://metrics.lando.dev' } ],
  lando.js   scanner: false
  lando.js } +1ms
  lando.js detected an app 'sekure' at '/Users/tay/Git/sekure' +14ms
  lando.js using '@lando/core' runtime version 3 +1ms
  lando.js starting lando with 'v3' runtime using cli { ENVPREFIX: undefined, LOGLEVELCONSOLE: 4, USERCONFROOT: undefined, COREBASE: '/Users/tay/.lando/plugins/@lando/core' } +10ms
Generating plugin/cli update matrix... done [see table below]

 PACKAGE              STATUS             COMMENT
 ──────────────────── ────────────────── ────────────────────────────────────────────────────────
 @lando/acquia        ✔ Up to date       All good
 @lando/apache        ✔ Up to date       All good
 @lando/backdrop      ✔ Up to date       All good
 @lando/cli           ⚠ Update available https://github.com/lando/cli/releases/tag/v3.21.0-beta.7
 @lando/compose       ✔ Up to date       All good
 @lando/core          ✔ Up to date       All good
 @lando/dotnet        ✔ Up to date       All good
 @lando/drupal        ✔ Up to date       All good
 @lando/elasticsearch ✔ Up to date       All good
 @lando/go            ✔ Up to date       All good
 @lando/healthcheck   ✔ Up to date       All good
 @lando/joomla        ✔ Up to date       All good
 @lando/lagoon        ✔ Up to date       All good
 @lando/lamp          ✔ Up to date       All good
 @lando/laravel       ✔ Up to date       All good
 @lando/lemp          ✔ Up to date       All good
 @lando/mailhog       ✔ Up to date       All good
 @lando/mariadb       ✔ Up to date       All good
 @lando/mean          ✔ Up to date       All good
 @lando/memcached     ✔ Up to date       All good
 @lando/mongo         ✔ Up to date       All good
 @lando/mssql         ✔ Up to date       All good
 @lando/mysql         ✔ Up to date       All good
 @lando/networking    ✔ Up to date       All good
 @lando/nginx         ✔ Up to date       All good
 @lando/node          ✔ Up to date       All good
 @lando/pantheon      ✔ Up to date       All good
 @lando/php           ✔ Up to date       All good
 @lando/phpmyadmin    ✔ Up to date       All good
 @lando/platformsh    ⚠ Cannot update
 @lando/postgres      ⚠ Cannot update
 @lando/proxy         ✔ Up to date       All good
 @lando/python        ✔ Up to date       All good
 @lando/redis         ✔ Up to date       All good
 @lando/ruby          ✔ Up to date       All good
 @lando/scanner       ✔ Up to date       All good
 @lando/sharing       ✔ Up to date       All good
 @lando/solr          ✔ Up to date       All good
 @lando/symfony       ✔ Up to date       All good
 @lando/tomcat        ✔ Up to date       All good
 @lando/varnish       ✔ Up to date       All good
 @lando/wordpress     ✔ Up to date       All good

Lando would like to update 1 package(s) listed above.
DO YOU CONSENT?: y
✖ Lando cannot write to /usr/local/bin!
  lando ERROR Error: An update error occured! Rerun with lando update --debug for more info.
    at Object.run (/Users/tay/.lando/plugins/@lando/core/tasks/update.js:163:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
From previous event:
    at process.processImmediate (node:internal/timers:476:21)
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)
    at Object.<anonymous> (/snapshot/cli/bin/lando.js)
    at Module._compile (pkg/prelude/bootstrap.js:1930:22)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Function.runMain (pkg/prelude/bootstrap.js:1983:12)
    at node:internal/main/run_main_module:23:47  +4888ms
pirog commented 7 months ago

@rami0101-AC see: https://github.com/lando/core/issues/109