lando / pantheon

The Official Lando Pantheon plugin.
https://docs.lando.dev/pantheon
GNU General Public License v3.0
11 stars 18 forks source link

Can't lando init certain Pantheon sites #52

Closed cboyden closed 2 years ago

cboyden commented 6 years ago

Bug Report

Tell us about your setup

v3.0.0-beta.45 on Mac OSX 10.11.6

Tell us about your .lando.yml

n/a (Bug happens when using lando init to create a new .lando.yml)

Tell us about the command you were running

lando init --recipe pantheon --pantheon-site ls

Tell us about the error you got

$ lando init --recipe pantheon --pantheon-site ls --vvvv
? Choose a Pantheon account cboyden@berkeley.edu
error: No such pantheon site!
$ terminus auth:whoami
cboyden@berkeley.edu
$ terminus site:info ls --fields=name,frozen
 ------------ --------------------------------------
  Name         ls
  Is Frozen?   false
 ------------ --------------------------------------

Tell us generally about your bug As a Pantheon org admin, I have access to over 1600 sites. When I run lando init --recipe pantheon without specifying a site name, only about 270 of them show up in the select list. When I try to pass in a specific Pantheon sitename, any site that hasn't shown up on the select list doesn't seem to be available. This happens even on sites where I am the user in charge.

For the sites that do show up on the select list, the lando init command runs fine.

dustinleblanc commented 6 years ago

Hi @cboyden! This would be an issue with what data is returned by the Pantheon API. Out of curiosity, do you get truncated output when using Terminus as well?

cboyden commented 6 years ago

No, I get the full expected output when I run Terminus. site:list returns all 1600+ sites. site:info returns correctly for the sites that don't appear in the select list. And aliases returns all the sites where I'm on the team.

cboyden commented 6 years ago

I just tested this on DDEV with their Pantheon recipe and got the same results. Some sites that I definitely have access to I can't initialize, and others I can. It's the same ones for each platform. If there's not a way to move this issue to Pantheon, feel free to close and I'll file it there.

dustinleblanc commented 6 years ago

Hey @cboyden they must be using the same api endpoints that we are 😆

@pirog my guess is that maybe there is some pagination of results going on here or something?

1600+ sites is bonkers, but man, if you have a fleet, you want to be able to Lando it!

pirog commented 6 years ago

@dustinleblanc yeah im not sure either. 270 seems like a rando page size. I wonder how we could even get into a situation to test this?

maybe there is some sort of test org with a shload of sites pantheon could add us to for a bit? maybe we can pass in a pager size so we could handle this with a smaller amount of total sites?

Also might be worth initiating the spirit dance 🔥 🕺 🔥 that summons The @craychee to see if she could point us in the right direction.

cboyden commented 6 years ago

