mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-22 07:58:06 +00:00
Fix: issue-4220: Airflow throwing error while deploying ingestion dags to airflow (#4229)
This commit is contained in:
parent
0abe8f540b
commit
dd2ccb1a89
@ -11,7 +11,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { isUndefined } from 'lodash';
|
import { isEmpty, isUndefined } from 'lodash';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import {
|
import {
|
||||||
INGESTION_SCHEDULER_INITIAL_VALUE,
|
INGESTION_SCHEDULER_INITIAL_VALUE,
|
||||||
@ -214,19 +214,23 @@ const AddIngestion = ({
|
|||||||
const getFilterPatternData = (data: FilterPattern) => {
|
const getFilterPatternData = (data: FilterPattern) => {
|
||||||
const { includes, excludes } = data;
|
const { includes, excludes } = data;
|
||||||
|
|
||||||
return isUndefined(includes) && isUndefined(excludes)
|
const filterPattern =
|
||||||
? undefined
|
(!isUndefined(includes) && includes.length) ||
|
||||||
: {
|
(!isUndefined(excludes) && excludes.length)
|
||||||
includes: includes && includes.length > 0 ? includes : undefined,
|
? {
|
||||||
excludes: excludes && excludes.length > 0 ? excludes : undefined,
|
includes: includes && includes.length > 0 ? includes : undefined,
|
||||||
};
|
excludes: excludes && excludes.length > 0 ? excludes : undefined,
|
||||||
|
}
|
||||||
|
: undefined;
|
||||||
|
|
||||||
|
return filterPattern;
|
||||||
};
|
};
|
||||||
|
|
||||||
const createNewIngestion = () => {
|
const createNewIngestion = () => {
|
||||||
const ingestionDetails: CreateIngestionPipeline = {
|
const ingestionDetails: CreateIngestionPipeline = {
|
||||||
airflowConfig: {
|
airflowConfig: {
|
||||||
startDate: startDate as unknown as Date,
|
startDate: startDate as unknown as Date,
|
||||||
endDate: endDate as unknown as Date,
|
endDate: isEmpty(endDate) ? undefined : (endDate as unknown as Date),
|
||||||
scheduleInterval: repeatFrequency,
|
scheduleInterval: repeatFrequency,
|
||||||
forceDeploy: true,
|
forceDeploy: true,
|
||||||
},
|
},
|
||||||
|
@ -55,6 +55,8 @@ const jsonData = {
|
|||||||
|
|
||||||
'triggering-ingestion-error': 'Error while triggering ingestion workflow',
|
'triggering-ingestion-error': 'Error while triggering ingestion workflow',
|
||||||
|
|
||||||
|
'deploy-ingestion-error': 'Error while deploying ingestion workflow!',
|
||||||
|
|
||||||
'fetch-auth-config-error': 'Error occurred while fetching auth configs!',
|
'fetch-auth-config-error': 'Error occurred while fetching auth configs!',
|
||||||
'fetch-chart-error': 'Error while fetching charts!',
|
'fetch-chart-error': 'Error while fetching charts!',
|
||||||
'fetch-dashboard-details-error': 'Error while fetching dashboard details!',
|
'fetch-dashboard-details-error': 'Error while fetching dashboard details!',
|
||||||
@ -142,6 +144,7 @@ const jsonData = {
|
|||||||
},
|
},
|
||||||
message: {
|
message: {
|
||||||
'no-services': 'No services',
|
'no-services': 'No services',
|
||||||
|
'fail-to-deploy-pipeline': 'Failed to deploy Ingestion Pipeline',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ import { ServiceCategory } from '../../enums/service.enum';
|
|||||||
import { CreateIngestionPipeline } from '../../generated/api/services/ingestionPipelines/createIngestionPipeline';
|
import { CreateIngestionPipeline } from '../../generated/api/services/ingestionPipelines/createIngestionPipeline';
|
||||||
import { DataObj } from '../../interface/service.interface';
|
import { DataObj } from '../../interface/service.interface';
|
||||||
import jsonData from '../../jsons/en';
|
import jsonData from '../../jsons/en';
|
||||||
|
import { getErrorText } from '../../utils/StringsUtils';
|
||||||
import { showErrorToast } from '../../utils/ToastUtils';
|
import { showErrorToast } from '../../utils/ToastUtils';
|
||||||
|
|
||||||
const AddServicePage = () => {
|
const AddServicePage = () => {
|
||||||
@ -66,11 +67,25 @@ const AddServicePage = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err: AxiosError) => {
|
.catch((err: AxiosError) => {
|
||||||
showErrorToast(
|
const errMessage = getErrorText(
|
||||||
err,
|
err,
|
||||||
jsonData['api-error-messages']['create-ingestion-error']
|
jsonData['api-error-messages']['create-ingestion-error']
|
||||||
);
|
);
|
||||||
reject();
|
if (
|
||||||
|
errMessage.includes(jsonData['message']['fail-to-deploy-pipeline'])
|
||||||
|
) {
|
||||||
|
showErrorToast(
|
||||||
|
errMessage,
|
||||||
|
jsonData['api-error-messages']['deploy-ingestion-error']
|
||||||
|
);
|
||||||
|
resolve();
|
||||||
|
} else {
|
||||||
|
showErrorToast(
|
||||||
|
err,
|
||||||
|
jsonData['api-error-messages']['create-ingestion-error']
|
||||||
|
);
|
||||||
|
reject();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -420,10 +420,18 @@ const ServicePage: FunctionComponent = () => {
|
|||||||
);
|
);
|
||||||
if (message.includes('Connection refused')) {
|
if (message.includes('Connection refused')) {
|
||||||
setConnectionAvailable(false);
|
setConnectionAvailable(false);
|
||||||
|
} else if (
|
||||||
|
message.includes(jsonData['message']['fail-to-deploy-pipeline'])
|
||||||
|
) {
|
||||||
|
showErrorToast(
|
||||||
|
message,
|
||||||
|
jsonData['api-error-messages']['deploy-ingestion-error']
|
||||||
|
);
|
||||||
|
resolve();
|
||||||
} else {
|
} else {
|
||||||
showErrorToast(message);
|
showErrorToast(message);
|
||||||
|
reject();
|
||||||
}
|
}
|
||||||
reject();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user