This is an automated email from the ASF dual-hosted git repository.
ephraimanierobi pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 09cc4b38c6d0e93eae4ce885b17b66e0e5fa54a8
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Jan 15 16:34:58 2026 +0100
[v3-1-test] Fix/backfill permission error handling (#60582) (#60587)
* [v3-1-test] Fix/backfill permission error handling (#60582)
* Fixed misleading permission error
* Prek fix
* Removed all translations execpt english
(cherry picked from commit e4351fa89d97ef6cc3bed13e30cb890696a18f50)
Co-authored-by: manipatnam <[email protected]>
* Fix eslint error
---------
Co-authored-by: manipatnam <[email protected]>
Co-authored-by: pierrejeambrun <[email protected]>
---
.../ui/public/i18n/locales/en/components.json | 1 +
.../src/components/DagActions/RunBackfillForm.tsx | 25 ++++++++++++++++++----
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/en/components.json
b/airflow-core/src/airflow/ui/public/i18n/locales/en/components.json
index eed0d7784c7..8f33455cd87 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/en/components.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/en/components.json
@@ -10,6 +10,7 @@
"maxRuns": "Max Active Runs",
"missingAndErroredRuns": "Missing and Errored Runs",
"missingRuns": "Missing Runs",
+ "permissionDenied": "Dry Run Failed: User does not have permission to
create backfills.",
"reprocessBehavior": "Reprocess Behavior",
"run": "Run Backfill",
"selectDescription": "Run this Dag for a range of dates",
diff --git
a/airflow-core/src/airflow/ui/src/components/DagActions/RunBackfillForm.tsx
b/airflow-core/src/airflow/ui/src/components/DagActions/RunBackfillForm.tsx
index 5155e482751..d2dfe99e27c 100644
--- a/airflow-core/src/airflow/ui/src/components/DagActions/RunBackfillForm.tsx
+++ b/airflow-core/src/airflow/ui/src/components/DagActions/RunBackfillForm.tsx
@@ -16,6 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
+
+/* eslint-disable max-lines */
import { Input, Box, Spacer, HStack, Field, VStack, Flex, Text } from
"@chakra-ui/react";
import dayjs from "dayjs";
import { useEffect, useState } from "react";
@@ -33,8 +35,9 @@ import { useTogglePause } from "src/queries/useTogglePause";
import ConfigForm from "../ConfigForm";
import { DateTimeInput } from "../DateTimeInput";
-import { ErrorAlert } from "../ErrorAlert";
+import { ErrorAlert, type ExpandedApiError } from "../ErrorAlert";
import type { DagRunTriggerParams } from "../TriggerDag/TriggerDAGForm";
+import { Alert } from "../ui";
import { Checkbox } from "../ui/Checkbox";
import { RadioCardItem, RadioCardLabel, RadioCardRoot } from "../ui/RadioCard";
import { getInlineMessage } from "./inlineMessage";
@@ -69,7 +72,11 @@ const RunBackfillForm = ({ dag, onClose }:
RunBackfillFormProps) => {
const values = useWatch<BackfillFormProps>({
control,
});
- const { data, isPending: isPendingDryRun } = useCreateBackfillDryRun({
+ const {
+ data,
+ error: dryRunError,
+ isPending: isPendingDryRun,
+ } = useCreateBackfillDryRun({
requestBody: {
requestBody: {
dag_id: dag.dag_id,
@@ -124,13 +131,23 @@ const RunBackfillForm = ({ dag, onClose }:
RunBackfillFormProps) => {
reset(fdata);
onClose();
};
+
const resetDateError = () => setErrors((prev) => ({ ...prev, date: undefined
}));
const affectedTasks = data ?? { backfills: [], total_entries: 0 };
+
+ // Check if the dry run error is a permission error (403)
+ const isPermissionError =
+ dryRunError !== undefined && dryRunError !== null && (dryRunError as
ExpandedApiError).status === 403;
+
const inlineMessage = getInlineMessage(isPendingDryRun,
affectedTasks.total_entries, translate);
return (
<>
- <ErrorAlert error={errors.date ?? error} />
+ {isPermissionError ? (
+ <Alert status="error">{translate("backfill.permissionDenied")}</Alert>
+ ) : (
+ <ErrorAlert error={errors.date ?? dryRunError ?? error} />
+ )}
<VStack alignItems="stretch" gap={2} pt={4}>
<Box>
<Text fontSize="md" fontWeight="semibold" mb={3}>
@@ -160,7 +177,7 @@ const RunBackfillForm = ({ dag, onClose }:
RunBackfillFormProps) => {
/>
</HStack>
</Box>
- {noDataInterval || dataIntervalInvalid ? undefined :
<Box>{inlineMessage}</Box>}
+ {noDataInterval || dataIntervalInvalid || isPermissionError ?
undefined : <Box>{inlineMessage}</Box>}
<Spacer />
<Controller
control={control}