Skip to content

Commit

Permalink
Fix #14590: Improve airflow plugin error message (#14839)
Browse files Browse the repository at this point in the history
* Fix #14590: Improve airflow plugin error message

* Update openmetadata-service/src/main/java/org/openmetadata/service/clients/pipeline/airflow/AirflowRESTClient.java

Co-authored-by: Ayush Shah <ayush@getcollate.io>

* Update msg

* Update RichTextEditorPreviewer in AirflowMessageBanner component

---------

Co-authored-by: Ayush Shah <ayush@getcollate.io>
Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com>
Co-authored-by: Sachin Chaurasiya <sachinchaurasiyachotey87@gmail.com>
  • Loading branch information
4 people authored Jan 25, 2024
1 parent 2b62784 commit dcd3d47
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public class AirflowRESTClient extends PipelineServiceClient {
private static final String TIMEOUT_KEY = "timeout";
private static final String TRUSTSTORE_PATH_KEY = "truststorePath";
private static final String TRUSTSTORE_PASSWORD_KEY = "truststorePassword";
private static final String DOCS_LINK =
"Follow [this guide](https://docs.open-metadata.org/deployment/ingestion/openmetadata) for further details.";

protected final String username;
protected final String password;
Expand Down Expand Up @@ -292,7 +294,9 @@ public PipelineServiceClientResponse getServiceStatusInternal() {
// APIs URL not found
if (response.statusCode() == 404) {
return buildUnhealthyStatus(
"Airflow APIs not found. Please follow the installation guide.");
String.format(
"Airflow APIs not found. Please validate if the OpenMetadata Airflow plugin is installed correctly. %s",
DOCS_LINK));
}

return buildUnhealthyStatus(
Expand All @@ -301,12 +305,16 @@ public PipelineServiceClientResponse getServiceStatusInternal() {
response.statusCode(), response.body()));

} catch (IOException | URISyntaxException e) {
return buildUnhealthyStatus(
String.format("Failed to get REST status due to [%s].", e.getMessage()));
String exceptionMsg;
if (e.getMessage() != null) {
exceptionMsg = String.format("Failed to get Airflow status due to [%s].", e.getMessage());
} else {
exceptionMsg = "Failed to connect to Airflow.";
}
return buildUnhealthyStatus(String.format("%s %s", exceptionMsg, DOCS_LINK));
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
return buildUnhealthyStatus(
String.format("Failed to get REST status due to [%s].", e.getMessage()));
return buildUnhealthyStatus(String.format("Failed to connect to Airflow. %s", DOCS_LINK));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Space, SpaceProps, Typography } from 'antd';
import { Space, SpaceProps } from 'antd';
import classNames from 'classnames';
import { isEmpty } from 'lodash';
import React, { FC } from 'react';
import { ReactComponent as IconRetry } from '../../../assets/svg/ic-retry-icon.svg';
import { useAirflowStatus } from '../../../hooks/useAirflowStatus';
import RichTextEditorPreviewer from '../../common/RichTextEditor/RichTextEditorPreviewer';
import './airflow-message-banner.less';

const AirflowMessageBanner: FC<SpaceProps> = ({ className }) => {
Expand All @@ -32,7 +33,10 @@ const AirflowMessageBanner: FC<SpaceProps> = ({ className }) => {
data-testid="no-airflow-placeholder"
size={16}>
<IconRetry className="align-middle" height={24} width={24} />
<Typography.Text>{reason}</Typography.Text>
<RichTextEditorPreviewer
enableSeeMoreVariant={false}
markdown={reason ?? ''}
/>
</Space>
);
};
Expand Down

0 comments on commit dcd3d47

Please sign in to comment.