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.

[PROPOSAL] Support legacy basePath to re-direct to new basePath

See original GitHub issue

EDIT: this description was updated to avoid confusion.

Describe the feature

Say one user had a version of Kibana and they defined the server.basePath: /legacyApp, this will start up the application as localhost:5601/legacyApp. Any saved links will be saved into the system index as localhost:5601/legacyApp/viz or any if anyone bookmarked localhost:5601/legacyApp. If any service decided to migrate from the legacy application to OpenSearch Dashboards and decided to change server.basePath: /currentApp, then the application will start up as localhost:5601/currentApp. This then means the link localhost:5601/legacyApp/viz or bookmarks will fail.

Given that server.basePath can be anything that users define, it could be server.basePath: /foobar12345, this will start up the application as localhost:5601/foobar12345, we can’t create a hardcode string to redirect (as suggested in the original issue here: /_plugin/kibana to /_dashboards).

So the suggestion here is define a new config that accepts a legacy config so that the url forwarder src file can forward users from the legacy base url to the current url if the legacy base url is defined.

To Reproduce Steps to reproduce the behavior:

  1. Create a legacy app with 6.8 and upgrade to OpenSearch Dashboards 1.0
  2. Try to access dashboards

Expected behavior Dashboards should work fine.

OpenSearch Version 1.0.

Dashboards Version 1.0.

Plugins

Please list all plugins currently enabled.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
kavillacommented, Apr 8, 2022

Domain probably shouldn’t have been mentioned.

Say one user had a version of Kibana and they defined the server.basePath: /legacyApp, this will start up the application as localhost:5601/legacyApp. Any saved links will be saved into the system index as localhost:5601/legacyApp/viz or any if anyone bookmarked localhost:5601/legacyApp. If any service decided to migrate from the legacy application to OpenSearch Dashboards and decided to change server.basePath: /currentApp, then the application will start up as localhost:5601/currentApp. This then means the link localhost:5601/legacyApp/viz or bookmarks will fail.

Given that server.basePath can be anything that users define, it could be server.basePath: /foobar12345, this will start up the application as localhost:5601/foobar12345, we can’t create a hardcode string to redirect (as suggested in the original issue here: /_plugin/kibana to /_dashboards).

So the suggestion here is define a new config that accepts a legacy config so that the url forwarder src file can forward users from the legacy base url to the current url if the legacy base url is defined.

0reactions
Flyingliuhubcommented, Apr 14, 2022

Root Cause

This issue actually happened when user created permalink in the 6.x ~7.8, and upgrade domain from (6.x ~ 7.8) to OSD 1.0, 1.1, 1.2, the permalink was writing to index url element with /app/kibana#/visualize/, it caused the trouble for rendering in the OSD1.0, 1.1, 1.2, the link will be broken as “application was not found.”

      {
        "_index" : ".kibana_92668751_admin_2",
        "_type" : "_doc",
        "_id" : "url:4010a54fcf8a29e11d328119e199d21e",
        "_score" : 1.0,
        "_source" : {
          "url" : {
            "url" : "/app/kibana#/visualize/edit/****",
            "accessCount" : 10,
            "createDate" : "2022-04-13T19:14:44.083Z",
            "accessDate" : 1649882069317
          },
          "type" : "url",
          "references" : [ ],
          "updated_at" : "2022-04-13T20:34:29.317Z"
        }
      }

Fixes

The fixes already merged in OSD1.3, it will handle the forwarding from /app/kibana#/visualize/ to /app/visualize#/. Verified the fixes in the OSD1.3, the forwarding works fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature request: Basepath support · Issue #4998 · vercel/next.js
This solves just one small issue with routing and is quite ugly because most of the my basepaths are not one level paths....
Read more >
How to redirect / into basePath in Next.js config?
So every time I enter path / I want to redirect into /docs . Here is what I've tried. module.exports = { basePath:...
Read more >
Considerations for basepath | Kibana Guide [8.5] - Elastic
Use server. rewriteBasePath to tell Kibana if it should remove the basePath from requests it receives, and to prevent a deprecation warning at...
Read more >
Rewrites - next.config.js
In contrast, redirects will reroute to a new page and show the URL changes. To use rewrites you can use the rewrites key...
Read more >
Back to Basics: Rewriting a URL in ASP.NET Core - Rick Strahl
Any middleware registered after the rewrite sees the new URL and processes the remainder of the request with the new path. All of...
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