@dustinleblanc @pirog When I use --pantheon-site to initialize a specific site that I know I have access to, Lando must be using the same API endpoint that returns all the sites I theoretically could have access to at once (including all my org's sites). Could it instead use one that returns a single site?

For more background, there's a much smaller number of sites for which I'm on the team. These are the ones I'm most likely to be working on. It's still 200+ sites, though, and I can't imagine ever wanting to press the arrow key 100 times to get to the one that starts with M. So it seems likely that I'd always want to pass in the specific site name, and my colleagues would too. Maybe other users with large numbers of sites would feel similarly.

pirog commented 6 years ago

@cboyden yeah ive definitely heard this specific issue before for people with a lot of sites. they've gotten around it by using the --pantheon-siteflag but im guessing they had sub-270 sites since it worked for them and not for you

Because the pantheon api is not really a public thing i dont really know the answer re: grab a single site. i'm guessing the issue there is we need a site id which we cant get without matching by machine name first.

I think the easiest resolution here is to just get lando to read the whole list of sites since that is the fundamental issue here. Only potential issue there is performance eg how long does it take to grab a list of 1600 sites? what is the best UX around that etc.

craychee commented 6 years ago

@dustinleblanc @pirog you rang?

There have been recent changes on the platform API to the retrieval of sites but the membership API that I know lando hits should not have been impacted. I am happy to dig into this a bit more. Since Pantheon's APIs are not public, I will follow up privately.

craychee commented 6 years ago

@dustinleblanc @pirog @cboyden We've caught a bug on the Pantheon API that perhaps is related. If so, it may have resolved this.

dustinleblanc commented 6 years ago

Hey @craychee! Pinged you back via email, thanks again for jumping in!

cboyden commented 6 years ago

@craychee @dustinleblanc I am still seeing the same problem when running lando init --recipe pantheon without the --pantheon-site parameter: I get a list of 272 sites. (I get 1646 sites from terminus site:list, which is almost exactly 6 times 272.) I think it might be a different 272 sites, though, because I now see ls in the list. When I run lando init --recipe pantheon --pantheon-site ls it works. But when I try a few other sites, I'm getting the error: No such pantheon site! message.

cboyden commented 6 years ago

@dustinleblanc Has there been any movement on the Pantheon API bug? We're stuck on using Lando until we can reliably init all of our Pantheon org sites with it.

dustinleblanc commented 6 years ago

@cboyden I haven't touched on this in a while, @pirog do you know where we are with this? I know that we've certainly touched the pantheon.js file in development, but I didn't think we moved the ball on this one at all.

bwood commented 6 years ago

How about this for a workaround: Instead of querying the terminus API for the site, search the user's local cache of sites under ~/.terminus. Perhaps display a notice stating that the user should run terminus site:list if their site is not found.

cboyden commented 6 years ago

Another possible workaround: Get the site ID from the site name using a terminus query terminus site:info sitename --field=id and then use the returned value to initialize the site.

Also, a manual workaround is to grab a working .lando.yml pantheon recipe file and replace the sitename and site ID with info for the site that's "not found," and then run lando start. The only problem is that your Lando container doesn't get authenticated to Pantheon. You have to manually authenticate the machine with lando terminus auth:login --machine-token=YOUR_TOKEN before you can pull the database or files.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions and please check out this if you are wondering why we auto close issues.

cboyden commented 5 years ago

@dustinleblanc this is still a problem.

pirog commented 5 years ago

@cboyden as far as i know this is still an upstream issue with the pantheon api but i know its on their radar so hopefully it can get advanced in the short term

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions and please check out this if you are wondering why we auto close issues.

pirog commented 5 years ago

UNSTALE!

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions and please check out this if you are wondering why we auto close issues.

cboyden commented 5 years ago

This is still a problem.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions and please check out this if you are wondering why we auto close issues.

bwood commented 5 years ago

Unstale please.

On Fri, May 17, 2019 at 7:26 PM stale[bot] notifications@github.com wrote:

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions and please check out this https://github.com/probot/stale#is-closing-stale-issues-really-a-good-idea if you are wondering why we auto close issues.

—

You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lando/lando/issues/988?email_source=notifications&email_token=AABNJQNMLKBFIWMFCM2Y3PLPV5SNRA5CNFSM4FBNMPB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVWF6GQ#issuecomment-493641498, or mute the thread https://github.com/notifications/unsubscribe-auth/AABNJQLIGUJVS7WQOMJCGYTPV5SNRANCNFSM4FBNMPBQ .

-- Brian Wood Application Programmer UC Berkeley - IST Web Platform Services https://web.berkeley.edu

pirog commented 5 years ago

unstale

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions and please check out this if you are wondering why we auto close issues.

bwood commented 5 years ago

unstale

Brian Wood Application Programmer UC Berkeley - IST Web Platform Services https://web.berkeley.edu

On Jul 11, 2019, at 9:23 AM, stale[bot] notifications@github.com wrote:

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions and please check out this https://github.com/probot/stale#is-closing-stale-issues-really-a-good-idea if you are wondering why we auto close issues.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lando/lando/issues/988?email_source=notifications&email_token=AABNJQLP5RQDZLUWUNYZIR3P65M7RA5CNFSM4FBNMPB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZXHQXQ#issuecomment-510556254, or mute the thread https://github.com/notifications/unsubscribe-auth/AABNJQKWOWHLWHD3I3DMTPTP65M7RANCNFSM4FBNMPBQ.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions and please check out this if you are wondering why we auto close issues.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions and please check out this if you are wondering why we auto close issues.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions and please check out this if you are wondering why we auto close issues.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions and please check out this if you are wondering why we auto close issues.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions and please check out this if you are wondering why we auto close issues.

vinmassaro commented 4 years ago

unstale

jwmoore1 commented 4 years ago

Are there any plans to fix this issue?

bwood commented 4 years ago

DDEV recently fixed their version of this issue: https://github.com/drud/ddev/issues/1232

pirog commented 4 years ago

Alright, i've merged in https://github.com/lando/lando/pull/1997 which bumps the limit here up to 5000.

Honestly no idea whether that is a reasonable limit or not but guessing its going to be sufficient. This will be in the next release.

Going to close this out for now with the caveat that this change very well may spawn additional issues eg "takes forever to load my site list" so please dont hesistate to open up a new issue if that or something else happens to you!

morganestes commented 2 years ago

So to revisit this...5000 sites isn't enough for my org and I need to find another solution. 😞

I'm running into this problem again with the latest version of Lando (3.6.4), but the weird thing is it worked once for a specific site when I initialized inside a script with lando init --pantheon-site "${site}" --recipe pantheon --src pantheon --yes.

I had to destroy it and re-initialize again for unrelated reasons, and every time afterwards I can't get the site to initialize from the flag, or find it when I walk through lando init without any predefined options.