Fix(#9226): do not show error for public IP resolution (#9230)

* Fix(#9226): do not show error for public IP resolution

* Add message when failure happens

Co-authored-by: Sriharsha Chintalapani <harsha@getcollate.io>
This commit is contained in:
Sachin Chaurasiya 2022-12-10 11:34:30 +05:30 committed by GitHub
parent a12f42d85e
commit 0aed07aeb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -15,6 +15,7 @@ import java.util.Map;
import java.util.Properties;
import java.util.regex.Pattern;
import javax.ws.rs.core.Response;
import lombok.extern.slf4j.Slf4j;
import org.openmetadata.common.utils.CommonUtil;
import org.openmetadata.schema.api.services.ingestionPipelines.TestServiceConnection;
import org.openmetadata.schema.entity.services.ingestionPipelines.IngestionPipeline;
@ -35,6 +36,7 @@ import org.openmetadata.service.exception.PipelineServiceVersionException;
* to collect metadata, OpenMetadata to user metadata over APIs, etc.
* </ul>
*/
@Slf4j
public abstract class PipelineServiceClient {
protected final URL serviceURL;
protected final String username;
@ -128,7 +130,11 @@ public abstract class PipelineServiceClient {
return Map.of("ip", this.hostIp);
}
} catch (Exception e) {
throw PipelineServiceClientException.byMessage("Failed to get Pipeline Service host IP.", e.getMessage());
LOG.error("Failed to get Pipeline Service host IP. {}", e.getMessage());
return Map.of(
"ip",
"Failed to find the IP of Airflow Container. Please make sure https://api.ipify.org, "
+ "https://api.my-ip.io/ip reachable from your network.");
}
}

View File

@ -14,7 +14,6 @@
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import Form from '@rjsf/antd';
import CoreForm, { AjvError, FormProps, IChangeEvent } from '@rjsf/core';
import { AxiosError } from 'axios';
import classNames from 'classnames';
import { isEmpty, startCase } from 'lodash';
import { LoadingState } from 'Models';
@ -23,7 +22,6 @@ import { getPipelineServiceHostIp } from '../../../axiosAPIs/ingestionPipelineAP
import { ConfigData } from '../../../interface/service.interface';
import { formatFormDataForRender } from '../../../utils/JSONSchemaFormUtils';
import SVGIcons, { Icons } from '../../../utils/SvgUtils';
import { showErrorToast } from '../../../utils/ToastUtils';
import { Button } from '../../buttons/Button/Button';
import { ArrayFieldTemplate } from '../../JSONSchemaTemplate/ArrayFieldTemplate';
import { ObjectFieldTemplate } from '../../JSONSchemaTemplate/ObjectFieldTemplate';
@ -71,7 +69,6 @@ const FormBuilder: FunctionComponent<Props> = ({
setHostIp(data?.ip || '[unknown]');
} catch (error) {
setHostIp('[error - unknown]');
showErrorToast(error as AxiosError);
}
};