GitHub user mureco closed a discussion: [Errno 30] Read-only file system: 
'/opt/airflow/webserver_config.py/default_webserver_config.py' when 
webserverConfigConfigMapName is set

### Official Helm Chart version

1.15.0 (latest released)

### Apache Airflow version

v2.9.3

### Kubernetes Version

v1.30.0+k3s1

### Helm Chart configuration

values.yaml
```
# Airflow webserver settings
webserver:
  enabled: true
  replicas: 1
  webserverConfigConfigMapName: airflow-webserver-config
```
airflow-webserver-config:
```
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: airflow-webserver-config
stringData:
  webserver_config.py: |-
    import os
    from __future__ import annotations
    from flask_appbuilder.const import AUTH_DB

    basedir = os.path.abspath(os.path.dirname(__file__))
    log = logging.getLogger(__name__)

    WTF_CSRF_ENABLED = True
    WTF_CSRF_TIME_LIMIT = None
    AUTH_TYPE = AUTH_DB
```

### Docker Image customizations

I use the default image docker.io/apache/airflow:2.9.3

### What happened

When I specify a custom webserver config in my values.yml with
```
webserver:
  webserverConfigConfigMapName: airflow-webserver-config
```
the webserver pod gets status CrashLoopBackOff and the pod logging is:
```
[2024-11-12T06:25:56.529+0000] {configuration.py:2090} INFO - Creating new FAB 
webserver config file in: /opt/airflow/webserver_config.py
Traceback (most recent call last):
  File "/home/airflow/.local/bin/airflow", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/airflow/.local/lib/python3.12/site-packages/airflow/__main__.py", 
line 57, in main
    write_webserver_configuration_if_needed(conf)
  File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/utils/providers_configuration_loader.py",
 line 55, in wrapped_function
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/configuration.py", 
line 2091, in write_webserver_configuration_if_needed
    shutil.copy(_default_config_file_path("default_webserver_config.py"), 
webserver_config)
  File "/usr/local/lib/python3.12/shutil.py", line 435, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/local/lib/python3.12/shutil.py", line 262, in copyfile
    with open(dst, 'wb') as fdst:
         ^^^^^^^^^^^^^^^
OSError: [Errno 30] Read-only file system: 
'/opt/airflow/webserver_config.py/default_webserver_config.py'
```

### What you think should happen instead

The content of webserver_config.py should be replaced with the content 
specified in the ConfigMap.

### How to reproduce

- Deploy airflow helm chart 1.15.0 on kubernetes v1.30.0+k3s1. All pods will 
spin up and airflow is operational.
- Add a ConfigMap containing a custom webserver_config.py
- Update the helm release

### Anything else

_No response_

### Are you willing to submit PR?

- [ ] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)


GitHub link: https://github.com/apache/airflow/discussions/43916

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to