You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "vdkrav93 (via GitHub)" <gi...@apache.org> on 2024/12/18 17:40:10 UTC

[D] REST API calls fail when run Airflow locally with docker [airflow]

GitHub user vdkrav93 created a discussion: REST API calls fail when run Airflow locally with docker

### Apache Airflow version

Other Airflow 2 version (please specify below)

### If "Other Airflow 2 version" selected, which one?

2.0.1.973

### What happened?

Web UI is working as expected on http://localhost:8080/home, but any REST API call, e.g.
curl --location 'http://localhost:8080/api/v1/dags' 
fails. I disabled authentication with auth_backends=airflow.api.auth.backend.default in
env-airflow-in-nsk.cfg

<!DOCTYPE html>
<html lang="en">
  <head>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
  </head>
  <body>
    <div class="container">
      <h1> Ooops! </h1>
      <div>
          <pre>
Something bad has happened.
Please consider letting us know by creating a <b><a href="https://github.com/apache/airflow/issues/new/choose">bug report using GitHub</a></b>.

Python version: 3.8.18
Airflow version: 2.0.1.973
Node: airflow-webserver
-------------------------------------------------------------------------------
Traceback (most recent call last):
  File &#34;/usr/local/lib/python3.8/dist-packages/flask/app.py&#34;, line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File &#34;/usr/local/lib/python3.8/dist-packages/flask/app.py&#34;, line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File &#34;/usr/local/lib/python3.8/dist-packages/flask/app.py&#34;, line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File &#34;/usr/local/lib/python3.8/dist-packages/flask/_compat.py&#34;, line 39, in reraise
    raise value
  File &#34;/usr/local/lib/python3.8/dist-packages/flask/app.py&#34;, line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File &#34;/usr/local/lib/python3.8/dist-packages/flask/app.py&#34;, line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File &#34;/usr/local/lib/python3.8/dist-packages/connexion/decorators/decorator.py&#34;, line 68, in wrapper
    response = function(request)
  File &#34;/usr/local/lib/python3.8/dist-packages/connexion/decorators/uri_parsing.py&#34;, line 149, in wrapper
    response = function(request)
  File &#34;/usr/local/lib/python3.8/dist-packages/connexion/decorators/validation.py&#34;, line 399, in wrapper
    return function(request)
  File &#34;/usr/local/lib/python3.8/dist-packages/connexion/decorators/response.py&#34;, line 112, in wrapper
    response = function(request)
  File &#34;/usr/local/lib/python3.8/dist-packages/connexion/decorators/parameter.py&#34;, line 120, in wrapper
    return function(**kwargs)
  File &#34;/usr/local/lib/python3.8/dist-packages/airflow/api_connexion/security.py&#34;, line 45, in decorated
    check_authentication()
  File &#34;/usr/local/lib/python3.8/dist-packages/airflow/api_connexion/security.py&#34;, line 30, in check_authentication
    response = current_app.api_auth.requires_authentication(Response)()
  File &#34;/usr/local/lib/python3.8/dist-packages/nordstrom/api/auth/backend/custom_auth_api.py&#34;, line 47, in decorated
    f&#34;&#34;&#34;Request received with path: {request.path} &#34;&#34;&#34;
  File &#34;/usr/local/lib/python3.8/dist-packages/werkzeug/datastructures.py&#34;, line 1463, in __getitem__
    return _unicodify_header_value(self.environ[&#34;HTTP_&#34; + key])
KeyError: &#39;HTTP_X_AUTHPROXY_LANID&#39;
</pre>
      </div>
    </div>
  </body>
</html>


### What you think should happen instead?

_No response_

### How to reproduce

I am running Airflow locally using my company artifactory.
Please, let me know if error is not reproducible outside our settings.
 

### Operating System

Mac OS 14.7.1 (23H222)

### Versions of Apache Airflow Providers

N/A

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


GitHub link: https://github.com/apache/airflow/discussions/45048

----
This is an automatically sent email for commits@airflow.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@airflow.apache.org


Re: [D] REST API calls fail when run Airflow locally with docker [airflow]

Posted by "Mohamedabdurahmanhassan (via GitHub)" <gi...@apache.org>.
GitHub user Mohamedabdurahmanhassan added a comment to the discussion: REST API calls fail when run Airflow locally with docker

https://github.com/apache/airflow/discussions/45048

GitHub link: https://github.com/apache/airflow/discussions/45048#discussioncomment-11687052

----
This is an automatically sent email for commits@airflow.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@airflow.apache.org


Re: [D] REST API calls fail when run Airflow locally with docker [airflow]

Posted by "Mohamedabdurahmanhassan (via GitHub)" <gi...@apache.org>.
GitHub user Mohamedabdurahmanhassan added a comment to the discussion: REST API calls fail when run Airflow locally with docker

https://github.com/apache/airflow/discussions/45048

GitHub link: https://github.com/apache/airflow/discussions/45048#discussioncomment-11687050

----
This is an automatically sent email for commits@airflow.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@airflow.apache.org


Re: [D] REST API calls fail when run Airflow locally with docker [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
GitHub user boring-cyborg[bot] added a comment to the discussion: REST API calls fail when run Airflow locally with docker

Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.


GitHub link: https://github.com/apache/airflow/discussions/45048#discussioncomment-11608580

----
This is an automatically sent email for commits@airflow.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@airflow.apache.org


Re: [D] REST API calls fail when run Airflow locally with docker [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
GitHub user potiuk added a comment to the discussion: REST API calls fail when run Airflow locally with docker

There is no such version of Airlfow: `2.0.1.973`  - this must be something internal to your company and your error is with `nordstrom/api/auth/backend/custom_auth_api.py` -> you should direct your questions to those who prepared the package and developed the custom backend - not to apache airlfow open-source project - we have no idea nor control, nor knowledge about those customisations somoene did. Find out who they were. Ask them. If you cannot find it, you need to dig through the code and get better understanding what it does.

Converting it to a discussion if more of it is needed

GitHub link: https://github.com/apache/airflow/discussions/45048#discussioncomment-11608617

----
This is an automatically sent email for commits@airflow.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@airflow.apache.org


Re: [D] REST API calls fail when run Airflow locally with docker [airflow]

Posted by "vdkrav93 (via GitHub)" <gi...@apache.org>.
GitHub user vdkrav93 added a comment to the discussion: REST API calls fail when run Airflow locally with docker

Thanks, you are absolutely right.

GitHub link: https://github.com/apache/airflow/discussions/45048#discussioncomment-11608818

----
This is an automatically sent email for commits@airflow.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@airflow.apache.org


Re: [D] REST API calls fail when run Airflow locally with docker [airflow]

Posted by "Mohamedabdurahmanhassan (via GitHub)" <gi...@apache.org>.
GitHub user Mohamedabdurahmanhassan added a comment to the discussion: REST API calls fail when run Airflow locally with docker

https://github.com/apache/airflow/discussions/45048

GitHub link: https://github.com/apache/airflow/discussions/45048#discussioncomment-11687049

----
This is an automatically sent email for commits@airflow.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@airflow.apache.org