-
Notifications
You must be signed in to change notification settings - Fork 434
Description
Apache Hop version?
2.17
Java version?
17.0.18
Operating system
Docker
What happened?
The Google Sheets Input transform fails to initialize the connection when the Proxy Port field is left empty. The plugin attempts to parse an empty string as an integer, causing a java.lang.NumberFormatException. If a placeholder port (e.g., 443) is provided to bypass the formatting error, the underlying Google Transport library attempts to route traffic through a non-existent proxy, leading to a Connection refused error.
Steps to Reproduce:
Add a Google Sheets Input transform to a pipeline.
Configure a valid Service Account Key and Spreadsheet ID.
Leave the Proxy Host and Proxy Port fields empty (default state).
Select a spreadsheet.
Click "Get Fields".
Observe the java.lang.NumberFormatException: For input string: "" error.
Enter 443 in Proxy Port and leave Proxy Host empty.
Click "Get Fields" again and observe java.net.ConnectException: Connection refused.
Expected Behavior:
The transform should check if the Proxy Host is null or empty before attempting to parse the Proxy Port. If no Proxy Host is provided, it should skip proxy configuration entirely and proceed with a direct connection.
Actual Behavior:
The code calls Integer.parseInt() on the port field regardless of whether a host is defined, making it impossible to establish a direct (non-proxy) connection once the dialog has been interacted with.
Stack Trace Snippet:
java.lang.NumberFormatException: For input string: ""
at java.base/java.lang.Integer.parseInt(Integer.java:678)
at org.apache.hop.pipeline.transforms.googlesheets.GoogleSheetsConnectionFactory.newTransport(GoogleSheetsConnectionFactory.java:39)
at org.apache.hop.pipeline.transforms.googlesheets.GoogleSheetsInputDialog.getSpreadsheetFields(GoogleSheetsInputDialog.java:877)
Workaround found:
Manually editing the .hpl XML to ensure the tags are self-closing (<proxy_port/>) bypasses the UI-injected empty string. The selection of a spreadsheet is possible. Testing the connection is possible. Loading the fields however remains impossible.
Issue Priority
Priority: 1
Issue Component
Component: Hop Web