{"record":{"id":"0aa14c195a53e8af","repo":"wpscanteam/wpscan","slug":"update-required-you-can-not-run-a-scan-if-a-datab","errorCode":null,"errorMessage":"Update required, you can not run a scan if a database file is missing.","messagePattern":"Update required, you can not run a scan if a database file is missing\\.","errorType":"exception","errorClass":"WPScan::Error::MissingDatabaseFile","httpStatus":null,"severity":"error","filePath":"app/controllers/core.rb","lineNumber":189,"sourceCode":"      #\n      # @param [ String ] effective_url\n      # @param [ Addressable::URI ] effective_uri\n      def handle_follow_redirect(effective_url, effective_uri)\n        return unless WPScan::ParsedCli.follow_redirect && target.url != effective_url\n\n        target.url = effective_url\n        target.scope << effective_uri.host\n      end\n\n      # @return [ DB::Updater ]\n      def local_db\n        @local_db ||= DB::Updater.new(DB_DIR)\n      end\n\n      # @return [ Boolean ]\n      def update_db_required?\n        if local_db.missing_files?\n          raise Error::MissingDatabaseFile if ParsedCli.update == false\n\n          return true\n        end\n\n        return ParsedCli.update unless ParsedCli.update.nil?\n\n        return false unless user_interaction? && local_db.outdated?\n\n        output('@notice', msg: 'It seems like you have not updated the database for some time.')\n        print '[?] Do you want to update now? [Y]es [N]o, default: [N]'\n        $stdout.flush\n\n        response = $stdin.gets.to_s.strip\n\n        !!/^y/i.match?(response)\n      end\n\n      def update_db","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/wpscanteam/wpscan/blob/62c9cef471de90095f6b42245a11d0f8172d19c9/app/controllers/core.rb#L171-L207","documentation":"Raised by Core#update_db_required? (app/controllers/core.rb:189) when files required by the local vulnerability database are missing from DB_DIR ($XDG_CACHE_HOME/wpscan/db, ~/.cache/wpscan/db, or ~/.wpscan/db) and the run was started with an explicit --no-update (ParsedCli.update == false). WPScan refuses to scan with an incomplete database because finders, fingerprints and vulnerability lookups depend on those files.","triggerScenarios":"`wpscan --url http://target --no-update` on a machine where the DB was never downloaded (fresh install), was wiped (cleared cache, new XDG dir), or a previous update failed halfway. Explicit --no-update turns missing files into a hard error instead of letting the scan update first.","commonSituations":"CI/automation scripts that always pass --no-update; first run in a fresh container/image; users who deleted ~/.wpscan or moved between the legacy and XDG cache layouts; disk-full during a previous update.","solutions":["Run `wpscan --update` once to download the missing database files","Remove --no-update from the command so missing files trigger an automatic update before the scan","If the update itself fails, check DB_DIR is writable and the disk is not full, then retry"],"exampleFix":"# before\nwpscan --url http://target --no-update\n# => Update required, you can not run a scan if a database file is missing.\n\n# after\nwpscan --update && wpscan --url http://target --no-update","handlingStrategy":"validation","validationCode":"# Fail fast in scripts when the local DB is incomplete\nupdater = WPScan::DB::Updater.new(WPScan::DB_DIR)\nsystem('wpscan --update') if updater.missing_files?\n# only now launch the scan with --no-update","typeGuard":null,"tryCatchPattern":"begin\n  scan.run\nrescue WPScan::Error::MissingDatabaseFile\n  `wpscan --update`\n  retry\nend","preventionTips":["Run wpscan --update during CI image build, not per-scan","Only pass --no-update when a prior successful update is guaranteed","Keep DB_DIR writable and persistent","Treat a failed update as fatal — never continue into a scan with --no-update"],"tags":["database","update","cache","first-run","cli-options"],"backgroundTag":"missing-required-files","analyzedSha":"62c9cef471de90095f6b42245a11d0f8172d19c9","analyzedAt":"2026-08-21T17:10:47.902Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}