[
https://issues.apache.org/jira/browse/AIRFLOW-3099?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16641076#comment-16641076
]
ASF GitHub Bot commented on AIRFLOW-3099:
-----------------------------------------
kaxil closed pull request #4002: [AIRFLOW-3099] Complete list of optional
airflow.cfg sections
URL: https://github.com/apache/incubator-airflow/pull/4002
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/airflow/bin/cli.py b/airflow/bin/cli.py
index dbab8b38d8..14928bbd48 100644
--- a/airflow/bin/cli.py
+++ b/airflow/bin/cli.py
@@ -488,6 +488,24 @@ def _run(args, dag, ti):
@cli_utils.action_logging
def run(args, dag=None):
+ # Optional sections won't log an error if they're missing in airflow.cfg.
+ OPTIONAL_AIRFLOW_CFG_SECTIONS = [
+ 'atlas',
+ 'celery',
+ 'celery_broker_transport_options',
+ 'dask',
+ 'elasticsearch',
+ 'github_enterprise',
+ 'hive',
+ 'kerberos',
+ 'kubernetes',
+ 'kubernetes_node_selectors',
+ 'kubernetes_secrets',
+ 'ldap',
+ 'lineage',
+ 'mesos',
+ ]
+
if dag:
args.dag_id = dag.dag_id
@@ -510,18 +528,15 @@ def run(args, dag=None):
try:
conf.set(section, option, value)
except NoSectionError:
- optional_sections = [
- 'atlas', 'mesos', 'elasticsearch', 'kubernetes',
- 'lineage', 'hive'
- ]
- if section in optional_sections:
- log.debug('Section {section} Option {option} '
- 'does not exist in the
config!'.format(section=section,
-
option=option))
+ no_section_msg = (
+ 'Section {section} Option {option} '
+ 'does not exist in the config!'
+ ).format(section=section, option=option)
+
+ if section in OPTIONAL_AIRFLOW_CFG_SECTIONS:
+ log.debug(no_section_msg)
else:
- log.error('Section {section} Option {option} '
- 'does not exist in the
config!'.format(section=section,
-
option=option))
+ log.error(no_section_msg)
settings.configure_vars()
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Errors raised when some blocs are missing in airflow.cfg
> --------------------------------------------------------
>
> Key: AIRFLOW-3099
> URL: https://issues.apache.org/jira/browse/AIRFLOW-3099
> Project: Apache Airflow
> Issue Type: Bug
> Components: configuration
> Affects Versions: 1.10.0
> Reporter: Christophe
> Assignee: Kaxil Naik
> Priority: Minor
> Fix For: 1.10.1
>
>
> When we upgrade from a version of airflow to another one and new config bloc
> are available or if we delete useless blocs, lots of errors are raised if we
> don't have some blocs in airflow.cfg file.
> We need to avoid these errors for non-required blocs.
>
> For the record logs (not exhaustive):
>
> {noformat}
> [2018-09-21 10:49:37,727] {cli.py:464} ERROR - Section atlas Option
> sasl_enabled does not exist in the config!
> [2018-09-21 10:49:37,727] {cli.py:464} ERROR - Section atlas Option host does
> not exist in the config!
> [2018-09-21 10:49:37,727] {cli.py:464} ERROR - Section atlas Option port does
> not exist in the config!
> [2018-09-21 10:49:37,727] {cli.py:464} ERROR - Section atlas Option username
> does not exist in the config!
> [2018-09-21 10:49:37,727] {cli.py:464} ERROR - Section atlas Option password
> does not exist in the config!
> [2018-09-21 10:49:37,728] {cli.py:464} ERROR - Section hive Option
> default_hive_mapred_queue does not exist in the config!
> [2018-09-21 10:49:37,728] {cli.py:464} ERROR - Section mesos Option master
> does not exist in the config!
> [2018-09-21 10:49:37,728] {cli.py:464} ERROR - Section mesos Option
> framework_name does not exist in the config!
> [2018-09-21 10:49:37,728] {cli.py:464} ERROR - Section mesos Option task_cpu
> does not exist in the config!
> [2018-09-21 10:49:37,728] {cli.py:464} ERROR - Section mesos Option
> task_memory does not exist in the config!
> [2018-09-21 10:49:37,728] {cli.py:464} ERROR - Section mesos Option
> checkpoint does not exist in the config!
> [2018-09-21 10:49:37,728] {cli.py:464} ERROR - Section mesos Option
> authenticate does not exist in the config!
> [2018-09-21 10:49:37,729] {cli.py:464} ERROR - Section elasticsearch Option
> elasticsearch_host does not exist in the config!
> [2018-09-21 10:49:37,729] {cli.py:464} ERROR - Section elasticsearch Option
> elasticsearch_log_id_template does not exist in the config!
> [2018-09-21 10:49:37,729] {cli.py:464} ERROR - Section elasticsearch Option
> elasticsearch_end_of_log_mark does not exist in the config!
> [2018-09-21 10:49:37,729] {cli.py:464} ERROR - Section kubernetes Option
> worker_container_repository does not exist in the config!
> [2018-09-21 10:49:37,729] {cli.py:464} ERROR - Section kubernetes Option
> worker_container_tag does not exist in the config!
> [2018-09-21 10:49:37,729] {cli.py:464} ERROR - Section kubernetes Option
> delete_worker_pods does not exist in the config!
> [2018-09-21 10:49:37,729] {cli.py:464} ERROR - Section kubernetes Option
> namespace does not exist in the config!
> [2018-09-21 10:49:37,729] {cli.py:464} ERROR - Section kubernetes Option
> airflow_configmap does not exist in the config!
> [2018-09-21 10:49:37,729] {cli.py:464} ERROR - Section kubernetes Option
> dags_volume_subpath does not exist in the config!
> [2018-09-21 10:49:37,730] {cli.py:464} ERROR - Section kubernetes Option
> dags_volume_claim does not exist in the config!
> [2018-09-21 10:49:37,730] {cli.py:464} ERROR - Section kubernetes Option
> logs_volume_subpath does not exist in the config!
> [2018-09-21 10:49:37,730] {cli.py:464} ERROR - Section kubernetes Option
> logs_volume_claim does not exist in the config!
> [2018-09-21 10:49:37,730] {cli.py:464} ERROR - Section kubernetes Option
> git_repo does not exist in the config!
> [2018-09-21 10:49:37,730] {cli.py:464} ERROR - Section kubernetes Option
> git_branch does not exist in the config!
> [2018-09-21 10:49:37,730] {cli.py:464} ERROR - Section kubernetes Option
> git_user does not exist in the config!
> [2018-09-21 10:49:37,730] {cli.py:464} ERROR - Section kubernetes Option
> git_password does not exist in the config!
> [2018-09-21 10:49:37,730] {cli.py:464} ERROR - Section kubernetes Option
> git_subpath does not exist in the config!
> [2018-09-21 10:49:37,730] {cli.py:464} ERROR - Section kubernetes Option
> git_sync_container_repository does not exist in the config!
> [2018-09-21 10:49:37,730] {cli.py:464} ERROR - Section kubernetes Option
> git_sync_container_tag does not exist in the config!
> [2018-09-21 10:49:37,731] {cli.py:464} ERROR - Section kubernetes Option
> git_sync_init_container_name does not exist in the config!
> [2018-09-21 10:49:37,731] {cli.py:464} ERROR - Section kubernetes Option
> worker_service_account_name does not exist in the config!
> [2018-09-21 10:49:37,731] {cli.py:464} ERROR - Section kubernetes Option
> image_pull_secrets does not exist in the config!
> [2018-09-21 10:49:37,731] {cli.py:464} ERROR - Section kubernetes Option
> gcp_service_account_keys does not exist in the config!
> [2018-09-21 10:49:37,731] {cli.py:464} ERROR - Section kubernetes Option
> in_cluster does not exist in the config!{noformat}
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)