Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scanner from 25 retries to 5 #200

Closed
millnut opened this issue Sep 2, 2024 · 9 comments
Closed

Update scanner from 25 retries to 5 #200

millnut opened this issue Sep 2, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@millnut
Copy link

millnut commented Sep 2, 2024

25 retries seems very excessive, most services tend to retry up to 5 times. Updating a lot of lando projects from 25 to 5 is very time consuming.

It would be great if the default was changed to check 5 times.

@millnut millnut added the bug Something isn't working label Sep 2, 2024
@pirog
Copy link
Member

pirog commented Sep 3, 2024

I don't understand this request.

The retries will not continue once any one scan completes with success or failure. So if your app only takes 5 tries to return such a code then its not going to do the 20 other retries eg for all intents and purposes if your app only takes 5 times to retry this is already doing what you want.

Also note that this scan is not for a "service" to start up its for a URL in an app to be scanned and a valid status code to be returned. There are A LOT of bad, bloated apps out there that are not going to report back a status in only 5 retries so "most services tend to retry up to 5 times" is probably not true. There are also "good" apps on slower machines that may need more scans.

Regardless, the max amount of scans should give the overwhelming majority (eg 90%+) of apps the opportunity to return a status code and im doubtful that 5 accomplishes this.

@millnut
Copy link
Author

millnut commented Oct 9, 2024

Yes that makes sense. Where it comes unstuck is the localhost domains, shown in the screenshot below

Screenshot 2024-10-09 at 15 43 35

Where everything is green but the healthcheck stays checking for 25 times on the localhost domain, I guess having the option to exclude localhost would be handy

@reynoldsalec
Copy link
Member

@millnut so are your localhost domains failing entirely?

@millnut
Copy link
Author

millnut commented Oct 10, 2024

Hi @reynoldsalec yep after the 25 check they fail, but the app is working fine and the rest of the domains/services are status code 200. It just causes unnecessary waiting time on the terminal due to the localhost domains.

    ✖ Request failed with status code 400
    ✖ Request failed with status code 400

@reynoldsalec
Copy link
Member

Weird, is there something about your app that would 400 requests coming through on an unexpected URL (ie the localhost ones)? Seems strange that the named URLs would work but localhost 400s.

You could add 400 as an acceptable code for the scanner: https://docs.lando.dev/core/v3/scanner.html#adding-ok-codes

In addition, if you want to reduce the number of scans undertaken, you can customize that as well: https://docs.lando.dev/core/v3/scanner.html#other-options

@millnut
Copy link
Author

millnut commented Oct 11, 2024

I'll do some further investigation at the weekend but I believe it is just the standard Drupal recipe

@AaronFeledy
Copy link
Member

Check Drupal's trusted_host_patterns setting. You probably don't have localhost as an allowed domain.

@reynoldsalec
Copy link
Member

@millnut let us know if @AaronFeledy's suggestion helped out...ticket is deviating a bit but want to make sure you got a hand before closing it out.

@reynoldsalec
Copy link
Member

Going to close this out but feel free to reopen/ask more questions if you're still grappling!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants