Page MenuHomePhabricator

Inconsistent number of IPs returned for /proxies, /vpns compared to /proxy/:label, /vpn/:label
Open, Needs TriagePublicBUG REPORT

Description

What is the problem?

With a large amount of data, sometimes the numbers of IPs returned for a particular proxy is different depending whether you call /proxies or /proxy/:label.

The same thing happens for /vpns v.s. /vpn/:label. See T348745#9260670.

Steps to reproduce problem
  1. Download {F37741556} and put it in the tmp/ directory of your ipoid install
  2. In the ipoid directory, run: docker-compose up -d
  3. docker-compose exec web node -e "require('./create-users.js')();"
  4. docker-compose exec web node -e "require('./init-db.js')();"
  5. docker-compose exec web ./diff.sh --today tmp/spur.v2.feed.luminati_proxy_100000.json.gz
  6. docker-compose exec web ./import.sh 0
  7. Run this python:
import requests
proxies = requests.get("http://localhost:6927/feed/v1/proxies").json()
proxy = requests.get("http://localhost:6927/feed/v1/proxy/LUMINATI_PROXY").json()
# Number of IPs returned by /feed/v1/proxies
len(proxies['LUMINATI_PROXY'])
# Number of IPs returned by /feed/v1/proxy/LUMINATI_PROXY
len(proxy)

Expected behaviour: The last two python lines should return the same number (I believe the correct answer is 99858)
Observed behaviour: The former returns 74253, the latter 99858.

Environment

ipoid commit 035cd08ca3aafbb4653c2f037225dd2386b015b1

Testing notes

Script to compare the accuracy of the API endpoints with the Spur JSON feed: https://gitlab.wikimedia.org/dwalden/ipmasking-testing/-/blob/main/ipoid_api_accuracy.py

Event Timeline

I have found cases where this bug happens for /vpns as well. Importing the Spur feed from 20231017 and comparing /vpns and /vpn/NORD_VPN the former has a smaller number of IPs compared to the latter.

dom_walden renamed this task from Inconsistent number of IPs returned for /proxies compared to /proxy/:label to Inconsistent number of IPs returned for /proxies, /vpns compared to /proxy/:label, /vpn/:label.Oct 18 2023, 6:20 AM
dom_walden updated the task description. (Show Details)