minnieshi commented on issue #28637:
URL: https://github.com/apache/airflow/issues/28637#issuecomment-1370758275
more info:
this also happens when install/upgrade via helm (no flux or kustomization at
all)
values used for 1st install
```
createUserJob:
useHelmHooks: false
migrateDatabaseJob:
useHelmHooks: false
# the same values file works fine but with flux it does not work (appears
can only run migration once); TODO: check why if this is important for us to
enable
enabled: true
env:
- name: AIRFLOW__CORE__LOAD_EXAMPLES
value: 'true'
config:
webserver:
# todo: change below to 'only not secret ones'
expose_config: 'True'
postgresql:
# use our own postgresql per production guide
enabled: false
# Airflow database & redis config
data:
metadataSecretName: airflow-postgres-secret
# to generate strong secret: python3 -c 'import secrets;
print(secrets.token_hex(16))'; see secret.yaml or kubectl command
webserverSecretKeySecretName: airflow-webserver-secret
dags:
persistence:
enabled: false
gitSync:
# todo: find out the azure devOp repo equivalent
enabled: true
repo: [email protected]:minnieshi/fleet-infra.git
branch: main
subPath: "airflow-dags/"
rev: HEAD
depth: 1
sshKeySecret: airflow-git-sync-secret
containerName: git-sync
maxFailures: 3
wait: 60
knownHosts: |
blah.blah.blah.blah
```
values for 2nd release (aka upgrade), changed below to false;
```
env:
- name: AIRFLOW__CORE__LOAD_EXAMPLES
value: 'false'
```
helm history for the airflow release:
```
1 Wed Jan 4 11:10:53 2023 deployed airflow-1.7.0
2.4.1 Install complete
2 Wed Jan 4 11:32:19 2023 failed airflow-1.7.0
2.4.1 Upgrade "airflow" failed: cannot patch "airflow-create-user"
with kind Job: Job.batch "airflow-create-user" is invalid: spec.template:
Invalid value: core.PodTemplateSpec{ObjectMeta:v1.ObjectMeta{Name:"",
GenerateName:"", Namespace:"", SelfLink:"", UID:"", ResourceVersion:"",
Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0,
loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil),
DeletionGracePeriodSeconds:(*int64)(nil),
Labels:map[string]string{"component":"create-user-job",
"controller-uid":"b0348ef1-9d24-4c18-b98b-fdc00866339a",
"job-name":"airflow-create-user", "release":"airflow", "tier":"airflow"},
Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil),
Finalizers:[]string(nil), ClusterName:"",
ManagedFields:[]v1.ManagedFieldsEntry(nil)},
Spec:core.PodSpec{Volumes:[]core.Volume{core.Volume{Name:"config",
VolumeSource:core.VolumeSource{HostPath:(*core.HostP
athVolumeSource)(nil), EmptyDir:(*core.EmptyDirVolumeSource)(nil),
GCEPersistentDisk:(*core.GCEPersistentDiskVolumeSource)(nil),
AWSElasticBlockStore:(*core.AWSElasticBlockStoreVolumeSource)(nil),
GitRepo:(*core.GitRepoVolumeSource)(nil),
Secret:(*core.SecretVolumeSource)(nil), NFS:(*core.NFSVolumeSource)(nil),
ISCSI:(*core.ISCSIVolumeSource)(nil),
Glusterfs:(*core.GlusterfsVolumeSource)(nil),
PersistentVolumeClaim:(*core.PersistentVolumeClaimVolumeSource)(nil),
RBD:(*core.RBDVolumeSource)(nil), Quobyte:(*core.QuobyteVolumeSource)(nil),
FlexVolume:(*core.FlexVolumeSource)(nil),
Cinder:(*core.CinderVolumeSource)(nil), CephFS:(*core.CephFSVolumeSource)(nil),
Flocker:(*core.FlockerVolumeSource)(nil),
DownwardAPI:(*core.DownwardAPIVolumeSource)(nil),
FC:(*core.FCVolumeSource)(nil), AzureFile:(*core.AzureFileVolumeSource)(nil),
ConfigMap:(*core.ConfigMapVolumeSource)(0xc02f305680),
VsphereVolume:(*core.VsphereVirtualDiskVolumeSource)(nil),
AzureDisk:(*core.AzureDiskVolumeSource)(nil), Ph
otonPersistentDisk:(*core.PhotonPersistentDiskVolumeSource)(nil),
Projected:(*core.ProjectedVolumeSource)(nil),
PortworxVolume:(*core.PortworxVolumeSource)(nil),
ScaleIO:(*core.ScaleIOVolumeSource)(nil),
StorageOS:(*core.StorageOSVolumeSource)(nil), CSI:(*core.CSIVolumeSource)(nil),
Ephemeral:(*core.EphemeralVolumeSource)(nil)}}},
InitContainers:[]core.Container(nil),
Containers:[]core.Container{core.Container{Name:"create-user",
Image:"apache/airflow:2.4.1", Command:[]string(nil), Args:[]string{"bash",
"-c", "exec \\\nairflow users create \"$@\"", "--", "-r", "Admin", "-u",
"admin", "-e", "[email protected]", "-f", "admin", "-l", "user", "-p",
"admin"}, WorkingDir:"", Ports:[]core.ContainerPort(nil),
EnvFrom:[]core.EnvFromSource{},
Env:[]core.EnvVar{core.EnvVar{Name:"AIRFLOW__CORE__LOAD_EXAMPLES",
Value:"false", ValueFrom:(*core.EnvVarSource)(nil)},
core.EnvVar{Name:"AIRFLOW__CORE__FERNET_KEY", Value:"",
ValueFrom:(*core.EnvVarSource)(0xc02f092da0)}, core.EnvVar{Name:"AIRFLOW__CORE
__SQL_ALCHEMY_CONN", Value:"", ValueFrom:(*core.EnvVarSource)(0xc02f092dc0)},
core.EnvVar{Name:"AIRFLOW__DATABASE__SQL_ALCHEMY_CONN", Value:"",
ValueFrom:(*core.EnvVarSource)(0xc02f092de0)},
core.EnvVar{Name:"AIRFLOW_CONN_AIRFLOW_DB", Value:"",
ValueFrom:(*core.EnvVarSource)(0xc02f092e00)},
core.EnvVar{Name:"AIRFLOW__WEBSERVER__SECRET_KEY", Value:"",
ValueFrom:(*core.EnvVarSource)(0xc02f092e20)},
core.EnvVar{Name:"AIRFLOW__CELERY__BROKER_URL", Value:"",
ValueFrom:(*core.EnvVarSource)(0xc02f092e40)}},
Resources:core.ResourceRequirements{Limits:core.ResourceList(nil),
Requests:core.ResourceList(nil)},
VolumeMounts:[]core.VolumeMount{core.VolumeMount{Name:"config", ReadOnly:true,
MountPath:"/opt/airflow/airflow.cfg", SubPath:"airflow.cfg",
MountPropagation:(*core.MountPropagationMode)(nil), SubPathExpr:""}},
VolumeDevices:[]core.VolumeDevice(nil), LivenessProbe:(*core.Probe)(nil),
ReadinessProbe:(*core.Probe)(nil), StartupProbe:(*core.Probe)(nil),
Lifecycle:(*core.Lifecycle)(nil), Term
inationMessagePath:"/dev/termination-log", TerminationMessagePolicy:"File",
ImagePullPolicy:"IfNotPresent", SecurityContext:(*core.SecurityContext)(nil),
Stdin:false, StdinOnce:false, TTY:false}},
EphemeralContainers:[]core.EphemeralContainer(nil), RestartPolicy:"OnFailure",
TerminationGracePeriodSeconds:(*int64)(0xc03c98cd98),
ActiveDeadlineSeconds:(*int64)(nil), DNSPolicy:"ClusterFirst",
NodeSelector:map[string]string{}, ServiceAccountName:"airflow-create-user-job",
AutomountServiceAccountToken:(*bool)(nil), NodeName:"",
SecurityContext:(*core.PodSecurityContext)(0xc031b3c600),
ImagePullSecrets:[]core.LocalObjectReference(nil), Hostname:"", Subdomain:"",
SetHostnameAsFQDN:(*bool)(nil), Affinity:(*core.Affinity)(0xc01be8eac8),
SchedulerName:"default-scheduler", Tolerations:[]core.Toleration{},
HostAliases:[]core.HostAlias(nil), PriorityClassName:"",
Priority:(*int32)(nil), PreemptionPolicy:(*core.PreemptionPolicy)(nil),
DNSConfig:(*core.PodDNSConfig)(nil), ReadinessGates:[]core.Pod
ReadinessGate(nil), RuntimeClassName:(*string)(nil),
Overhead:core.ResourceList(nil), EnableServiceLinks:(*bool)(nil),
TopologySpreadConstraints:[]core.TopologySpreadConstraint{}}}: field is
immutable && cannot patch "airflow-run-airflow-migrations" with kind Job:
Job.batch "airflow-run-airflow-migrations" is invalid: spec.template: Invalid
value: core.PodTemplateSpec{ObjectMeta:v1.ObjectMeta{Name:"", GenerateName:"",
Namespace:"", SelfLink:"", UID:"", ResourceVersion:"", Generation:0,
CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0,
loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil),
DeletionGracePeriodSeconds:(*int64)(nil),
Labels:map[string]string{"component":"run-airflow-migrations",
"controller-uid":"7867e847-08ad-42ca-a2a8-65c6f2e15788",
"job-name":"airflow-run-airflow-migrations", "release":"airflow",
"tier":"airflow"}, Annotations:map[string]string(nil),
OwnerReferences:[]v1.OwnerReference(nil), Finalizers:[]string(nil),
ClusterName:"", ManagedFields:[]v
1.ManagedFieldsEntry(nil)},
Spec:core.PodSpec{Volumes:[]core.Volume{core.Volume{Name:"config",
VolumeSource:core.VolumeSource{HostPath:(*core.HostPathVolumeSource)(nil),
EmptyDir:(*core.EmptyDirVolumeSource)(nil),
GCEPersistentDisk:(*core.GCEPersistentDiskVolumeSource)(nil),
AWSElasticBlockStore:(*core.AWSElasticBlockStoreVolumeSource)(nil),
GitRepo:(*core.GitRepoVolumeSource)(nil),
Secret:(*core.SecretVolumeSource)(nil), NFS:(*core.NFSVolumeSource)(nil),
ISCSI:(*core.ISCSIVolumeSource)(nil),
Glusterfs:(*core.GlusterfsVolumeSource)(nil),
PersistentVolumeClaim:(*core.PersistentVolumeClaimVolumeSource)(nil),
RBD:(*core.RBDVolumeSource)(nil), Quobyte:(*core.QuobyteVolumeSource)(nil),
FlexVolume:(*core.FlexVolumeSource)(nil),
Cinder:(*core.CinderVolumeSource)(nil), CephFS:(*core.CephFSVolumeSource)(nil),
Flocker:(*core.FlockerVolumeSource)(nil),
DownwardAPI:(*core.DownwardAPIVolumeSource)(nil),
FC:(*core.FCVolumeSource)(nil), AzureFile:(*core.AzureFileVolumeSource)(nil),
ConfigMap:(*cor
e.ConfigMapVolumeSource)(0xc0250349c0),
VsphereVolume:(*core.VsphereVirtualDiskVolumeSource)(nil),
AzureDisk:(*core.AzureDiskVolumeSource)(nil),
PhotonPersistentDisk:(*core.PhotonPersistentDiskVolumeSource)(nil),
Projected:(*core.ProjectedVolumeSource)(nil),
PortworxVolume:(*core.PortworxVolumeSource)(nil),
ScaleIO:(*core.ScaleIOVolumeSource)(nil),
StorageOS:(*core.StorageOSVolumeSource)(nil), CSI:(*core.CSIVolumeSource)(nil),
Ephemeral:(*core.EphemeralVolumeSource)(nil)}}},
InitContainers:[]core.Container(nil),
Containers:[]core.Container{core.Container{Name:"run-airflow-migrations",
Image:"apache/airflow:2.4.1", Command:[]string(nil), Args:[]string{"bash",
"-c", "exec \\\nairflow db upgrade"}, WorkingDir:"",
Ports:[]core.ContainerPort(nil), EnvFrom:[]core.EnvFromSource{},
Env:[]core.EnvVar{core.EnvVar{Name:"PYTHONUNBUFFERED", Value:"1",
ValueFrom:(*core.EnvVarSource)(nil)},
core.EnvVar{Name:"AIRFLOW__CORE__LOAD_EXAMPLES", Value:"false",
ValueFrom:(*core.EnvVarSource)(nil)}, core.E
nvVar{Name:"AIRFLOW__CORE__FERNET_KEY", Value:"",
ValueFrom:(*core.EnvVarSource)(0xc029daea60)},
core.EnvVar{Name:"AIRFLOW__CORE__SQL_ALCHEMY_CONN", Value:"",
ValueFrom:(*core.EnvVarSource)(0xc029daea80)},
core.EnvVar{Name:"AIRFLOW__DATABASE__SQL_ALCHEMY_CONN", Value:"",
ValueFrom:(*core.EnvVarSource)(0xc029daeaa0)},
core.EnvVar{Name:"AIRFLOW_CONN_AIRFLOW_DB", Value:"",
ValueFrom:(*core.EnvVarSource)(0xc029daeac0)},
core.EnvVar{Name:"AIRFLOW__WEBSERVER__SECRET_KEY", Value:"",
ValueFrom:(*core.EnvVarSource)(0xc029daeae0)},
core.EnvVar{Name:"AIRFLOW__CELERY__BROKER_URL", Value:"",
ValueFrom:(*core.EnvVarSource)(0xc029daeb00)}},
Resources:core.ResourceRequirements{Limits:core.ResourceList(nil),
Requests:core.ResourceList(nil)},
VolumeMounts:[]core.VolumeMount{core.VolumeMount{Name:"config", ReadOnly:true,
MountPath:"/opt/airflow/airflow.cfg", SubPath:"airflow.cfg",
MountPropagation:(*core.MountPropagationMode)(nil), SubPathExpr:""}},
VolumeDevices:[]core.VolumeDevice(nil), LivenessProb
e:(*core.Probe)(nil), ReadinessProbe:(*core.Probe)(nil),
StartupProbe:(*core.Probe)(nil), Lifecycle:(*core.Lifecycle)(nil),
TerminationMessagePath:"/dev/termination-log", TerminationMessagePolicy:"File",
ImagePullPolicy:"IfNotPresent", SecurityContext:(*core.SecurityContext)(nil),
Stdin:false, StdinOnce:false, TTY:false}},
EphemeralContainers:[]core.EphemeralContainer(nil), RestartPolicy:"OnFailure",
TerminationGracePeriodSeconds:(*int64)(0xc03d34af68),
ActiveDeadlineSeconds:(*int64)(nil), DNSPolicy:"ClusterFirst",
NodeSelector:map[string]string{},
ServiceAccountName:"airflow-migrate-database-job",
AutomountServiceAccountToken:(*bool)(nil), NodeName:"",
SecurityContext:(*core.PodSecurityContext)(0xc01f12eb00),
ImagePullSecrets:[]core.LocalObjectReference(nil), Hostname:"", Subdomain:"",
SetHostnameAsFQDN:(*bool)(nil), Affinity:(*core.Affinity)(0xc02a1b7638),
SchedulerName:"default-scheduler", Tolerations:[]core.Toleration{},
HostAliases:[]core.HostAlias(nil), PriorityClassName:"", P
riority:(*int32)(nil), PreemptionPolicy:(*core.PreemptionPolicy)(nil),
DNSConfig:(*core.PodDNSConfig)(nil),
ReadinessGates:[]core.PodReadinessGate(nil), RuntimeClassName:(*string)(nil),
Overhead:core.ResourceList(nil), EnableServiceLinks:(*bool)(nil),
TopologySpreadConstraints:[]core.TopologySpreadConstraint{}}}: field is
immutable
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]