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

🐛 Bug - Code Auditor failed on Website #948

Open
2 tasks
jeoffreyfischer opened this issue Nov 5, 2024 · 4 comments · May be fixed by #957
Open
2 tasks

🐛 Bug - Code Auditor failed on Website #948

jeoffreyfischer opened this issue Nov 5, 2024 · 4 comments · May be fixed by #957
Assignees
Labels
type: bug Something isn't working

Comments

@jeoffreyfischer
Copy link
Member

jeoffreyfischer commented Nov 5, 2024

Cc: @zacharykeeping

Hi

Describe the Bug

I ran Code Auditor several times this week and it:

  • ran for 6h - normally it should only run for 1h
  • failed

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://github.com/SSWConsulting/SSW.Website/actions/workflows/weekly-codeauditor-scan.yml
  2. Click on 'Run workflow'
  3. Wait a few hours
  4. See failed job

Expected Behavior

The job should successfully complete in about 1h

Tasks

  • Investigate
  • Fix

More Information

Environment

  • Device: MSI laptop
  • Browser: Chrome
  • OS: Windows

Screenshots

Image
Figure: Code Auditor ran for hours and failed twice

Image
Figure: Error logged

Thanks!

@jeoffreyfischer jeoffreyfischer added the type: bug Something isn't working label Nov 5, 2024
@github-project-automation github-project-automation bot moved this to 🤷‍♂️ Needs Triage in SSW.Website Jan 3, 2025
@wicksipedia wicksipedia moved this from 🤷‍♂️ Needs Triage to 🔖 Backlog - Ready in SSW.Website Jan 3, 2025
@Calinator444 Calinator444 moved this from 🔖 Backlog - Ready to 🏗 In progress in SSW.Website Jan 6, 2025
@Calinator444 Calinator444 moved this from 🏗 In progress to 🔖 Backlog - Ready in SSW.Website Jan 6, 2025
@Calinator444 Calinator444 moved this from 🔖 Backlog - Ready to 🏗 In progress in SSW.Website Jan 6, 2025
@Calinator444 Calinator444 self-assigned this Jan 6, 2025
@Calinator444
Copy link
Member

Calinator444 commented Jan 7, 2025

The bug seems to be occurring in sswlinkauditor.go. I've tried running it locally and based on the URLs in the logs it's crawling URLS that never existed on SSW's Website.

e.g. https://www.ssw.com.au/ssw/Consulting/consulting/artificial-intelligence/consulting/process-mining/consulting/microsoft-365

Note: the link above redirects to our consulting page, so link auditor may be treating the link as unique but reading the response from the consulting page.

I think the next course of action is to visit the pages where sswlinkauditor is finding these URLs to verify that they exist.

Image
Figure: No WayBackMachine record for the URL listed above

Image
Figure: Strange url in link auditor outputs

@Calinator444
Copy link
Member

Calinator444 commented Jan 8, 2025

I believe I've diagnosed the issue:

Any traffic under /ssw/Consulting gets redirected to our current consulting page, but code auditor seems to treat redirects as unique pages.

Essentially, Code Auditor keeps trying to crawl our consulting index page after getting redirected to it and then gets redirected again after accessing the links because they redirect back to the home page. This results in an infinite loop.

Image

@Calinator444
Copy link
Member

I re-ran the scan after adding in the fix to handle redirects

It scanned a little over 28000 links, on the main domain
given that the last successful code auditor scan included 28,552 links, this result appears to be accurate

Image
Figure: Last successful code auditor scan

although the number of broken links has climbed to approximately

@Calinator444 Calinator444 linked a pull request Jan 10, 2025 that will close this issue
@Calinator444 Calinator444 moved this from 🏗 In progress to 👀 In review in SSW.Website Jan 10, 2025
@Calinator444
Copy link
Member

Calinator444 commented Jan 10, 2025

I was able to successfully build the docker image and run a scan on the website, but need my changes approved before I can wrap this up.

There are also a large number of broken links on the website (1,032), many of which are caused because we didn't migrate the client side redirects during the v3-migration. I recommend we create PBIs to fix this soon.

https://codeauditor.com/build/b4e3dc61-a3f4-4bab-2817-33afbf8ca9dd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
Status: 👀 In review
Development

Successfully merging a pull request may close this issue.

2 participants