{"record":{"id":"b5f0b62e1308ec4b","repo":"beemdevelopment/Aegis","slug":"parameter-data-is-not-set","errorCode":null,"errorMessage":"Parameter 'data' is not set","messagePattern":"Parameter 'data' is not set","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/main/java/com/beemdevelopment/aegis/otp/GoogleAuthInfo.java","lineNumber":192,"sourceCode":"            throw new GoogleAuthInfoException(uri, \"Bad URI format\");\n        }\n        return GoogleAuthInfo.parseExportUri(uri);\n    }\n\n    public static Export parseExportUri(Uri uri) throws GoogleAuthInfoException {\n        String scheme = uri.getScheme();\n        if (scheme == null || !scheme.equals(SCHEME_EXPORT)) {\n            throw new GoogleAuthInfoException(uri, \"Unsupported protocol\");\n        }\n\n        String host = uri.getHost();\n        if (host == null || !host.equals(\"offline\")) {\n            throw new GoogleAuthInfoException(uri, \"Unsupported host\");\n        }\n\n        String data = uri.getQueryParameter(\"data\");\n        if (data == null) {\n            throw new GoogleAuthInfoException(uri, \"Parameter 'data' is not set\");\n        }\n\n        GoogleAuthProtos.MigrationPayload payload;\n        try {\n            byte[] bytes = Base64.decode(data);\n            payload = GoogleAuthProtos.MigrationPayload.parseFrom(bytes);\n        } catch (EncodingException | InvalidProtocolBufferException e) {\n            throw new GoogleAuthInfoException(uri, e);\n        }\n\n        List<GoogleAuthInfo> infos = new ArrayList<>();\n        for (GoogleAuthProtos.MigrationPayload.OtpParameters params : payload.getOtpParametersList()) {\n            OtpInfo otp;\n            try {\n                int digits;\n                switch (params.getDigits()) {\n                    case DIGIT_COUNT_UNSPECIFIED:\n                        // intentional fallthrough","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/beemdevelopment/Aegis/blob/d6f4e5925a97e4e91593f1542085eae03432a759/app/src/main/java/com/beemdevelopment/aegis/otp/GoogleAuthInfo.java#L174-L210","documentation":"After validating the export URI scheme and host, parseExportUri reads the required 'data' query parameter, which carries the Base64-encoded protobuf MigrationPayload. If the parameter is absent, the URI cannot contain a payload and a GoogleAuthInfoException is thrown.","triggerScenarios":"Calling GoogleAuthInfo.parseExportUri with otpauth-migration://offline?... that lacks the 'data' query parameter, or where Uri.getQueryParameter(\"data\") returns null.","commonSituations":"Manually built export URIs missing the payload, URIs where the data parameter was URL-mangled or stripped, or testing/deep-link URIs without a real export payload.","solutions":["Include the 'data' query parameter with the Base64-encoded MigrationPayload in the URI","Re-export from Google Authenticator to get a complete URI","Check getQueryParameterNames() before calling parseExportUri to fail fast with a clearer message"],"exampleFix":"// before\nUri uri = Uri.parse(\"otpauth-migration://offline\");\nGoogleAuthInfo.parseExportUri(uri);\n// after\nUri uri = Uri.parse(\"otpauth-migration://offline?data=\" + Base64.encode(payloadBytes));\nGoogleAuthInfo.parseExportUri(uri);","handlingStrategy":"validation","validationCode":"if (uri.getQueryParameter(\"data\") == null) {\n    throw new IllegalArgumentException(\"Export URI is missing the 'data' parameter\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    GoogleAuthInfo info = GoogleAuthInfo.parseExportUri(uri);\n} catch (GoogleAuthInfoException e) {\n    showExportError(e.getMessage());\n}","preventionTips":["Ensure the full URI including ?data=... is copied","Use Uri.getQueryParameterNames() to sanity-check parameters","Re-export if the URI appears truncated"],"tags":["otp","missing-parameter","google-authenticator"],"backgroundTag":"missing-required-argument","analyzedSha":"d6f4e5925a97e4e91593f1542085eae03432a759","analyzedAt":"2026-09-08T00:46:31.111Z","contentChangedAt":"2026-09-08T00:46:31.111Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}