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

   we see the fellowing error in the webserver log on trying to run the task 
manually from the UI for k8s executor. 
   
   ```
   Traceback (most recent call last):
     File 
"/home/airflow/.local/lib/python3.7/site-packages/airflow/executors/kubernetes_executor.py",
 line 264, in run_pod_async
       body=sanitized_pod, namespace=pod.metadata.namespace, **kwargs
     File 
"/home/airflow/.local/lib/python3.7/site-packages/kubernetes/client/api/core_v1_api.py",
 line 7356, in create_namespaced_pod
       return self.create_namespaced_pod_with_http_info(namespace, body, 
**kwargs)  # noqa: E501
     File 
"/home/airflow/.local/lib/python3.7/site-packages/kubernetes/client/api/core_v1_api.py",
 line 7469, in create_namespaced_pod_with_http_info
       collection_formats=collection_formats)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/kubernetes/client/api_client.py",
 line 353, in call_api
       _preload_content, _request_timeout, _host)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/kubernetes/client/api_client.py",
 line 184, in __call_api
       _request_timeout=_request_timeout)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/kubernetes/client/api_client.py",
 line 397, in request
       body=body)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/kubernetes/client/rest.py", 
line 281, in POST
       body=body)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/kubernetes/client/rest.py", 
line 234, in request
       raise ApiException(http_resp=r)
   kubernetes.client.exceptions.ApiException: (403)
   Reason: Forbidden
   HTTP response headers: HTTPHeaderDict({'Audit-Id': 
'5a631062-cbc1-49f6-ae20-3581626a6249', 'Cache-Control': 'no-cache, private', 
'Content-Type': 'application/json', 'X-Content-Type-Options': 'nosniff', 
'X-Kubernetes-Pf-Flowschema-Uid': 'e6bfeec0-ef68-4420-88d8-b7024eed9fea', 
'X-Kubernetes-Pf-Prioritylevel-Uid': '0e598fd5-a817-46f7-be85-6ac94aeb7872', 
'Date': 'Wed, 18 Jan 2023 10:52:05 GMT', 'Content-Length': '381'})
   HTTP response body: 
{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"pods
 is forbidden: User \"system:serviceaccount:airflow:airflow-webserver\" cannot 
create resource \"pods\" in API group \"\" in the namespace \"airflow\": RBAC: 
clusterrole.rbac.authorization.k8s.io \"system:openshift:scc:anyuid\" not 
found","reason":"Forbidden","details":{"kind":"pods"},"code":403}
   
   ```
   
   in case of k8s executor, the `webserver role` should be able to launch the 
pod for manual task trigger.  we need to add the `airflow-webserver service 
account` to `pod-launcher role`. 
   
   
   <!--
   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/
   -->
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request 
Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.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