{"record":{"id":"429571d51007dd0f","repo":"apache/seatunnel","slug":"timeout-ms-must-be-greater-than-0","errorCode":null,"errorMessage":"timeout_ms must be greater than 0","messagePattern":"timeout_ms must be greater than 0","errorType":"validation","errorClass":"SeaTunnelException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-firebase/src/main/java/org/apache/seatunnel/connectors/seatunnel/firebase/client/FirebaseHttpClient.java","lineNumber":73,"sourceCode":"    private static final int MAX_ERROR_BODY_BYTES = 4096;\n    private final String baseUrl;\n    private final String path;\n    private final int timeoutMs;\n    private final Map<String, String> extraQueryParams;\n    private static final List<String> FIREBASE_SCOPES =\n            Arrays.asList(\n                    \"https://www.googleapis.com/auth/firebase.database\",\n                    \"https://www.googleapis.com/auth/userinfo.email\");\n    private final GoogleCredentials credentials;\n    private final String databaseSecret;\n    private final ReentrantLock tokenLock = new ReentrantLock();\n\n    public FirebaseHttpClient(ReadonlyConfig config) {\n        this.baseUrl = config.get(FirebaseSourceOptions.URL).replaceAll(\"/+$\", \"\");\n        this.path = config.get(FirebaseSourceOptions.PATH).replaceAll(\"^/+|/+$\", \"\");\n        int toms = config.get(FirebaseSourceOptions.TIMEOUT_MS);\n        if (toms <= 0) {\n            throw new SeaTunnelException(\"timeout_ms must be greater than 0\");\n        }\n        this.timeoutMs = toms;\n        this.extraQueryParams =\n                config.getOptional(FirebaseSourceOptions.QUERY_PARAMS)\n                        .orElse(Collections.emptyMap());\n\n        this.credentials = initGoogleCredentials(config);\n        this.databaseSecret =\n                config.getOptional(FirebaseSourceOptions.DATABASE_SECRET).orElse(null);\n        if (this.credentials != null) {\n            log.info(\"Initialized FirebaseHttpClient with Google OAuth2 Service Account.\");\n        } else if (StringUtils.isNotEmpty(this.databaseSecret)) {\n            log.info(\"Initialized FirebaseHttpClient with Legacy Database Secret.\");\n        } else {\n            log.info(\"Initialized FirebaseHttpClient without authentication (Public Read).\");\n        }\n    }\n","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-firebase/src/main/java/org/apache/seatunnel/connectors/seatunnel/firebase/client/FirebaseHttpClient.java#L55-L91","documentation":"FirebaseHttpClient's constructor validates the timeout_ms config and throws SeaTunnelException if it is zero or negative. The HTTP client requires a positive connect/read timeout in milliseconds. This fails fast at source initialization rather than producing hangs later.","triggerScenarios":"Configuring timeout_ms = 0 or a negative value in the Firebase source options; omitting a valid positive integer and passing an invalid literal that resolves to <= 0 via config coercion.","commonSituations":"Users copying example configs with timeout_ms = 0 thinking it means 'no timeout' (in some libraries 0 means infinite, here it is rejected); typos like timeout_ms = -1.","solutions":["Set timeout_ms to a positive integer, e.g. timeout_ms = 30000.","Remove the timeout_ms option entirely if a default is acceptable (check the option's default).","Verify the config value is not inherited/overridden to 0 by a higher-priority config source."],"exampleFix":"// before\nFirebase {\n  url = \"https://mydb.firebaseio.com\"\n  path = \"/users\"\n  timeout_ms = 0\n}\n// after\nFirebase {\n  url = \"https://mydb.firebaseio.com\"\n  path = \"/users\"\n  timeout_ms = 30000\n}","handlingStrategy":"validation","validationCode":"int toms = config.get(FirebaseSourceOptions.TIMEOUT_MS);\nif (toms <= 0) throw new IllegalArgumentException(\"timeout_ms must be > 0, got: \" + toms);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate timeout_ms > 0 before submitting the job","Remember 0 is NOT 'infinite timeout' in this connector","Keep timeout values in a checked constants/config template","Review inherited config layers for overrides setting 0"],"tags":["config","firebase","validation","sea-tn"],"backgroundTag":"invalid-config-value","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}