bonitasoft / bonita-documentation-site

The sources of the Bonita Documentation site
https://documentation.bonitasoft.com/
GNU General Public License v2.0
9 stars 5 forks source link

The "teardown inactive preview sites" workflow hangs and fails #771

Closed tbouffard closed 1 week ago

tbouffard commented 3 weeks ago

On 2024-08-17, the workflow starts to fail https://github.com/bonitasoft/bonita-documentation-site/actions/runs/10429020306/job/28885915680. The problem seems to be in the adrianjost/actions-surge.sh-teardown@v1.0.3 action.

Sat, 17 Aug 2024 03:02:12 GMT
Run adrianjost/actions-surge.sh-teardown@v1.0.3
Sat, 17 Aug 2024 03:02:23 GMT search for projects that match /[1-9]+ month.? ago/i
Sat, 17 Aug 2024 03:02:23 GMT found 27 projects for teardown
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated 1 month ago)
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 03:02:23 GMT teardown undefined (last updated )
Sat, 17 Aug 2024 09:02:10 GMT Error: The operation was canceled.

I also see the same problem in another organization with the exact same error: https://github.com/process-analytics/surge.sh-pa-admin/actions/runs/10384452599/job/28751498615

This is particularly a pain because we run this workflow on scheduled and the error is quite hidden. #768 will help.

Possible quick fix

We may need to quickly consider #756 if we don't find a solution to fix the problem. This would limit the accumulation of out-dated deployments that are no longer used.

Possible cause of the problems

adrianjost/actions-surge.sh-teardown direcly uses the surge cli to list the existing deployments and parse the standard output to detect the name of the old deployments. Then, it calls the surge teardown CLI command but apparently it passes a wrong value

A new version of surge (0.24) was released last week. See https://www.npmjs.com/package/surge?activeTab=versions

image

Here are the log when running surge list with version 0.24:

npm warn exec The following package was not found and will be installed: surge@0.24.6
...
bonitasoft-bonita-doc-deploy-pr-2815.surge.sh                            53 minutes ago   surge   surge.sh   Standard  
bonitasoft-bonita-doc-deploy-pr-2814.surge.sh                            2 hours ago      surge   surge.sh   Standard  
bonitasoft-bonita-documentation-site-deploy-pr-770.surge.sh              4 hours ago      surge   surge.sh   Standard  

⚠️ The log format has changed, previously a timestamp was provided in the first column, so the parsing is no longer accurate Here are the log when running surge list with version 0.23. They are taken from https://github.com/process-analytics/surge.sh-pa-admin/actions/runs/9744564227/job/26890460157. This repository currently enforces the usage of version 0.23. For more details, see https://github.com/process-analytics/surge.sh-pa-admin

1717995909830 process-analytics-bpmn-visualization-js-demo_preview-pr-3103.surge.sh   3 weeks ago   surge   surge.sh   Standard 
1717995831154 process-analytics-bpmn-visualization-js-doc_preview-pr-3103.surge.sh    3 weeks ago   surge   surge.sh   Standard 
1717768688535 process-analytics-process-analytics-dev-site_preview-pr-1282.surge.sh   3 weeks ago   surge   surge.sh   Standard 

Actions to follow

Additional information about the new version of surge

Note: this information doesn't relate to this bug.

Version 0.24 improves the logs of the deployment.

Logs with version 0.23

   Running as hudson.mailer@bonitasoft.com (Student)

        project: ./build/site
         domain: bonitasoft-bonita-doc-deploy-pr-2809.surge.sh

     encryption: *.surge.sh, surge.sh (282 days)
             IP: 138.197.235.123

   Success! - Published to bonitasoft-bonita-doc-deploy-pr-2809.surge.sh

Logs with version 0.24

  Running as hudson.mailer@bonitasoft.com (Student)
        project: ./build/site
         domain: bonitasoft-bonita-process-insights-doc-deploy-pr-8.surge.sh
           size: 128 files, 11.5 MB
  ┌──────────────────────────────────────────────────────────────────────────────┬────────────────────┐
  │  Certificate: issuer=C = GB, ST = Greater Manchester, L = Salford, O = Sec…  │  Valid             │
  │   *.surge.sh, surge.sh                                                       │  278 more days     │
  └──────────────────────────────────────────────────────────────────────────────┴────────────────────┘
  ┌──────────┬──────────────────────────────────────────────────────────────────────────────┬─────────┐
  │          │   ns1.surge.world   ns2.surge.world     or CNAME…                            │         │
  │    NS    │   ns3.surge.world   ns4.surge.world     geo.surge.world                      │         │
  ├──────────┼──────────────────┬───────────────────────┬─────────────────────┬─────────────┼─────────┤
  │   HTTP   │   sfo.surge.sh   │   US, San Francisco   │   138.197.235.123   │   D.Ocean   │   ✔ ◍   │
  │   HTTP   │   lhr.surge.sh   │   GB, London          │   46.101.67.123     │   D.Ocean   │   ✔ ◍   │
  │   HTTP   │   yyz.surge.sh   │   CA, Toronto         │   159.203.50.177    │   D.Ocean   │   ✔ ◍   │
  │   HTTP   │   jfk.surge.sh   │   US, New York        │   159.203.159.100   │   D.Ocean   │   ✔ ◍   │
  │   HTTP   │   ams.surge.sh   │   NL, Amsterdam       │   188.166.132.94    │   D.Ocean   │   ✔ ◍   │
  │   HTTP   │   fra.surge.sh   │   DE, Frankfurt       │   138.68.112.220    │   D.Ocean   │   ✔ ◍   │
  │   HTTP   │   sgp.surge.sh   │   SG, Singapore       │   139.59.195.30     │   D.Ocean   │   ✔ ◍   │
  │   HTTP   │   blr.surge.sh   │   IN, Bangalore       │   139.59.50.135     │   D.Ocean   │   ✔ ◍   │
  │   HTTP   │   syd.surge.sh   │   AU, Sydney          │   45.76.126.95      │   Vultr     │   ✔ ◍   │
  │   HTTP   │   nrt.surge.sh   │   JP, Tokyo           │   172.104.96.133    │   Linode    │   ✔ ◍   │
  └──────────┴──────────────────┴───────────────────────┴─────────────────────┴─────────────┴─────────┘
   Live preview ............ 1723624819777-bonitasoft-bonita-process-insights-doc-deploy-pr-8.surge.sh
   Production ............................ bonitasoft-bonita-process-insights-doc-deploy-pr-8.surge.sh
   Success! - Published to bonitasoft-bonita-process-insights-doc-deploy-pr-8.surge.sh
