You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/01/05 17:47:24 UTC

[GitHub] [airflow] mcgin opened a new issue #13494: Unable to view StackDriver logs in Web UI

mcgin opened a new issue #13494:
URL: https://github.com/apache/airflow/issues/13494


   <!--
   
   Welcome to Apache Airflow!  For a smooth issue process, try to answer the following questions.
   Don't worry if they're not all applicable; just try to include what you can :-)
   
   If you need to include code snippets or logs, please put them in fenced code
   blocks.  If they're super-long, please use the details tag like
   <details><summary>super-long log</summary> lots of stuff </details>
   
   Please delete these comment blocks before submitting the issue.
   
   -->
   
   <!--
   
   IMPORTANT!!!
   
   PLEASE CHECK "SIMILAR TO X EXISTING ISSUES" OPTION IF VISIBLE
   NEXT TO "SUBMIT NEW ISSUE" BUTTON!!!
   
   PLEASE CHECK IF THIS ISSUE HAS BEEN REPORTED PREVIOUSLY USING SEARCH!!!
   
   Please complete the next sections or the issue will be closed.
   These questions are the first thing we need to know to understand the context.
   
   -->
   
   **Apache Airflow version**: 2.0.0
   
   
   **Kubernetes version (if you are using kubernetes)** (use `kubectl version`): 1.16.15-gke.4901
   
   **Environment**:
   
   - **Cloud provider or hardware configuration**: GKE
   - **OS** (e.g. from /etc/os-release): 
   - **Kernel** (e.g. `uname -a`): 
   - **Install tools**: Using the apache/airflow docker image
   - **Others**: Running 1 pod encapsulating 2 containers (1 x webserver and 1x scheduler) running in localexecutor mode
   
   **What happened**:
   
   I have remote logging configured for tasks to send the logs to StackDriver as per the below configuration.  The logs get sent to Stackdriver okay and I can view them via the GCP console.  However I cannot view them when browsing the UI.
   
   The UI shows a spinning wheel and I see requests in the network tab to 
   `https://my_airflow_instance/get_logs_with_metadata?dag_id=XXX......`
   
   These requests take about 15 seconds to run before returning with HTTP 200 and something like this in the response body:
   
   ```
   {"message":"","metadata":{"end_of_log":false,"next_page_token":"xxxxxxxxx"}}
   ```
   
   So no actual log data
   
   **What you expected to happen**:
   
   I should see the logs in the Web UI
   
   **How to reproduce it**:
   
   Configure remote logging for StackDriver with the below config:
   
   ```
     AIRFLOW__LOGGING__GOOGLE_KEY_PATH: "/var/run/secrets/airflow/secrets/google-cloud-platform/stackdriver/credentials.json"
     AIRFLOW__LOGGING__LOG_FORMAT: "[%(asctime)s] {{%(filename)s:%(lineno)d}} %(levelname)s - %(message)s"
     AIRFLOW__LOGGING__REMOTE_LOGGING: "True"
     AIRFLOW__LOGGING__REMOTE_BASE_LOG_FOLDER: "stackdriver://airflow-tasks"
   ```
   
   **Anything else we need to know**:
   
   <!--
   
   How often does this problem occur? Once? Every time etc?
   
   Any relevant logs to include? Put them here in side a detail tag:
   <details><summary>x.log</summary> lots of stuff </details>
   
   -->
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on issue #13494: Unable to view StackDriver logs in Web UI

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #13494:
URL: https://github.com/apache/airflow/issues/13494#issuecomment-754791602


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk closed issue #13494: Unable to view StackDriver logs in Web UI

Posted by GitBox <gi...@apache.org>.
potiuk closed issue #13494:
URL: https://github.com/apache/airflow/issues/13494


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mcgin commented on issue #13494: Unable to view StackDriver logs in Web UI

Posted by GitBox <gi...@apache.org>.
mcgin commented on issue #13494:
URL: https://github.com/apache/airflow/issues/13494#issuecomment-755251412


   It's possible @mik-laj although the symptoms seem a little different, in the referenced issue the logs are retrieved (although garbled), here I'm not seeing any logs at all retrieved.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] eduartua commented on issue #13494: Unable to view StackDriver logs in Web UI

Posted by GitBox <gi...@apache.org>.
eduartua commented on issue #13494:
URL: https://github.com/apache/airflow/issues/13494#issuecomment-973251448


   @mcgin Could you tell me if you ever go this working?
   I'm having the same issue.
   Airflow config
   ```
   Apache Airflow
   version                | 2.2.2
   executor               | KubernetesExecutor
   task_logging_handler   | airflow.providers.google.cloud.log.stackdriver_task_handler.StackdriverTaskHandler
   sql_alchemy_conn       | postgresql://airflow:PASSW@IP:5432/airflow?sslmode=disable
   dags_folder            | /opt/airflow/dags/repo/dags
   plugins_folder         | /opt/airflow/plugins
   base_log_folder        | /opt/airflow/logs
   remote_base_log_folder | stackdriver://airflow
   ```
   error
   ```
   google.auth.exceptions.TransportError: ("Failed to retrieve http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/zelus-basketball-dev.svc.id.goog/?recursive=true from the Google Compute Enginemetadata service. Status: 404 Response:\nb'Not Found\\n'", <google.auth.transport.requests._Response object at 0x7ff67be7fac0>)
   
   ERROR - AuthMetadataPluginCallback "<google.auth.transport.grpc.AuthMetadataPlugin object at 0x7ff67be628e0>" raised exception!"
   ```
   When I inspect the network tab I get 
   ```
   {"message":"","metadata":{"end_of_log":false,"next_page_token":"xxxxxxxxx"}}
   ```
   Also, I'm using Workload Identity and the pods have the `logging.Viewer` role.
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk closed issue #13494: Unable to view StackDriver logs in Web UI

Posted by GitBox <gi...@apache.org>.
potiuk closed issue #13494:
URL: https://github.com/apache/airflow/issues/13494


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mcgin commented on issue #13494: Unable to view StackDriver logs in Web UI

Posted by GitBox <gi...@apache.org>.
mcgin commented on issue #13494:
URL: https://github.com/apache/airflow/issues/13494#issuecomment-755260062


   I've just left the window open for a very long time with the UI polling the get_logs_with_metadata endpoint.  I do finally see a response containing some log information in the "message" after about 10 minutes in the network tab (I can see the logs in Stackdriver much earlier than this, so it's not that the job was running and only logged then).
   
   Interestingly the UI doesn't update with the log message when it does finally arrive.  So I think there is actually 2 things happening here:
   
   - The logs are taking 10 minutes to appear via the API resulting in a lot of polling requests of approx 15/16 seconds 
   - The UI is not updating when the first logs are received are empty.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mik-laj commented on issue #13494: Unable to view StackDriver logs in Web UI

Posted by GitBox <gi...@apache.org>.
mik-laj commented on issue #13494:
URL: https://github.com/apache/airflow/issues/13494#issuecomment-754997807


   It could be related: https://github.com/apache/airflow/issues/13343


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org