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

Error: Unable to post episode to anchorfm: TimeoutError: Waiting for selector input[type=file] failed: Waiting failed: 30000ms #87

Closed
jordanscience opened this issue Mar 20, 2023 · 14 comments · May be fixed by #88

Comments

@jordanscience
Copy link

Hello, do you have an idea of this bug?

Running on MAC

Logged in
Uploading audio file
Error: Unable to post episode to anchorfm: TimeoutError: Waiting for selector input[type=file] failed: Waiting failed: 30000ms exceeded
at postEpisode (/Users/jordan/perso/youtube-to-anchorfm/src/anchorfm-pupeteer/index.js:174:11)
at async main (/Users/jordan/perso/youtube-to-anchorfm/src/index.js:36:3)

Thanks

@abe-101
Copy link
Member

abe-101 commented Mar 21, 2023

Are running this on your local computer?
I have yet to hear of anyone who's tried this project locally on a mac
Could it be an issue may be related to that
🤷

@matevskial
Copy link
Contributor

matevskial commented Mar 21, 2023

This issue appears mostly locally(I run it on a Linux distribution - KDE Neon) and this issue is not consistent, sometiems it appears, sometimes it doesn't.

But when running as a GitHub action, the issue is not happening.

@storrisi
Copy link

@matevskial I actually faced the same issue a week ago running the Github action several times

@LauPaSat-pl
Copy link
Contributor

@matevskial I also got very similar issue running it on Github Actions (2 times out of 21 runs). The only difference I see is that I got the error on title instead of input[type=file].

Here's my full error:
Error: Unable to post episode to anchorfm: TimeoutError: Waiting for selector #title failed: Waiting failed: 30000ms exceeded at postEpisode (/src/anchorfm-pupeteer/index.js:174:11) at async main (/src/index.js:36:3)

@marinbenc
Copy link

marinbenc commented Apr 4, 2023

Where are y'all located? My hunch is that this happens because of the EU cookies popup, but I'm not sure.

When I run outside of headless mode and manually click the "Accept Cookies" button, Puppeteer happily proceeds to upload the episode. I tried to spoof my geolocation to be in the US as follows:

src/anchorfm-pupeteer/index.js:82

async function postEpisode(youtubeVideoInfo) {
  let browser;
  try {
    console.log('Launching puppeteer');
    browser = await puppeteer.launch({ args: ['--no-sandbox'], headless: false });
    const page = await browser.newPage();

    const context = browser.defaultBrowserContext();
    await page.setGeolocation({latitude: 47.75, longitude: -120.74});

    const navigationPromise = page.waitForNavigation();
    await context.overridePermissions('https://anchor.fm/dashboard/episode/new', ['geolocation']);

    await page.goto('https://anchor.fm/dashboard/episode/new');
    await page.setViewport({ width: 1600, height: 789 });
    await navigationPromise;

    console.log('Trying to log in');
(...)

But this didn't work. If anyone understands Puppeteer better maybe they can chime in how to spoof the location to avoid the cookie popup. Or how to click the accept button if it appears.

@abe-101
Copy link
Member

abe-101 commented Apr 4, 2023

I am in the us and also have this issue randomly.

I support your hunch that it may be related to the cookie pop up

We could have pupeteer to first except the cookies then proceed to login.

VasilisTako added a commit to VasilisTako/youtube-to-anchorfm that referenced this issue Apr 20, 2023
…ish date referred to issue Schrodinger-Hat#84. Changed text based element xpath to selectors because with different languages on browser it gets stuck. TODO: Change where possible full selector with wildcards
@jordanscience
Copy link
Author

I have the same issue when running with GitHub Action ...

https://github.com/jordanscience/youtube-to-anchorfm/actions/runs/5073577077/jobs/9112763736

@geeknarrator
Copy link

I have had the same issues and I am in the EU.

@shelomito12
Copy link

It happens to me today which brought me here. Tried to re-run the failed job but keep getting similar error:

Posting episode to anchorfm
Launching puppeteer
Trying to log in
Logged in
Uploading audio file
Waiting for upload to finish
-- Adding title
Error: Unable to post episode to anchorfm: TimeoutError: waiting for selector `#title` failed: timeout 30000ms exceeded
    at postEpisode (/src/anchorfm-pupeteer/index.js:1[57](https://github.com/jzvi12/youtube-to-anchorfm/actions/runs/5177297618/jobs/9327426723#step:4:58):15)
    at async main (/src/index.js:37:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! youtube-to-anchorfm@2.0.0 start: `node src/index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the youtube-to-anchorfm@2.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /github/home/.npm/_logs/2023-06-05T13_03_15_839Z-debug.log

@dav1403
Copy link

dav1403 commented Jul 7, 2023

I am having the same issue, anyone found a fix or a workaround?

@shelomito12
Copy link

This is the end for youtube-to-anchorfm. Every week we have a new YouTube video but the Action keep failing. Now we have to upload manually

@matevskial
Copy link
Contributor

We are aware of the issue.

The issue is most likely due to the cookie popup.

We are going to try to tackle the problem.

@TheJoin95
Copy link
Member

Can we close this issue @matevskial ?

@TheJoin95
Copy link
Member

Is this issue still around?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants