kcphila opened a new issue, #53033:
URL: https://github.com/apache/airflow/issues/53033

   ### Apache Airflow version
   
   3.0.2
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   I'm testing a migration from Airflow 2.10.2 to 3.0.2 in a custom Dockerized 
environment using LocalExecutor. In this process, I generated a barebones 
`airflow.cfg` for 3.0.2 and added in customizations from there.
   
   The scheduler was crashing on every execution, and after logging into the 
container and hacking around in code, I have identified why. I ended up setting 
an empty `base_url`, e.g. this line in the `airflow.cfg`: 
   
   ```conf
   [api]
   base_url =
   ```
   
   The following code is in `local_executor.py`:
   
   ```python
   from airflow.configuration import conf
   ...
   base_url = conf.get("api", "base_url", fallback="/")
   # If it's a relative URL, use localhost:8080 as the default
   if base_url.startswith("/"):
       base_url = f"http://localhost:8080{base_url}";
   default_execution_api_server = f"{base_url.rstrip('/')}/execution/"
   ```
   
   HOWEVER, `conf.get` resolves `base_url =` in `airflow.cfg`  to emptystring, 
and so at the end of this block, `base_url == ''` and not 
`http://localhost:8080/`, and `default_execution_api_server` == `"/execution/"`
   
   
   ### What you think should happen instead?
   
   I would generally think that an empty config value should be equivalent to a 
non-existent key, but maybe this there is some reason why `conf.get` works this 
way?  
   
   Regardless, it seems that if the LocalExecutor's `execution_api_server_url` 
ends up resolving to '/execution/' and sends that to 
`airflow.sdk.execution_time.supervisor.supervise`, it will **always** lead to a 
failure in the generation of a well formed URL, and this should throw a useful, 
readable error (thrown from either supervisor.py or local_executor.py)
   
   ### How to reproduce
   
   Set up a dockerized Airflow 3.0.2 runtime with LocalExecutor and set 
`base_url =`  in `airflow.cfg`
   
   ### Operating System
   
   Linux / Docker image built from apache/airflow:3.0.2-python3.11
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Docker-Compose
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] 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)
   


-- 
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]

Reply via email to