Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking is not updated when root_path is set #180

Open
Nisha1293 opened this issue Oct 18, 2024 · 0 comments
Open

Tracking is not updated when root_path is set #180

Nisha1293 opened this issue Oct 18, 2024 · 0 comments

Comments

@Nisha1293
Copy link

When ckan.root_path is set to /ckan/{{LANG}}, accessing any page, such as the login page, datasets, or organizations, results in requests in the logs being printed with double slashes, as shown in the logs below.

2024-10-18` 10:07:09,913 INFO  [ckan.config.middleware.flask_app]  200 / render time 0.265 seconds
2024-10-18 10:08:10,418 INFO  [ckan.config.middleware.flask_app]  200 / render time 0.287 seconds
2024-10-18 10:08:20,900 INFO  [ckan.config.middleware.flask_app]  200 / render time 0.446 seconds
2024-10-18 10:08:20,973 INFO  [ckan.config.middleware.flask_app]  200 //webassets/base/757e28ef_main.css render time 0.019 seconds
2024-10-18 10:08:21,071 INFO  [ckan.config.middleware.flask_app]  200 //webassets/ckanext-activity/8dd77216_activity.css render time 0.018 seconds
2024-10-18 10:08:21,212 INFO  [ckan.config.middleware.flask_app]  200 //webassets/vendor/90dbb6bf_vendor.js render time 0.017 seconds
2024-10-18 10:08:21,215 INFO  [ckan.config.middleware.flask_app]  200 //webassets/vendor/6d1ad7e6_bootstrap.js render time 0.016 seconds
2024-10-18 10:08:21,234 INFO  [ckan.config.middleware.flask_app]  200 //webassets/vendor/529a0eb7_htmx.js render time 0.016 seconds
2024-10-18 10:08:21,246 INFO  [ckan.config.middleware.flask_app]  200 //webassets/base/a65ea3a0_main.js render time 0.014 seconds

2024-10-18 10:08:21,575 INFO  [ckan.config.middleware.flask_app]  200 //api/i18n/en render time 0.011 seconds
2024-10-18 10:08:21,606 INFO  [ckan.config.middleware.flask_app] 405 Method Not Allowed: The method is not allowed for the requested URL.
2024-10-18 10:08:22,062 INFO  [ckan.config.middleware.flask_app]  405 //_tracking render time 0.468 seconds

Nginx conf is below:

location /ckan {
        proxy_pass http://ckan:5000/;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;
        #proxy_cache cache;
        proxy_cache_bypass $cookie_auth_tkt;
        proxy_no_cache $cookie_auth_tkt;
        proxy_cache_valid 30m;
        proxy_cache_key $host$scheme$proxy_host$request_uri;
    }

I want to discuss whether this is a CKAN issue or if any changes are required in the Nginx configuration.

The tracking functionality is not working with ckan.root_path. The reason is that the request is being forwarded with //_tracking, which does not satisfy the condition in the code from this file: middleware.py.
if path == '/_tracking' and method == 'POST':

Please let me know if I am missing any configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant