facundoolano / google-play-scraper

Node.js scraper to get data from Google Play
MIT License
2.28k stars 624 forks source link

{"status":400,"exception":"Error requesting Google Play:connect ECONNREFUSED 127.0.0.1:443"} #513

Open Rohan0980 opened 2 years ago

Rohan0980 commented 2 years ago

Description:

I have updated the version to 8.1.0 after facing issue similar to #496: I have tried from my local, localtunnel and also deploying on instance, but the same issue still exists.

Error message:

{"status":400,"exception":"Error requesting Google Play:connect ECONNREFUSED 127.0.0.1:443"}

valentinkorzun commented 2 years ago

Same issue.

icarcal commented 2 years ago

Can you please provide a code example?

Rohan0980 commented 2 years ago

@icarcal Please find the code below:

const gPlay = require('google-play-scraper').memoized({ maxAge: 3600000 });

const request = {
  appId: "com.google.android.apps.translate",
  throttle: 20
};
gPlay.app(request)
.then(response => {
    console.log(response);
    resolve(response);
})
.catch(err => {
    console.log(err);
})
mslusarczyk commented 2 years ago

This is probably caused by some DNS resolving issue in got that google-play-scrapper switched to in this PR https://github.com/facundoolano/google-play-scraper/pull/494

This is going to be hard to reproduce as DNS config may vary a lot from environment to environment.

Their GH Issues have multiple entries of this kind but the dev seems not to be interested in fixing it https://github.com/sindresorhus/got/issues?q=is%3Aissue+ECONNREFUSED+is%3Aclosed+

valentinkorzun commented 2 years ago

In my case, I fixed it with an npm audit fix. It fixed some vulnerabilities in package-lock and everything seems to be working.

Yes, as discuss above, problems were with got or https-proxy-agent package.

mslusarczyk commented 2 years ago

If anyone is interested a version 8.0.4 + cherry-pick with changed schema works just fine: https://github.com/mslusarczyk/google-play-scraper

Rohan0980 commented 2 years ago

Thank you @mslusarczyk . I am using your code for now. But will there by any proper resolution to this?

facundoolano commented 2 years ago

We can just go back to the old request library If the new one is causing issues. It would be ideal to come up with a unit test to exercise this scenario so we don't break it again.

JDSeiler commented 2 years ago

I was experiencing some difficult to reproduce errors where some requests would hang indefinitely. I wish I could be more specific but I'm still not sure what exactly was going on. However, switching to the 8.0.4 + cherry pick branch provided by @mslusarczyk resolved the issue immediately and it hasn't occurred since.

So, if it's possible to go back to the old request library, I think that's the right move.

dhung1308 commented 2 years ago

Same issue, I need to using git @mslusarczyk, but nearly it got some error about "cannot read properties of undefined (reading 'replace')" I back to main git but got error "Error: Error requesting Google Play:connect ECONNREFUSED 127.0.0.1:443"

Anyone help fix this error please ?