beemdevelopment/Aegis · error
Parameter 'data' is not set
Error message
Parameter 'data' is not set
What it means
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.
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
Example fix
// before
Uri uri = Uri.parse("otpauth-migration://offline");
GoogleAuthInfo.parseExportUri(uri);
// after
Uri uri = Uri.parse("otpauth-migration://offline?data=" + Base64.encode(payloadBytes));
GoogleAuthInfo.parseExportUri(uri); Defensive patterns
Strategy: validation
Validate before calling
if (uri.getQueryParameter("data") == null) {
throw new IllegalArgumentException("Export URI is missing the 'data' parameter");
} Try / catch
try {
GoogleAuthInfo info = GoogleAuthInfo.parseExportUri(uri);
} catch (GoogleAuthInfoException e) {
showExportError(e.getMessage());
} Prevention
- Ensure the full URI including ?data=... is copied
- Use Uri.getQueryParameterNames() to sanity-check parameters
- Re-export if the URI appears truncated
When it happens
Trigger: Calling GoogleAuthInfo.parseExportUri with otpauth-migration://offline?... that lacks the 'data' query parameter, or where Uri.getQueryParameter("data") returns null.
Common situations: 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.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Parameter 'secret' is not present
- Parameter 'counter' is not present
- Unsupported host
- unsupported otp type:
- unsupported otp type:
AI-assisted analysis of beemdevelopment/Aegis@d6f4e5925a (2026-09-08).
Data as JSON: /api/errors/b5f0b62e1308ec4b.
Report an issue: GitHub.
Appendix: source
Thrown at app/src/main/java/com/beemdevelopment/aegis/otp/GoogleAuthInfo.java:192
throw new GoogleAuthInfoException(uri, "Bad URI format");
}
return GoogleAuthInfo.parseExportUri(uri);
}
public static Export parseExportUri(Uri uri) throws GoogleAuthInfoException {
String scheme = uri.getScheme();
if (scheme == null || !scheme.equals(SCHEME_EXPORT)) {
throw new GoogleAuthInfoException(uri, "Unsupported protocol");
}
String host = uri.getHost();
if (host == null || !host.equals("offline")) {
throw new GoogleAuthInfoException(uri, "Unsupported host");
}
String data = uri.getQueryParameter("data");
if (data == null) {
throw new GoogleAuthInfoException(uri, "Parameter 'data' is not set");
}
GoogleAuthProtos.MigrationPayload payload;
try {
byte[] bytes = Base64.decode(data);
payload = GoogleAuthProtos.MigrationPayload.parseFrom(bytes);
} catch (EncodingException | InvalidProtocolBufferException e) {
throw new GoogleAuthInfoException(uri, e);
}
List<GoogleAuthInfo> infos = new ArrayList<>();
for (GoogleAuthProtos.MigrationPayload.OtpParameters params : payload.getOtpParametersList()) {
OtpInfo otp;
try {
int digits;
switch (params.getDigits()) {
case DIGIT_COUNT_UNSPECIFIED:
// intentional fallthroughView on GitHub (pinned to d6f4e5925a)