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 2022/08/02 23:44:08 UTC

[GitHub] [airflow] wolfier opened a new issue, #25492: API server /plugin crashes

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

   ### Apache Airflow version
   
   2.3.3 (latest released)
   
   ### What happened
   
   The `/plugins` endpoint returned a 500 http status code.
   
   ```
   curl -X GET http://localhost:8080/api/v1/plugins\?limit\=1  \
      -H 'Cache-Control: no-cache' \
      --user "admin:admin"
   {
     "detail": "\"{'name': 'Test View', 'category': 'Test Plugin', 'view': 'test.appbuilder_views.TestAppBuilderBaseView'}\" is not of type 'object'\n\nFailed validating 'type' in schema['allOf'][0]['properties']['plugins']['items']['properties']['appbuilder_views']['items']:\n    {'nullable': True, 'type': 'object'}\n\nOn instance['plugins'][0]['appbuilder_views'][0]:\n    (\"{'name': 'Test View', 'category': 'Test Plugin', 'view': \"\n     \"'test.appbuilder_views.TestAppBuilderBaseView'}\")",
     "status": 500,
     "title": "Response body does not conform to specification",
     "type": "http://apache-airflow-docs.s3-website.eu-central-1.amazonaws.com/docs/apache-airflow/latest/stable-rest-api-ref.html#section/Errors/Unknown"
   }
   ```
   
   ### What you think should happen instead
   
   The response should contain all the plugins integrated with Airflow.
   
   ### How to reproduce
   
   Create a simple plugin in the plugin directory.
   
   `appbuilder_views.py`
   
   ```
   from flask_appbuilder import expose, BaseView as AppBuilderBaseView
   
   
   # Creating a flask appbuilder BaseView
   class TestAppBuilderBaseView(AppBuilderBaseView):
       @expose("/")
       def test(self):
           return self.render_template("test_plugin/test.html", content="Hello galaxy!")
   
   ```
   
   `plugin.py`
   
   ```
   from airflow.plugins_manager import AirflowPlugin
   from test.appbuilder_views import TestAppBuilderBaseView
   
   
   class TestPlugin(AirflowPlugin):
       name = "test"
   
       appbuilder_views = [
           {
               "name": "Test View",
               "category": "Test Plugin",
               "view": TestAppBuilderBaseView()
           }
       ]
   
   ```
   
   Call the `/plugin` endpoint.
   
   ```
   curl -X GET http://localhost:8080/api/v1/plugins\?limit\=1  \
      -H 'Cache-Control: no-cache' \
      --user "admin:admin"
   ```
   
   ### Operating System
   
   N/A
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Astronomer
   
   ### 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: commits-unsubscribe@airflow.apache.org.apache.org

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


[GitHub] [airflow] potiuk commented on issue #25492: API server /plugin crashes

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

   You need to take a look at the error logs of webserver - there is not enough details (and rightfully so) in response returned to the client.


-- 
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] wolfier commented on issue #25492: API server /plugin crashes

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

   The error log of the webserver is the same as the detail in the api response.
   
   I have updated the issue with the error in the webserver.


-- 
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] uranusjr commented on issue #25492: API server /plugin crashes

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

   Oh it’s the other way around, `appbuilder_views` is a dict, but the schema is incorrectly defined to expect a str.


-- 
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 #25492: API server /plugin crashes

Posted by GitBox <gi...@apache.org>.
potiuk closed issue #25492: API server /plugin crashes
URL: https://github.com/apache/airflow/issues/25492


-- 
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] uranusjr commented on issue #25492: API server /plugin crashes

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

   Looks like something’s over-serialising the response. Things in `appbuilder_views` should be a dict (“object” in JSON Schema terminology) but the validator got a serialised JSON string.


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