pantheon-systems / terminus

The Pantheon CLI — a standalone utility for performing operations on the Pantheon Platform
https://pantheon.io
Other
313 stars 190 forks source link

Lando init crashes with machine token #2074

Open jay-norton opened 4 years ago

jay-norton commented 4 years ago

Expected behavior

Describe what you had expected the command to do. If your issue is with the Terminus Installer, please file your issue here: https://github.com/pantheon-systems/terminus-installer/issues

When running lando init --source pantheon I am prompted for a machine token, expected behavior is for authentication with pantheon to occur and further lando prompts for pulling site down locally to happen

Actual behavior

If your issue is with a command not working, please run the command again with the -vvv option (--debug in 0.x) and copy everything from the command down to the next prompt and paste it here between a pair of ``` marks.

PS C:\Users\Jay\www\cricket-perks> lando init --source pantheon -vvv lando 15:43:59 DEBUG ==> No update available. lando 15:43:59 VERBOSE ==> starting bootstrap at level app... lando 15:43:59 VERBOSE ==> config bootstrap beginning... lando 15:43:59 DEBUG ==> emitting event pre-bootstrap-config lando 15:43:59 DEBUG ==> plugin lando-core loaded from C:/snapshot/lando/build/cli/plugins/lando-core/index.js lando 15:43:59 DEBUG ==> plugin lando-events loaded from C:/snapshot/lando/build/cli/plugins/lando-events/index.js lando 15:43:59 DEBUG ==> plugin lando-networking loaded from C:/snapshot/lando/build/cli/plugins/lando-networking/index.js lando 15:43:59 DEBUG ==> plugin lando-pantheon loaded from C:/snapshot/lando/build/cli/plugins/lando-pantheon/index.js lando 15:43:59 DEBUG ==> plugin lando-proxy loaded from C:/snapshot/lando/build/cli/plugins/lando-proxy/index.js lando 15:43:59 DEBUG ==> plugin lando-recipes loaded from C:/snapshot/lando/build/cli/plugins/lando-recipes/index.js lando 15:43:59 DEBUG ==> plugin lando-services loaded from C:/snapshot/lando/build/cli/plugins/lando-services/index.js lando 15:43:59 DEBUG ==> plugin lando-sharing loaded from C:/snapshot/lando/build/cli/plugins/lando-sharing/index.js lando 15:43:59 DEBUG ==> plugin lando-test loaded from C:/snapshot/lando/build/cli/plugins/lando-test/index.js lando 15:43:59 DEBUG ==> plugin lando-tooling loaded from C:/snapshot/lando/build/cli/plugins/lando-tooling/index.js lando 15:43:59 DEBUG ==> emitting event post-bootstrap-config lando 15:43:59 VERBOSE ==> building proxy config... lando 15:43:59 VERBOSE ==> config bootstrap completed. lando 15:43:59 VERBOSE ==> tasks bootstrap beginning... lando 15:43:59 DEBUG ==> emitting event pre-bootstrap-tasks lando 15:43:59 DEBUG ==> autoloaded task config lando 15:43:59 DEBUG ==> autoloaded task destroy lando 15:43:59 DEBUG ==> autoloaded task info lando 15:43:59 DEBUG ==> autoloaded task list lando 15:43:59 DEBUG ==> autoloaded task logs lando 15:43:59 DEBUG ==> autoloaded task poweroff lando 15:43:59 DEBUG ==> autoloaded task rebuild lando 15:43:59 DEBUG ==> autoloaded task restart lando 15:43:59 DEBUG ==> autoloaded task share lando 15:43:59 DEBUG ==> autoloaded task start lando 15:43:59 DEBUG ==> autoloaded task stop lando 15:43:59 DEBUG ==> autoloaded task version lando 15:43:59 DEBUG ==> autoloaded task init lando 15:43:59 DEBUG ==> autoloaded task ssh lando 15:43:59 DEBUG ==> emitting event post-bootstrap-tasks lando 15:43:59 VERBOSE ==> tasks bootstrap completed. lando 15:43:59 VERBOSE ==> engine bootstrap beginning... lando 15:43:59 DEBUG ==> emitting event pre-bootstrap-engine lando 15:43:59 DEBUG ==> automoved scripts from C:\snapshot\lando\build\cli\plugins\lando-core\scripts to C:\Users\Jay\.lando\scripts and set to mode 755 lando 15:43:59 DEBUG ==> automoved scripts from C:\snapshot\lando\build\cli\plugins\lando-pantheon\scripts to C:\Users\Jay\.lando\scripts and set to mode 755 lando 15:43:59 DEBUG ==> automoved scripts from C:\snapshot\lando\build\cli\plugins\lando-proxy\scripts to C:\Users\Jay\.lando\scripts and set to mode 755 lando 15:43:59 DEBUG ==> automoved scripts from C:\snapshot\lando\build\cli\plugins\lando-recipes\scripts to C:\Users\Jay\.lando\scripts and set to mode 755 lando 15:43:59 DEBUG ==> automoved scripts from C:\snapshot\lando\build\cli\plugins\lando-services\scripts to C:\Users\Jay\.lando\scripts and set to mode 755 lando 15:43:59 DEBUG ==> automoved scripts from C:\snapshot\lando\build\cli\plugins\lando-sharing\scripts to C:\Users\Jay\.lando\scripts and set to mode 755 lando 15:43:59 DEBUG ==> emitting event post-bootstrap-engine lando 15:43:59 VERBOSE ==> engine bootstrap completed. lando 15:43:59 VERBOSE ==> app bootstrap beginning... lando 15:43:59 DEBUG ==> emitting event pre-bootstrap-app lando 15:43:59 DEBUG ==> autoloaded builder LandoCompose lando 15:43:59 DEBUG ==> autoloaded builder LandoAppserver lando 15:43:59 DEBUG ==> autoloaded builder LandoService lando 15:43:59 DEBUG ==> autoloaded builder LandoUtility lando 15:43:59 DEBUG ==> autoloaded builder LandoWebServer lando 15:43:59 DEBUG ==> autoloaded builder LandoDrupal lando 15:43:59 DEBUG ==> autoloaded builder LandoLaemp lando 15:43:59 DEBUG ==> autoloaded builder LandoCa lando 15:43:59 DEBUG ==> autoloaded builder LandoProxy lando 15:43:59 DEBUG ==> autoloaded builder LandoInit lando 15:43:59 DEBUG ==> autoloaded builder LandoApache lando 15:43:59 DEBUG ==> autoloaded builder LandoCompose lando 15:43:59 DEBUG ==> autoloaded builder LandoDotNet lando 15:43:59 DEBUG ==> autoloaded builder LandoElasticSearch lando 15:43:59 DEBUG ==> autoloaded builder LandoGo lando 15:43:59 DEBUG ==> autoloaded builder LandoMailHog lando 15:43:59 DEBUG ==> autoloaded builder LandoMariaDb lando 15:43:59 DEBUG ==> autoloaded builder LandoMemcached lando 15:43:59 DEBUG ==> autoloaded builder LandoMongoDb lando 15:43:59 DEBUG ==> autoloaded builder LandoMsSql lando 15:43:59 DEBUG ==> autoloaded builder LandoMySql lando 15:43:59 DEBUG ==> autoloaded builder LandoNginx lando 15:43:59 DEBUG ==> autoloaded builder LandoNode lando 15:43:59 DEBUG ==> autoloaded builder LandoPhp lando 15:43:59 DEBUG ==> autoloaded builder LandoPma lando 15:43:59 DEBUG ==> autoloaded builder LandoPostgres lando 15:43:59 DEBUG ==> autoloaded builder LandoPython lando 15:43:59 DEBUG ==> autoloaded builder LandoRedis lando 15:43:59 DEBUG ==> autoloaded builder LandoRuby lando 15:43:59 DEBUG ==> autoloaded builder LandoSolr lando 15:43:59 DEBUG ==> autoloaded builder LandoTomcat lando 15:43:59 DEBUG ==> autoloaded builder LandoVarnish lando 15:43:59 DEBUG ==> autoloaded builder LandoMounter lando 15:43:59 DEBUG ==> autoloaded builder LandoPantheon lando 15:43:59 DEBUG ==> autoloaded builder LandoBackdrop lando 15:43:59 DEBUG ==> autoloaded builder LandoDrupal6 lando 15:43:59 DEBUG ==> autoloaded builder LandoDrupal7 lando 15:43:59 DEBUG ==> autoloaded builder LandoDrupal8 lando 15:43:59 DEBUG ==> autoloaded builder LandoDrupal9 lando 15:43:59 DEBUG ==> autoloaded builder LandoJoomla lando 15:43:59 DEBUG ==> autoloaded builder LandoLamp lando 15:43:59 DEBUG ==> autoloaded builder LandoLaravel lando 15:43:59 DEBUG ==> autoloaded builder LandoLamp lando 15:43:59 DEBUG ==> autoloaded builder LandoMean lando 15:43:59 DEBUG ==> autoloaded builder LandoWordPress lando 15:43:59 DEBUG ==> emitting event post-bootstrap-app lando 15:43:59 VERBOSE ==> app bootstrap completed. lando 15:43:59 VERBOSE ==> bootstrap completed. lando 15:43:59 DEBUG ==> emitting event post-bootstrap lando 15:43:59 VERBOSE ==> docker-engine exists: true lando 15:43:59 VERBOSE ==> docker-compose exists: true lando 15:43:59 DEBUG ==> emitting event cli-answers lando 15:43:59 VERBOSE ==> checking docker version compatibility... lando 15:43:59 DEBUG ==> compatibility results name=desktop, link=https://docs.docker.com/docker-for-windows/release-notes/, wants=2.1.0.0 - 2.3.0.2, version=2.3.0.2, semversion=2.3.2, semmin=2.1.0, semmax=2.3.2, dockerVersion=true, satisfied=true lando 15:43:59 DEBUG ==> emitting event cli-init-answers ? Enter a Pantheon machine token [input is hidden] lando 15:43:59 DEBUG ==> engine is up. lando 15:43:59 DEBUG ==> docker is running. ? Enter a Pantheon machine token [hidden] lando 15:44:12 VERBOSE ==> making post request to https://terminus.pantheon.io/api/authorize/machine-token lando 15:44:12 DEBUG ==> request sent data with {"headers":{"User-Agent":"Terminus/Lando"}} machine_token=****, client=terminus lando 15:44:15 ERROR ==> Error: POST request to https://terminus.pantheon.io/api/authorize/machine-token failed with code 500: Internal Server Error. The server responded with the message Authorization failed. Please check that your machine token is valid.. at C:\snapshot\lando\build\cli\plugins\lando-pantheon\lib\client.js at processTicksAndRejections (internal/process/task_queues.js:93:5) lando 15:44:15 VERBOSE ==> reporting error action to report=true, url=https://metrics.lando.dev, report=true, url=https://metrics.lando.dev lando 15:44:15 DEBUG ==> reported data command=lando init, context=local, devMode=false, instance=3424c7188b8ec18af71eb118fedec1e4d7200c56, nodeVersion=v12.13.1, mode=cli, type=Windows_NT, platform=win32, release=10.0.18363, arch=x64, product=lando, version=3.0.3, message=POST request to https://terminus.pantheon.io/api/authorize/machine-token failed with code 500: Internal Server Error. The server responded with the message Authorization failed. Please check that your machine token is valid.., stack=Error: POST request to https://terminus.pantheon.io/api/authorize/machine-token failed with code 500: Internal Server Error. The server responded with the message Authorization failed. Please check that your machine token is valid..

Steps to reproduce the behavior

Along with the steps, please run terminus self:info (terminus cli info in 0.x) and paste its output here between a pair of ``` marks. If you are submitting an issue for 0.x, please include which OS and command-line client you are using.

------------------------- ----------------------------------------------- PHP binary C:\PHP7\php.exe PHP version 7.4.6 php.ini used C:\PHP7\php.ini Terminus project config Terminus root dir C:\Users\Jay\vendor\pantheon-systems\terminus Terminus version 2.3.0 Operating system build 18363 (Windows 10) ------------------------- -----------------------------------------------

Generate pantheon machine token Have most current version of lando installed (in Powershell) cd to dir where you want site to be run lando init --source pantheon paste in machine token and hit enter

OS: Windows 10 Pro command line: Powershell (running as admin)

hamsteryoon commented 1 year ago

what helped me was logging into pantheon using lando terminus auth:login --machine-token=YOUR_MACHINE_TOKEN and removing the docker rm landoXXXXandalfeditionproxy. I am not too sure what happened but i think my issue was relevant to docker proxy.