-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Ubuntu-latest stopped running Node.Js script in Actions #6738
Comments
Hi @theDavidBarton we will take a look, can you provide minimal repro steps? |
This is probably related to #6698 |
I will create a fork of my repo where there is no MongoDB and as minimal as possible. |
minimal repro stepsprequisities:
{
"dependencies": {
"puppeteer": "^5.3.0"
},
"engines": {
"node": "16.x"
}
}
const puppeteer = require('puppeteer')
const runScrape = async () => {
const browser = await puppeteer.launch()
const page = await browser.newPage()
await page.goto('https://koronavirus.gov.hu')
console.log('the Node.Js script is launched successfully)
await browser.close()
}
runScrape()
name: scrape
on:
schedule:
- cron: '30 9 * * *'
workflow_dispatch:
jobs:
scrape-and-publish:
runs-on: ubuntu-latest
environment:
name: production
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Install project
run: yarn
- name: Run main script
run: node index.js available here as well. I removed everything irrelevant from the point of view of the Ubuntu issue: https://github.com/Crocodiles-in-the-Basement/koronavirus.gov.hu-scraper steps:
|
Hi @theDavidBarton, your issue is probably due MongoDB, which isn't installed on ubuntu-latest. You can see here that we don't have MongoDb on that image, I would recommend that you use |
hi @igorboskovic3, thanks for the heads up. however, I am 100% sure it is not related to Mongo, see my minimal repro steps in my latest comment: #6738 (comment) which was not using MongoDB at all. also, that should have an error message in Actions, the current issue is rather the lack of errors (the script silently not executed via Node.Js) 🤔 indeed, I needed to downgrade to |
Hello @theDavidBarton In fact there is a bunch of problems in the script. The first one it looks like @igorboskovic3 I suppose the problem above caused the images has not most-recent version of google-chrome and puppeteer tries to download another. So, probably, you should consider to update runner image for ubuntu 22.04 The second problem is the script does not wait for the google-chrome to be downloaded(see nodejs/node#22088 and according to the script works as expected - node exits before the It can be workarounded with adding a callback that makes nodejs to wait for it
And finally, when i tried to wait for the downloading of the recent google-chrome (i.e. omit Does it help? |
hi @dsame, thank you very much for your extraordinary efforts on the issue. yes, with the information you provided I found out that puppeteer v5.3.0 gave a warning: simply upgrading to puppeteer v18.1.0 solves my issue with ubuntu-latest image. https://github.com/Crocodiles-in-the-Basement/koronavirus.gov.hu-scraper/actions/runs/3782984220/jobs/6431168530 it was a project maintenance debt on my side, thanks @dsame and @igorboskovic3 for your time spent with the resolution.
I think this is not needed, as the issue resolves by upgrading project dependencies based on the npm warnings. |
Description
My Actions stopped working a few days ago (e.g.: see "Run main script" job) and I realized Actions using Ubuntu 22.04 and not 20.04. It is related to #6399. The main script just simply not executed. There is no error msg.
Reverting back to Ubuntu-20.04 solved the issue: https://github.com/theDavidBarton/koronavirus.gov.hu-scraper/actions/runs/3666215143/jobs/6197790588
Note: it won't fail the job, it will only silently skips script execution.
Platforms affected
Runner images affected
Image version and build link
20221204.2 https://github.com/theDavidBarton/koronavirus.gov.hu-scraper/actions/runs/3666162585/jobs/6197707490
Is it regression?
20221204.2 https://github.com/theDavidBarton/koronavirus.gov.hu-scraper/actions/runs/3666215143/jobs/6197790588
Expected behavior
It should run the Node.Js script with 22.04 as before with 20.04.
Actual behavior
The Node.Js script is not executed.
Repro steps
scrape
job here https://github.com/theDavidBarton/koronavirus.gov.hu-scraper/actions/workflows/scrape.yml with an ubuntu-latestThe text was updated successfully, but these errors were encountered: