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: timeout on just a moment #20

Open
coinproduct opened this issue Nov 22, 2020 · 7 comments
Open

Error: timeout on just a moment #20

coinproduct opened this issue Nov 22, 2020 · 7 comments

Comments

@coinproduct
Copy link

any ideas?

@tpartee
Copy link

tpartee commented Nov 28, 2020

Can confirm this issue.

ec2-user@canisminor:/www/imgur/script/maint$ node cf-test.js
Error: timeout on just a moment
    at fillCookiesJar (/www/imgur/script/maint/node_modules/cloudflare-scraper/src/fillCookiesJar.js:48:17)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async handleError (/www/imgur/script/maint/node_modules/cloudflare-scraper/index.js:18:5)
    at async cloudflareScraper (/www/imgur/script/maint/node_modules/cloudflare-scraper/index.js:37:20)
    at async /www/imgur/script/maint/cf-test.js:5:22

NOTE: According to NPM when installing this package (v1.0.7) the request package is deprecated, which may be the cause of this issue to begin with, perhaps?

npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported

@aat-antoine
Copy link

I got same error. Is there a workaround ?

@coinproduct
Copy link
Author

coinproduct commented Jan 9, 2021 via email

@thiagomorello
Copy link

got same error, any ideas?

@RamBoFe
Copy link

RamBoFe commented Feb 25, 2021

Perhaps this would come from the user agent used. Are you doing your tests from linux ? If so, I would advise you to use the windows user agent by commenting out the lines of the getUserAgent() function in the utils.js file as follows and testing again :

function getUserAgent() {
  // const { platform } = process;
  // if (platform === 'darwin') {
  //   return USER_AGENT_MAC;
  // }
  // if (platform === 'win32') {
    return USER_AGENT_WINDOWS;
  // }
  // return USER_AGENT_LINUX;
}

Edit : more explications here

Edit 2 : a better way to implement your own User Agent here

@johann-taberlet
Copy link

@juliodlcz3
Copy link

Hi everyone, I am having the same error after using cloudflare-scrape around thrree-four months:

2021-05-07T22:25:49.624567+00:00 app[worker.1]: Error: timeout on just a moment
2021-05-07T22:25:49.624591+00:00 app[worker.1]: at fillCookiesJar (/app/node_modules/cloudflare-scraper/src/fillCookiesJar.js:48:17)
2021-05-07T22:25:49.624596+00:00 app[worker.1]: at runMicrotasks ()
2021-05-07T22:25:49.624597+00:00 app[worker.1]: at processTicksAndRejections (internal/process/task_queues.js:93:5)
2021-05-07T22:25:49.624597+00:00 app[worker.1]: at async handleError (/app/node_modules/cloudflare-scraper/index.js:18:5)
2021-05-07T22:25:49.624597+00:00 app[worker.1]: at async cloudflareScraper (/app/node_modules/cloudflare-scraper/index.js:37:20)
2021-05-07T22:25:49.624598+00:00 app[worker.1]: at async Timeout.init2 [as _onTimeout] (/app/mybot.js:2412:30)

Anyone else is getting this error nowdays?

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

No branches or pull requests

7 participants