question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Toggle buttons fire wrong URLs when deploying in "subdirectory"

See original GitHub issue

Apache Airflow version: 1.10.11

Kubernetes version (if you are using kubernetes) (use kubectl version): n.a.

Environment:

  • Cloud provider or hardware configuration: on-premise
  • OS (e.g. from /etc/os-release):
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
  • Kernel (e.g. uname -a): Linux basquiat 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/Linux

  • Install tools: pipenv --python $(which python3.8) && pipenv install apache-airflow

  • Others:

I changed the config to have different base URL and port and use ProxyPass in Apache to forward /airflow/ to http://localhost:8012/. This subdirectory ProxyPass is critical and kind of causes the issue.

ProxyRequests off
ProxyPass /airflow/  http://localhost:8012/
ProxyHTMLURLMap http://localhost:8012  /airflow

<Location /airflow/>
    ProxyPass http://localhost:8012/
    ProxyPassReverse http://localhost:8012/
    ProxyHTMLEnable On
    ProxyHTMLURLMap / /airflow/
    RequestHeader unset Accept-Encoding
</Location>

What happened:

When clicking on a toggle button in Column 2 (dags.html), the request is sent to the wrong url: /admin/airflow/paused instead of /airflow/admin/airflow/paused (Note the prefix mentioned in the proxy setup above)

What you expected to happen:

That the correct URL would be used, e.g. by using url_for in

https://github.com/apache/airflow/blob/ba2d6408e64f219e8f53a20a5a149e3d8109db31/airflow/www/templates/airflow/dags.html#L296-L319

instead of building the URL manually as in line https://github.com/apache/airflow/blob/ba2d6408e64f219e8f53a20a5a149e3d8109db31/airflow/www/templates/airflow/dags.html#L309

How to reproduce it:

Try to deploy in a subdirectory and proxy through as described above.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
boring-cyborg[bot]commented, Jul 30, 2020

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

0reactions
github-actions[bot]commented, Feb 14, 2022

This issue has been closed because it has not received response from the issue author.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[GitHub] [airflow] mik-laj edited a comment on issue #10061: Toggle ...
[GitHub] [airflow] mik-laj edited a comment on issue #10061: Toggle buttons fire wrong URLs when deploying in "subdirectory".
Read more >
[GitHub] [airflow] mik-laj commented on issue #10061: Toggle ...
[GitHub] [airflow] mik-laj commented on issue #10061: Toggle buttons fire wrong URLs when deploying in "subdirectory". Posted to commits@airflow.apache.org.
Read more >
wrong URLs deploying to a subdirectory - Stack Overflow
Some debugging tips: Try accessing or doing a wget for that particular url from your production server. Is it accessible? There may be...
Read more >
Troubleshoot common issues with triggers - Power Automate
Find and fix issues when your flows won't run.
Read more >
Wrong $request->url() while running on a sub-path using a ...
If that is the case, I don't have an issue with it at all. In fact, I don't have an issue with the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found