tbouffard commented 3 weeks ago

✔️ Testing the fix including in the master branch of the action with #772:

Details
Run adrianjost/actions-surge.sh-teardown@master
DryRun: false
search for projects that match /[1-9]+ month.? ago/i
found 32 projects for teardown
teardown bonitasoft-bonita-doc-deploy-pr-2790.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-doc-deploy-pr-2789.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-doc-deploy-pr-2787.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-doc-deploy-pr-2785.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-doc-deploy-pr-2786.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-doc-deploy-pr-2784.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-doc-deploy-pr-2783.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-doc-deploy-pr-2782.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-documentation-site-deploy-pr-748.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-documentation-site-test-pr-748.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-doc-deploy-pr-2781.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-rest-documentation-site-deploypreview-pr-29.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-doc-deploy-pr-2780.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-doc-deploy-pr-2779.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-doc-deploy-pr-2773.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-doc-deploy-pr-2774.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-doc-deploy-pr-2778.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-doc-deploy-pr-2777.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-doc-deploy-pr-2776.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-doc-deploy-pr-2775.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-openapi-deploypreview-pr-182.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-documentation-site-deploy-pr-746.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-documentation-site-test-pr-746.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-documentation-site-deploy-pr-745.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-documentation-site-test-pr-745.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-documentation-site-deploy-pr-747.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-documentation-site-test-pr-747.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-doc-deploy-pr-2766.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-doc-deploy-pr-2772.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-doc-deploy-pr-2752.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-doc-deploy-pr-2771.surge.sh (last updated 1 month ago)
teardown bonitasoft-bonita-doc-deploy-pr-2770.surge.sh (last updated 1 month ago)
removed bonitasoft-bonita-doc-deploy-pr-2785.surge.sh
removed bonitasoft-bonita-doc-deploy-pr-2787.surge.sh
removed bonitasoft-bonita-doc-deploy-pr-2790.surge.sh
removed bonitasoft-bonita-doc-deploy-pr-2782.surge.sh
removed bonitasoft-bonita-doc-deploy-pr-2781.surge.sh
removed bonitasoft-bonita-doc-deploy-pr-2786.surge.sh
removed bonitasoft-bonita-doc-deploy-pr-2789.surge.sh
removed bonitasoft-bonita-doc-deploy-pr-2783.surge.sh
removed bonitasoft-bonita-doc-deploy-pr-2772.surge.sh
removed bonitasoft-bonita-doc-deploy-pr-2784.surge.sh
removed bonitasoft-bonita-rest-documentation-site-deploypreview-pr-29.surge.sh
removed bonitasoft-bonita-doc-deploy-pr-2777.surge.sh
removed bonitasoft-bonita-doc-deploy-pr-2780.surge.sh
removed bonitasoft-bonita-documentation-site-deploy-pr-747.surge.sh
removed bonitasoft-bonita-doc-deploy-pr-2766.surge.sh
removed bonitasoft-bonita-doc-deploy-pr-2778.surge.sh
removed bonitasoft-bonita-doc-deploy-pr-2774.surge.sh
removed bonitasoft-bonita-doc-deploy-pr-2775.surge.sh
removed bonitasoft-bonita-documentation-site-test-pr-745.surge.sh
removed bonitasoft-bonita-openapi-deploypreview-pr-182.surge.sh
removed bonitasoft-bonita-documentation-site-deploy-pr-748.surge.sh
removed bonitasoft-bonita-documentation-site-test-pr-746.surge.sh
removed bonitasoft-bonita-doc-deploy-pr-2773.surge.sh
removed bonitasoft-bonita-doc-deploy-pr-2779.surge.sh
removed bonitasoft-bonita-doc-deploy-pr-2776.surge.sh
removed bonitasoft-bonita-documentation-site-deploy-pr-746.surge.sh
removed bonitasoft-bonita-documentation-site-deploy-pr-745.surge.sh
removed bonitasoft-bonita-doc-deploy-pr-2771.surge.sh
removed bonitasoft-bonita-documentation-site-test-pr-747.surge.sh
removed bonitasoft-bonita-doc-deploy-pr-2770.surge.sh
removed bonitasoft-bonita-documentation-site-test-pr-748.surge.sh
removed bonitasoft-bonita-doc-deploy-pr-2752.surge.sh

List of deployments

On 2024-08-21 09:43 GMT before running the workflow deleting the old sites:

On 2024-08-22 10:52 GMT after running the workflow deleting the old sites: