vincbeck opened a new pull request, #40563:
URL: https://github.com/apache/airflow/pull/40563

   #40334 introduced a small bug where the error message is already formatted, 
hence there is no need to pass parameters to `self._task_context_logger.error`. 
That results in this error below:
   
   ```
   Traceback (most recent call last):
     File "/usr/local/lib/python3.10/logging/__init__.py", line 1100, in emit
       msg = self.format(record)
     File "/usr/local/lib/python3.10/logging/__init__.py", line 943, in format
       return fmt.format(record)
     File "/usr/local/lib/python3.10/logging/__init__.py", line 678, in format
       record.message = record.getMessage()
     File "/usr/local/lib/python3.10/logging/__init__.py", line 368, in 
getMessage
       msg = msg % self.args
   TypeError: not all arguments converted during string formatting
   Call stack:
     File "/usr/local/bin/airflow", line 8, in <module>
       sys.exit(main())
     File "/opt/airflow/airflow/__main__.py", line 58, in main
       args.func(args)
     File "/opt/airflow/airflow/cli/cli_config.py", line 49, in command
       return func(*args, **kwargs)
     File "/opt/airflow/airflow/utils/cli.py", line 115, in wrapper
       return f(*args, **kwargs)
     File "/opt/airflow/airflow/utils/providers_configuration_loader.py", line 
55, in wrapped_function
       return func(*args, **kwargs)
     File "/opt/airflow/airflow/cli/commands/scheduler_command.py", line 61, in 
scheduler
       run_command_with_daemon_option(
     File "/opt/airflow/airflow/cli/commands/daemon_utils.py", line 86, in 
run_command_with_daemon_option
       callback()
     File "/opt/airflow/airflow/cli/commands/scheduler_command.py", line 64, in 
<lambda>
       callback=lambda: _run_scheduler_job(args),
     File "/opt/airflow/airflow/cli/commands/scheduler_command.py", line 50, in 
_run_scheduler_job
       run_job(job=job_runner.job, execute_callable=job_runner._execute)
     File "/opt/airflow/airflow/utils/session.py", line 84, in wrapper
       return func(*args, session=session, **kwargs)
     File "/opt/airflow/airflow/jobs/job.py", line 410, in run_job
       return execute_job(job, execute_callable=execute_callable)
     File "/opt/airflow/airflow/jobs/job.py", line 439, in execute_job
       ret = execute_callable()
     File "/opt/airflow/airflow/jobs/scheduler_job_runner.py", line 859, in 
_execute
       self._run_scheduler_loop()
     File "/opt/airflow/airflow/jobs/scheduler_job_runner.py", line 996, in 
_run_scheduler_loop
       num_finished_events = self._process_executor_events(session=session)
     File "/opt/airflow/airflow/jobs/scheduler_job_runner.py", line 783, in 
_process_executor_events
       self._task_context_logger.error(msg, ti, state, ti.state, info, ti=ti)
     File "/opt/airflow/airflow/utils/log/task_context_logger.py", line 170, in 
error
       self._log(logging.ERROR, msg, *args, ti=ti)
     File "/opt/airflow/airflow/utils/log/task_context_logger.py", line 141, in 
_log
       task_handler.emit(record)
     File "/opt/airflow/airflow/utils/log/file_task_handler.py", line 229, in 
emit
       self.handler.emit(record)
   Message: "The executor reported that the task instance <TaskInstance: 
example_hello.hello manual__2024-07-02T19:54:10.890354+00:00 [queued]> finished 
with state failed, but the task instance's state attribute is queued. Learn 
more: 
https://airflow.apache.org/docs/apache-airflow/stable/troubleshooting.html#task-state-changed-externally";
   Arguments: (<TaskInstance: example_hello.hello 
manual__2024-07-02T19:54:10.890354+00:00 [queued]>, <TaskInstanceState.FAILED: 
'failed'>, 'queued', None)
   ```
   
   <!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
   
      http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
    -->
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   
   
   <!-- Please keep an empty line above the dashes. -->
   ---
   **^ Add meaningful description above**
   Read the **[Pull Request 
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
 for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal 
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
 is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party 
License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in a 
newsfragment file, named `{pr_number}.significant.rst` or 
`{issue_number}.significant.rst`, in 
[newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   


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