Digital Ocean API Change Breaking Pinger & Traffic
Hello,
We noticed around 1PM today our Proxies for DigitalOcean started to fail to come online. Upon checking Scrapoxy, I noticed the control panel was reporting the local (private) IP address for all DO proxies. The pinger would then attempt to ping a private IP, which it obviously cannot reach, causing Scrapoxy to never properly see the online status of any DO instances.
Expected Behavior
Request is sent to digitalocean API to fetch a summary of all instance details. The Digital Ocean provider should then parse the API response and report the public IP to the Scrapoxy manager.
Actual Behavior
The API request is properly sent, but incorrectly parsed. The provider script is improperly hard-coded to recognize networks.v4[0].ip_address as the public ip address without checking the type. The causes the online status of DO instances to always be false. Digital Ocean began reporting private and public IPs, and the public IP was bumped to networks.v4[1].ip_address.
Fix
- Update the code to ensure the ip address type is public. Do this by changing /server/providers/digitalocean/index.js line 71 to:
ip: _.get(_.find(_.get(droplet,'networks.v4'), _.matchesProperty('type', 'public')),'ip_address'),
Thanks
I was going nuts trying to figure out why it wasn't working on DigitalOcean also. Proxies would start up then not register as alive even though they were running themselves. I'm surprised this fix hasn't been pushed into production for scrapoxy.
Maybe I could use private to connect over DigitalOcean VPC so, would'n be better to have a type configuration?
{
"commander": {
"password": "****"
},
"instance": {
"port": 3128,
"scaling": {
"min": 1,
"max": 5
}
},
"providers": [
{
"type": "digitalocean",
"token": "your token",
"region": "somewhere",
"size": "s-1vcpu-1gb",
"sshKeyName": "myKey",
"imageName": "forward-proxy-for-the-win",
"tags": "sometags",
"ip_addr_type": "private" // <=== could be private or public
}
]
}
// and then on index
get ip_addr_type() {
return this._config.ip_addr_type;
}
get models() {
...
ip: _.get(_.find(_.get(droplet,'networks.v4'), _.matchesProperty('type', this.ip_addr_type)),'ip_address'),
Hello, Are you sure that update index.js line 71 is properly work? I still get checkalive =>false and droplets seems dead . Thanks
@Tugrulvural89 matching using in check-alive is strict, so double check that you are using the right case in values e.g. region to be lon1 instead of LON1
This fix really helps us, thanks
@Tugrulvural89 If you used "sudo npm install -g scrapoxy" and installed scrapoxy again in your local module, make sure you change the settings in the global node module. For reference: https://docs.npmjs.com/cli/v7/configuring-npm/folders
it will be corrected in the 4.0.0 version
Hey there! π Exciting news! Scrapoxy 4 is ready to rock π. Check it out at Scrapoxy.io (explore the "get started" guide, deployment documentation, and more π). I can't wait to hear your feedback on this new version! Send me your coolest screenshots with as many proxies as possible! πΈπ» Join the Discord community if you have any questions or just want to chat. You can also open a GitHub issue for any bug or feature request πβ¨. See you soon! π Fabien