google-play-scraper icon indicating copy to clipboard operation
google-play-scraper copied to clipboard

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

Open Rohan0980 opened this issue 3 years ago • 10 comments

  • Operating System: MacOS
  • Node version: v16.13.1
  • google-play-scraper version: 8.1.0

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"}

Rohan0980 avatar Jan 18 '22 05:01 Rohan0980

Same issue.

valentinkorzun avatar Jan 18 '22 15:01 valentinkorzun

Can you please provide a code example?

icarcal avatar Jan 18 '22 15:01 icarcal

@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);
})

Rohan0980 avatar Jan 19 '22 05:01 Rohan0980

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+

mslusarczyk avatar Jan 19 '22 08:01 mslusarczyk

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.

valentinkorzun avatar Jan 19 '22 09:01 valentinkorzun

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

mslusarczyk avatar Jan 20 '22 09:01 mslusarczyk

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

Rohan0980 avatar Jan 21 '22 06:01 Rohan0980

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.

facundoolano avatar Jan 21 '22 10:01 facundoolano

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.

JDSeiler avatar Jan 24 '22 16:01 JDSeiler

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 ?

dhung1308 avatar May 26 '22 04:05 dhung1308