{"record":{"id":"5d8098c040534c3f","repo":"wpscanteam/wpscan","slug":"unable-to-connect-to-the-wpscan-api-original-er","errorCode":null,"errorMessage":"Unable to connect to the WPScan API: #{original_error}. Please check https://status.wpscan.com/ for service status.","messagePattern":"Unable to connect to the WPScan API: #(.+?)\\. Please check https://status\\.wpscan\\.com/ for service status\\.","errorType":"exception","errorClass":"WPScan::Error::ApiConnectionError","httpStatus":null,"severity":"error","filePath":"app/controllers/vuln_api.rb","lineNumber":68,"sourceCode":"        ]\n      end\n\n      def before_scan\n        # Already done by Core#before_scan (before the DB update, to fail as early as possible),\n        # kept as a safety net in case this controller is used in a chain without Core.\n        self.class.validate_api_tokens!\n\n        return setup_enterprise_db if enterprise_db_token\n\n        return unless api_token\n\n        DB::VulnApi.token = api_token\n\n        api_status = DB::VulnApi.status\n\n        raise Error::InvalidApiToken if api_status['status'] == 'forbidden'\n        raise Error::ApiLimitReached if api_status['requests_remaining'] == 0\n        raise Error::ApiConnectionError, api_status['http_error'] if api_status['http_error']\n      end\n\n      def after_scan\n        output('status', status: DB::VulnApi.status, api_requests: WPScan.api_requests)\n      end\n\n      private\n\n      # @return [ String, nil ] The enterprise DB token (CLI or ENV)\n      def enterprise_db_token\n        self.class.enterprise_db_token\n      end\n\n      # @return [ String, nil ] The API token (CLI or ENV var)\n      def api_token\n        self.class.api_token\n      end\n","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/wpscanteam/wpscan/blob/62c9cef471de90095f6b42245a11d0f8172d19c9/app/controllers/vuln_api.rb#L50-L86","documentation":"Raised by VulnApi#before_scan (app/controllers/vuln_api.rb:68) when the status call to the WPScan API itself failed at transport level — api_status['http_error'] is set (Typhoeus code 0: DNS failure, connection refused, timeout). The message includes the underlying error and points to status.wpscan.com. API/DB requests can bypass --proxy when --proxy-target-only is set (lib/wpscan/db/vuln_api.rb:130).","triggerScenarios":"`wpscan --url http://t --api-token TOKEN` from a machine that cannot resolve or reach the WPScan API host: blocked egress, corporate firewall, a --proxy that cannot reach wpscan domains (no --proxy-target-only), or a WPScan/Cloudflare outage.","commonSituations":"CI runners behind restrictive egress proxies; --proxy pointing at an internal-only proxy that refuses external hosts; DNS failures in containers; transient Cloudflare incidents affecting the API.","solutions":["Verify general connectivity and DNS from the same machine (curl https://wpscan.com)","If using --proxy, ensure it can reach the API — or add --proxy-target-only so API/DB traffic skips the proxy","Check https://status.wpscan.com/ for an ongoing incident","Retry once the transient network issue clears"],"exampleFix":"# before\nwpscan --url http://t --api-token TOKEN --proxy http://internal-proxy:3128\n# => Unable to connect to the WPScan API ...\n\n# after (API traffic bypasses the internal proxy)\nwpscan --url http://t --api-token TOKEN --proxy http://internal-proxy:3128 --proxy-target-only","handlingStrategy":"retry","validationCode":"# Reachability pre-check for the WPScan API\nres = Typhoeus.get('https://wpscan.com', connecttimeout: 10)\nputs 'API unreachable: check egress/proxy' if res.code.zero?","typeGuard":null,"tryCatchPattern":"begin\n  scan.run\nrescue WPScan::Error::ApiConnectionError => e\n  warn e.original_error\n  retry if (attempts += 1) < 3 && sleep(30)\nend","preventionTips":["Allow egress to the WPScan API domains in firewalls/proxies","Use --proxy-target-only when the proxy should carry target traffic only","Retry with backoff — this is usually transient","Check status.wpscan.com before deep-diving into local network debugging"],"tags":["network","api","connectivity","proxy","dns"],"backgroundTag":"external-service-unreachable","analyzedSha":"62c9cef471de90095f6b42245a11d0f8172d19c9","analyzedAt":"2026-08-21T17:10:47.902Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}